diff --git a/.azure/gpu-unittests.yml b/.azure/gpu-unittests.yml index 8d287268df1..1e706b87eba 100644 --- a/.azure/gpu-unittests.yml +++ b/.azure/gpu-unittests.yml @@ -26,7 +26,7 @@ jobs: matrix: "PyTorch | 2.0 oldest": # Torch does not have build wheels with old Torch versions for newer CUDA - docker-image: "ubuntu22.04-cuda12.1.1-py3.9-torch2.0" + docker-image: "ubuntu22.04-cuda12.1.1-py3.10-torch2.0" torch-ver: "2.0" "PyTorch | 2.X stable": docker-image: "ubuntu24.04-cuda12.6.3-py3.12-torch2.8" diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 692f0a3b581..221b97d0a34 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,7 @@ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/python-3/.devcontainer/base.Dockerfile -# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6 -ARG VARIANT="3.9" +# [Choice] Python version: 3, 3.10, 3.11, 3.12 +ARG VARIANT="3.10" FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT} # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 438c5aa66d4..3b4b8098d1b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,14 +2,14 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/python-3 { "name": "PyTorch Lightning Metrics", - "image": "pytorchlightning/torchmetrics:devcontainer-py3.9", + "image": "pytorchlightning/torchmetrics:devcontainer-py3.10", // If you want to use a different Python version, uncomment the build object below // "build": { // "dockerfile": "Dockerfile", // "context": "..", // "args": { - // // Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9 - // "VARIANT": "3.9", + // // Update 'VARIANT' to pick a Python version: 3, 3.10, 3.11, 3.12 + // "VARIANT": "3.10", // // Options // "NODE_VERSION": "none" // } diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index 07e580f04f3..bd6188fcd66 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -34,7 +34,7 @@ jobs: testing-matrix: | { "os": ["ubuntu-22.04", "macOS-14", "windows-2022"], - "python-version": ["3.9", "3.11"] + "python-version": ["3.10", "3.11"] } check-md-links: diff --git a/.github/workflows/ci-integrate.yml b/.github/workflows/ci-integrate.yml index 678ad2a16aa..0bf1da7f2e9 100644 --- a/.github/workflows/ci-integrate.yml +++ b/.github/workflows/ci-integrate.yml @@ -27,7 +27,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-22.04", "macOS-14", "windows-2022"] - python-version: ["3.9", "3.11"] + python-version: ["3.10", "3.11"] requires: ["oldest", "latest"] exclude: - { python-version: "3.10", requires: "oldest" } diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index ae3cf7087ad..cd1a8119441 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -48,7 +48,7 @@ jobs: - "2.8.0" include: # cover additional python and PT combinations - - { os: "ubuntu-22.04", python-version: "3.9", pytorch-version: "2.0.1", requires: "oldest" } + - { os: "ubuntu-22.04", python-version: "3.10", pytorch-version: "2.0.1", requires: "oldest" } - { os: "ubuntu-22.04", python-version: "3.12", pytorch-version: "2.7.1" } - { os: "ubuntu-22.04", python-version: "3.12", pytorch-version: "2.8.0" } # using the ARM based M1 machine diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 5f269aa30d1..ac28c4238b3 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -35,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.9", "3.10", "3.11"] + python: ["3.10", "3.11"] steps: - name: Checkout uses: actions/checkout@v5 @@ -67,7 +67,6 @@ jobs: include: # These are the base images for PL release docker images, # so include at least all the combinations in release-dockers.yml. - - { python: "3.9", pytorch: "2.0.1", cuda: "12.1.1", ubuntu: "22.04" } - { python: "3.10", pytorch: "2.0.1", cuda: "12.1.1", ubuntu: "22.04" } - { python: "3.11", pytorch: "2.1.2", cuda: "12.1.1", ubuntu: "22.04" } - { python: "3.11", pytorch: "2.2.2", cuda: "12.1.1", ubuntu: "22.04" } diff --git a/.lightning/workflows/uinttests.yml b/.lightning/workflows/unittests.yml similarity index 99% rename from .lightning/workflows/uinttests.yml rename to .lightning/workflows/unittests.yml index b3e91c3eafc..0c9cda62edf 100644 --- a/.lightning/workflows/uinttests.yml +++ b/.lightning/workflows/unittests.yml @@ -9,7 +9,7 @@ machine: "L4_X_2" parametrize: matrix: image: # note that this is setting also all oldest requirements which is linked to Torch == 2.0 - - "pytorchlightning/torchmetrics:ubuntu22.04-cuda12.1.1-py3.9-torch2.0" + - "pytorchlightning/torchmetrics:ubuntu22.04-cuda12.1.1-py3.10-torch2.0" - "pytorchlightning/torchmetrics:ubuntu24.04-cuda12.6.3-py3.12-torch2.8" # testing: ["doctest", "common", "distributed"] # todo include: [] diff --git a/dockers/README.md b/dockers/README.md index 29409c89f89..b8df6a67f9d 100644 --- a/dockers/README.md +++ b/dockers/README.md @@ -11,11 +11,11 @@ git clone https://github.com/Lightning-AI/torchmetrics.git docker image build -t torchmetrics:latest -f dockers/ubuntu-cuda/Dockerfile . # build with specific arguments -docker image build -t torchmetrics:ubuntu-cuda11.7.1-py3.9-torch1.13 \ +docker image build -t torchmetrics:ubuntu-cuda12.1.1-py3.10-torch2.0 \ -f dockers/base-cuda/Dockerfile \ - --build-arg PYTHON_VERSION=3.9 \ - --build-arg PYTORCH_VERSION=1.13 \ - --build-arg CUDA_VERSION=11.7.1 \ + --build-arg PYTHON_VERSION=3.10 \ + --build-arg PYTORCH_VERSION=2.0.1 \ + --build-arg CUDA_VERSION=12.1.1 \ . ``` @@ -50,5 +50,5 @@ sudo systemctl restart docker and later run the docker image with `--gpus all`. For example, ```bash -docker run --rm -it --gpus all torchmetrics:ubuntu-cuda11.7.1-py3.9-torch1.12 +docker run --rm -it --gpus all torchmetrics:ubuntu-cuda12.1.1-py3.10-torch2.0 ``` diff --git a/dockers/ubuntu-cuda/Dockerfile b/dockers/ubuntu-cuda/Dockerfile index 7cab4ba1480..8716082e579 100644 --- a/dockers/ubuntu-cuda/Dockerfile +++ b/dockers/ubuntu-cuda/Dockerfile @@ -13,13 +13,13 @@ # limitations under the License. ARG UBUNTU_VERSION=22.04 -ARG CUDA_VERSION=11.7.1 +ARG CUDA_VERSION=12.1.1 FROM nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION} ARG PYTHON_VERSION=3.10 -ARG PYTORCH_VERSION=2.0 +ARG PYTORCH_VERSION=2.0.1 SHELL ["/bin/bash", "-c"] # https://techoverflow.net/2019/05/18/how-to-fix-configuring-tzdata-interactive-input-when-building-docker-images/ diff --git a/docs/.readthedocs.yaml b/docs/.readthedocs.yaml index 6fde686a020..e1f74f08e6e 100644 --- a/docs/.readthedocs.yaml +++ b/docs/.readthedocs.yaml @@ -29,7 +29,7 @@ sphinx: build: os: "ubuntu-22.04" tools: - python: "3.9" + python: "3.10" commands: - printenv - pwd ; ls -lh diff --git a/requirements/_docs.txt b/requirements/_docs.txt index 873b219c7dc..6bdb99f457b 100644 --- a/requirements/_docs.txt +++ b/requirements/_docs.txt @@ -31,5 +31,4 @@ pydantic > 1.0.0, < 3.0.0 # -------------------------- # todo: until this has resolution - https://github.com/sphinx-gallery/sphinx-gallery/issues/1290 # Image -scikit-image ~=0.22; python_version < "3.10" -scikit-image ~=0.25; python_version > "3.9" # we do not use `> =` because of oldest replcement +scikit-image ~=0.25 diff --git a/requirements/audio.txt b/requirements/audio.txt index 134fa3fe32c..76838881ddd 100644 --- a/requirements/audio.txt +++ b/requirements/audio.txt @@ -8,4 +8,4 @@ torchaudio >=2.0.1, <2.9.0 gammatone >=1.0.0, <1.1.0 librosa >=0.10.0, <0.12.0 onnxruntime >=1.12.0, <1.23 # installing onnxruntime_gpu-gpu failed on macos -requests >=2.19.0, <2.33.0 +requests >=2.22.0, <2.33.0 diff --git a/requirements/classification_test.txt b/requirements/classification_test.txt index 87a40795316..78e1c237afa 100644 --- a/requirements/classification_test.txt +++ b/requirements/classification_test.txt @@ -7,7 +7,7 @@ numpy <2.4.0 fairlearn # group_fairness # locauc, temporal_dependency -PyTDC @ https://github.com/Lightning-Sandbox/PyTDC/archive/bb9f7cbcbd6f894e0e94676cad12d60710aee042.zip ; platform_system != "Windows" and python_version > "3.9" +PyTDC @ https://github.com/Lightning-Sandbox/PyTDC/archive/bb9f7cbcbd6f894e0e94676cad12d60710aee042.zip ; platform_system != "Windows" # switch to old version on Windows due AssertionError: error when building libtiledbsoma from source -# switch to old version for Python <3.10 due to impossible version/dependency resolving -PyTDC ==0.4.1 ; python_version <"3.10" or (platform_system == "Windows" and python_version < "3.12") +# switch to old version for Python <3.12 on Windows due to impossible version/dependency resolving +PyTDC ==0.4.1 ; platform_system == "Windows" and python_version < "3.12" diff --git a/setup.py b/setup.py index 4b9ae4b01e7..cb1d7889cc6 100755 --- a/setup.py +++ b/setup.py @@ -216,7 +216,7 @@ def _prepare_extras(skip_pattern: str = "^_", skip_files: tuple[str] = ("base.tx include_package_data=True, zip_safe=False, keywords=["deep learning", "machine learning", "pytorch", "metrics", "AI"], - python_requires=">=3.9", + python_requires=">=3.10", setup_requires=[], install_requires=BASE_REQUIREMENTS, extras_require=_prepare_extras(), @@ -242,7 +242,6 @@ def _prepare_extras(skip_pattern: str = "^_", skip_files: tuple[str] = ("base.tx # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12",