Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure/gpu-unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
// }
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/ci-integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ 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" }
- { python-version: "3.10", os: "windows" } # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
include:
- { python-version: "3.10", requires: "latest", os: "ubuntu-22.04" }
# - { python-version: "3.10", requires: "latest", os: "macOS-14" } # M1 machine # todo: crashing for MPS out of memory
# exclude:
# - { python-version: "3.10", requires: "oldest" }
# - { python-version: "3.10", os: "windows" } # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
env:
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
UV_TORCH_BACKEND: "cpu"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -126,8 +126,8 @@ jobs:

- name: Install package
run: |
uv pip install . -U "${{ matrix.requires == 'oldest' && 'setuptools<82.0.0' || 'setuptools' }}" \
-r requirements/_doctest.txt $PIP_EXTRA_URL
uv pip install . -U setuptools -r requirements/_doctest.txt \
$PIP_EXTRA_URL
uv pip list
timeout-minutes: 25

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
8 changes: 4 additions & 4 deletions dockers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ 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-cuda11.7.1-py3.10-torch2.0 \
-f dockers/base-cuda/Dockerfile \
--build-arg PYTHON_VERSION=3.9 \
--build-arg PYTORCH_VERSION=1.13 \
--build-arg PYTHON_VERSION=3.10 \
--build-arg PYTORCH_VERSION=2.0 \
--build-arg CUDA_VERSION=11.7.1 \
.
```
Expand Down Expand Up @@ -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-cuda11.7.1-py3.10-torch2.0
```
2 changes: 1 addition & 1 deletion docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sphinx:
build:
os: "ubuntu-22.04"
tools:
python: "3.9"
python: "3.10"
commands:
- printenv
- pwd ; ls -lh
Expand Down
5 changes: 2 additions & 3 deletions requirements/_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sphinx-gallery ==0.19.0
ipython >8.0, <10.0

lightning >=1.8.0, <2.6.0
lightning-utilities ==0.15.2
lightning-utilities ==0.15.3
pydantic > 1.0.0, < 3.0.0

# integrations
Expand All @@ -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
2 changes: 1 addition & 1 deletion requirements/audio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
numpy >1.20.0, <2.4.0
packaging >17.1
torch >=2.0.0, <2.9.0
lightning-utilities >=0.8.0, <0.16.0
lightning-utilities >=0.15.3, <0.16.0
5 changes: 2 additions & 3 deletions requirements/classification_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ 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")
PyTDC ==0.4.1 ; platform_system == "Windows" and python_version < "3.12"
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,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(),
Expand All @@ -256,7 +256,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",
Expand Down
Loading