Skip to content

Commit bbe6604

Browse files
authored
Merge branch 'master' into dependabot-pip-requirements-mypy-1.18.1
2 parents 21fecb8 + 2ec81e6 commit bbe6604

File tree

41 files changed

+215
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+215
-166
lines changed

.azure/gpu-unittests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
matrix:
2727
"PyTorch | 2.0 oldest":
2828
# Torch does not have build wheels with old Torch versions for newer CUDA
29-
docker-image: "ubuntu22.04-cuda12.1.1-py3.9-torch2.0"
29+
docker-image: "ubuntu22.04-cuda12.1.1-py3.10-torch2.0"
3030
torch-ver: "2.0"
3131
"PyTorch | 2.X stable":
3232
docker-image: "ubuntu24.04-cuda12.6.3-py3.12-torch2.8"

.devcontainer/Dockerfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/python-3/.devcontainer/base.Dockerfile
22

3-
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
4-
ARG VARIANT="3.9"
3+
# [Choice] Python version: 3, 3.10, 3.11, 3.12
4+
ARG VARIANT="3.10"
55
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
66

77
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
@@ -10,21 +10,26 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then \
1010
su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; \
1111
fi
1212

13+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
14+
ENV UV_SYSTEM_PYTHON=1
15+
1316
COPY requirements/ /tmp/pip-tmp/requirements/
1417
RUN \
15-
pip3 install awscli && \
18+
uv pip install awscli && \
1619
aws s3 sync --no-sign-request s3://sphinx-packages/ dist/ && \
17-
# trying to resolve pesq installation issue
18-
pip3 install -q "numpy<1.24" && \
19-
pip3 --disable-pip-version-check --no-cache-dir install \
20+
# trying to resolve pesq installation issue (numpy<1.24 uses distutils, removed in Python 3.12)
21+
if python3 -c "import sys; exit(0 if sys.version_info < (3, 12) else 1)"; then \
22+
uv pip install -q "numpy<1.24"; \
23+
fi && \
24+
uv pip install --no-cache --index-strategy unsafe-best-match \
2025
-r /tmp/pip-tmp/requirements/_devel.txt \
2126
-r /tmp/pip-tmp/requirements/_docs.txt \
2227
--extra-index-url="https://download.pytorch.org/whl/cpu/" \
2328
--find-links="dist/" && \
2429
rm -rf /tmp/pip-tmp
2530

2631
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
27-
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements/base.txt \
32+
# RUN uv pip install --no-cache -r /tmp/pip-tmp/requirements/base.txt \
2833
# && rm -rf /tmp/pip-tmp
2934

