From ac5f7fbafda70da2bdfc286305c17f9ea81d87f7 Mon Sep 17 00:00:00 2001 From: Yuanyuan Wei Date: Tue, 10 Jun 2025 22:33:50 +0000 Subject: [PATCH 1/2] Unblock NumPy 2.x https://numpy.org/devdocs/numpy_2_0_migration_guide.html ``` $ ruff check ./captum/ --select NPY201 All checks passed! ``` --- .conda/meta.yaml | 2 +- environment.yml | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.conda/meta.yaml b/.conda/meta.yaml index c82b04eab6..01c38e092f 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -16,7 +16,7 @@ requirements: - python>=3.9 - setuptools run: - - numpy<2.0 + - numpy - pytorch>=1.10 - matplotlib-base - tqdm diff --git a/environment.yml b/environment.yml index fc7d864223..3475977d34 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: captum channels: - pytorch dependencies: - - numpy<2.0 + - numpy - pytorch>=1.10 - matplotlib-base - tqdm diff --git a/setup.py b/setup.py index bb11265897..044d5051c9 100644 --- a/setup.py +++ b/setup.py @@ -162,7 +162,7 @@ def get_package_files(root, subdirs): ), install_requires=[ "matplotlib", - "numpy<2.0", + "numpy", "packaging", "torch>=1.10", "tqdm", From bee2bbcd4ef4b42b9706fd87d60a9b8d69991047 Mon Sep 17 00:00:00 2001 From: Yuanyuan Wei Date: Wed, 11 Jun 2025 00:20:56 +0000 Subject: [PATCH 2/2] Bump PyTorch version --- .conda/meta.yaml | 2 +- .github/workflows/test-pip-cpu.yml | 23 +---------------------- README.md | 2 +- environment.yml | 2 +- setup.py | 2 +- 5 files changed, 5 insertions(+), 26 deletions(-) diff --git a/.conda/meta.yaml b/.conda/meta.yaml index 01c38e092f..1b6b1cf5c4 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -17,7 +17,7 @@ requirements: - setuptools run: - numpy - - pytorch>=1.10 + - pytorch>=2.3 - matplotlib-base - tqdm - packaging diff --git a/.github/workflows/test-pip-cpu.yml b/.github/workflows/test-pip-cpu.yml index 83a513ac21..dadda6210b 100644 --- a/.github/workflows/test-pip-cpu.yml +++ b/.github/workflows/test-pip-cpu.yml @@ -12,30 +12,9 @@ jobs: tests: strategy: matrix: - pytorch_args: ["-v 1.10", "-v 1.11", "-v 1.12", "-v 1.13", "-v 2.0.0", "-v 2.1.0", "-v 2.2.0", "-v 2.3.0"] + pytorch_args: ["-v 2.3.0", "-v 2.4.0", "-v 2.5.0", "-v 2.6.0", "-v 2.7.0"] transformers_args: ["-t 4.38.0", "-t 4.39.0", "-t 4.41.0", "-t 4.43.0", "-t 4.45.2"] docker_img: ["cimg/python:3.9", "cimg/python:3.10", "cimg/python:3.11", "cimg/python:3.12"] - exclude: - - pytorch_args: "-v 1.10" - docker_img: "cimg/python:3.10" - - pytorch_args: "-v 1.10" - docker_img: "cimg/python:3.11" - - pytorch_args: "-v 1.11" - docker_img: "cimg/python:3.11" - - pytorch_args: "-v 1.12" - docker_img: "cimg/python:3.11" - - pytorch_args: "-v 1.10" - docker_img: "cimg/python:3.12" - - pytorch_args: "-v 1.11" - docker_img: "cimg/python:3.12" - - pytorch_args: "-v 1.12" - docker_img: "cimg/python:3.12" - - pytorch_args: "-v 1.13" - docker_img: "cimg/python:3.12" - - pytorch_args: "-v 2.0.0" - docker_img: "cimg/python:3.12" - - pytorch_args: "-v 2.1.0" - docker_img: "cimg/python:3.12" fail-fast: false uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: diff --git a/README.md b/README.md index 96439648ce..d7d87fd6dc 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Captum can also be used by application engineers who are using trained models in **Installation Requirements** - Python >= 3.9 -- PyTorch >= 1.10 +- PyTorch >= 2.3 ##### Installing the latest release diff --git a/environment.yml b/environment.yml index 3475977d34..4112558d7b 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - pytorch dependencies: - numpy - - pytorch>=1.10 + - pytorch>=2.3 - matplotlib-base - tqdm - packaging diff --git a/setup.py b/setup.py index 044d5051c9..4c1d93173f 100644 --- a/setup.py +++ b/setup.py @@ -164,7 +164,7 @@ def get_package_files(root, subdirs): "matplotlib", "numpy", "packaging", - "torch>=1.10", + "torch>=2.3", "tqdm", ], packages=find_packages(exclude=("tests", "tests.*")),