3035
# [Optional] Uncomment this section to install additional OS packages.

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/python-3
33
{
44
"name": "PyTorch Lightning Metrics",
5-
"image": "pytorchlightning/torchmetrics:devcontainer-py3.9",
5+
"image": "pytorchlightning/torchmetrics:devcontainer-py3.10",
66
// If you want to use a different Python version, uncomment the build object below
77
// "build": {
88
// "dockerfile": "Dockerfile",
99
// "context": "..",
1010
// "args": {
11-
// // Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
12-
// "VARIANT": "3.9",
11+
// // Update 'VARIANT' to pick a Python version: 3, 3.10, 3.11, 3.12
12+
// "VARIANT": "3.10",
1313
// // Options
1414
// "NODE_VERSION": "none"
1515
// }

.github/workflows/ci-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
import-name: "torchmetrics"
3434
testing-matrix: |
3535
{
36-
"os": ["ubuntu-22.04", "macos-13", "windows-2022"],
37-
"python-version": ["3.9", "3.11"]
36+
"os": ["ubuntu-22.04", "macOS-14", "windows-2022"],
37+
"python-version": ["3.10", "3.11"]
3838
}
3939
4040
check-md-links:

.github/workflows/ci-integrate.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,17 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
os: ["ubuntu-22.04", "macOS-13", "windows-2022"]
30-
python-version: ["3.9", "3.11"]
29+
os: ["ubuntu-22.04", "macOS-14", "windows-2022"]
30+
python-version: ["3.10", "3.11"]
3131
requires: ["oldest", "latest"]
32-
exclude:
33-
- { python-version: "3.10", requires: "oldest" }
34-
- { python-version: "3.10", os: "windows" } # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
35-
include:
36-
- { python-version: "3.10", requires: "latest", os: "ubuntu-22.04" }
37-
# - { python-version: "3.10", requires: "latest", os: "macOS-14" } # M1 machine # todo: crashing for MPS out of memory
32+
# exclude:
33+
# - { python-version: "3.10", requires: "oldest" }
34+
# - { python-version: "3.10", os: "windows" } # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
3835
env:
3936
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
4037
UV_TORCH_BACKEND: "cpu"
38+
# TODO: Remove this - Enable running MPS tests on this platform
39+
DISABLE_MPS: ${{ startsWith(matrix.os, 'macOS') && '1' || '0' }}
4140

4241
# Timeout: https://stackoverflow.com/a/59076067/4521646
4342
# seems that MacOS jobs take much more than orger OS

.github/workflows/ci-tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@ jobs:
4848
- "2.8.0"
4949
include:
5050
# cover additional python and PT combinations
51-
- { os: "ubuntu-22.04", python-version: "3.9", pytorch-version: "2.0.1", requires: "oldest" }
51+
- { os: "ubuntu-22.04", python-version: "3.10", pytorch-version: "2.0.1", requires: "oldest" }
5252
- { os: "ubuntu-22.04", python-version: "3.12", pytorch-version: "2.7.1" }
5353
- { os: "ubuntu-22.04", python-version: "3.12", pytorch-version: "2.8.0" }
54-
# standard mac machine, not the M1
55-
- { os: "macOS-13", python-version: "3.10", pytorch-version: "2.0.1" }
5654
# using the ARM based M1 machine
5755
- { os: "macOS-14", python-version: "3.10", pytorch-version: "2.0.1" }
5856
- { os: "macOS-14", python-version: "3.12", pytorch-version: "2.8.0" }

.github/workflows/docker-build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
python: ["3.9", "3.10", "3.11"]
38+
python: ["3.10", "3.11"]
3939
steps:
4040
- name: Checkout
4141
uses: actions/checkout@v5
@@ -67,7 +67,6 @@ jobs:
6767
include:
6868
# These are the base images for PL release docker images,
6969
# so include at least all the combinations in release-dockers.yml.
70-
- { python: "3.9", pytorch: "2.0.1", cuda: "12.1.1", ubuntu: "22.04" }
7170
- { python: "3.10", pytorch: "2.0.1", cuda: "12.1.1", ubuntu: "22.04" }
7271
- { python: "3.11", pytorch: "2.1.2", cuda: "12.1.1", ubuntu: "22.04" }
7372
- { python: "3.11", pytorch: "2.2.2", cuda: "12.1.1", ubuntu: "22.04" }

.github/workflows/docs-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ defaults:
1818

1919
env:
2020
FREEZE_REQUIREMENTS: "1"
21-
TORCH_URL: "https://download.pytorch.org/whl/cpu/"
2221
PYPI_CACHE: "_ci-cache_PyPI"
22+
TORCH_URL: "https://download.pytorch.org/whl/cpu/"
23+
UV_TORCH_BACKEND: "cpu"
2324
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: "python"
2425
TOKENIZERS_PARALLELISM: false
2526
SPHINX_MOCK_REQUIREMENTS: 0
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ machine: "L4_X_2"
99
parametrize:
1010
matrix:
1111
image: # note that this is setting also all oldest requirements which is linked to Torch == 2.0
12-
- "pytorchlightning/torchmetrics:ubuntu22.04-cuda12.1.1-py3.9-torch2.0"
12+
- "pytorchlightning/torchmetrics:ubuntu22.04-cuda12.1.1-py3.10-torch2.0"
1313
- "pytorchlightning/torchmetrics:ubuntu24.04-cuda12.6.3-py3.12-torch2.8"
1414
# testing: ["doctest", "common", "distributed"] # todo
1515
include: []
@@ -21,6 +21,7 @@ env:
2121
TEST_DIRS: "unittests"
2222
FREEZE_REQUIREMENTS: 1
2323
SKIP_SLOW_DOCTEST: 1
24+
LIGHTNING_CI: "1"
2425

2526
run: |
2627
whereis nvidia
@@ -81,7 +82,7 @@ run: |
8182
# UnitTesting common
8283
#if [ "$testing" == "common" ]; then
8384
python -m pytest ${TEST_DIRS} -v \
84-
-m "not DDP" --numprocesses=6 --dist=loadfile \
85+
-m "not DDP" --numprocesses=3 --dist=loadfile \
8586
--cov=torchmetrics --timeout=360 --durations=100 \
8687
--reruns 3 --reruns-delay 1
8788
# UnitTesting DDP

CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818

1919
### Changed
2020

21-
- Defaulting Dice score `average="macro"` ([#3042](https://github.com/Lightning-AI/torchmetrics/pull/3042))
21+
-
2222

2323

2424
### Deprecated
@@ -38,6 +38,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3838

3939
---
4040

41+
## [1.9.0] - 2026-03-05
42+
43+
### Changed
44+
45+
- Defaulting Dice score `average="macro"` ([#3042](https://github.com/Lightning-AI/torchmetrics/pull/3042))
46+
- Dropped Python 3.9 support, set 3.10 as minimum ([#3330](https://github.com/Lightning-AI/torchmetrics/pull/3330))
47+
- Replaced `pkg_resources` with `packaging` ([#3329](https://github.com/Lightning-AI/torchmetrics/pull/3329))
48+
49+
### Fixed
50+
51+
- Fixed device mismatch in `Metric` base class ([#3316](https://github.com/Lightning-AI/torchmetrics/pull/3316))
52+
- Fixed n-d slicing deprecation warning ([#3319](https://github.com/Lightning-AI/torchmetrics/pull/3319))
53+
- Fixed tensor copy warning in `logAUC` ([#3295](https://github.com/Lightning-AI/torchmetrics/pull/3295))
54+
- Fixed memory issues when computing retrieval metrics with high-valued indices ([#3291](https://github.com/Lightning-AI/torchmetrics/pull/3291))
55+
- Fixed race condition in `_safe_divide` by creating tensor directly on device ([#3284](https://github.com/Lightning-AI/torchmetrics/pull/3284))
56+
57+
4158
## [1.8.2] - 2025-09-03
4259

4360
### Fixed

0 commit comments

Comments
 (0)