Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: proper setting oldest/latest for integrations & PL>=1.9 #2129

Merged
merged 37 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
84e54f4
ci: proper setting oldest for integrations
Borda Oct 2, 2023
b6c2bb8
pool
Borda Oct 2, 2023
13ea27e
pillow
Borda Oct 2, 2023
cc22a13
Apply suggestions from code review
Borda Oct 6, 2023
4fa8058
Merge branch 'master' into ci/oldest
Borda Oct 7, 2023
e3a02db
Merge branch 'master' into ci/oldest
Borda Oct 9, 2023
5cad574
Adjust versions
Borda Oct 9, 2023
a7c49e2
wget
Borda Oct 9, 2023
4446d7e
wget
Borda Oct 9, 2023
e81203e
reorder
Borda Oct 9, 2023
cd9dc5b
cat
Borda Oct 9, 2023
7d3071a
docker
Borda Oct 9, 2023
4a40f0e
2.0.1
Borda Oct 9, 2023
85e0ae3
set -e
Borda Oct 9, 2023
11570d3
pl <1.8
Borda Oct 10, 2023
90abbb9
ci fixing
Borda Oct 10, 2023
992f2c8
wget
Borda Oct 10, 2023
bad4590
install
Borda Oct 10, 2023
fd536bd
Merge branch 'master' into ci/oldest
Borda Oct 10, 2023
8cd7297
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 10, 2023
dedb118
Merge branch 'master' into ci/oldest
Borda Oct 10, 2023
acec6d8
Merge branch 'master' into ci/oldest
Borda Oct 11, 2023
d6d8551
_
Borda Oct 11, 2023
6f783dc
_tests.txt
Borda Oct 11, 2023
89004bc
pytorch-lightning >=1.9.0, <2.1.0
Borda Oct 11, 2023
0f3991b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 11, 2023
ac8f18a
oldest for integrate
Borda Oct 11, 2023
2a69e1f
Merge branch 'ci/oldest' of https://github.com/PyTorchLightning/metri…
Borda Oct 11, 2023
1e5e984
assist
Borda Oct 11, 2023
63ceef8
pytorch-lightning >=1.8.0
Borda Oct 11, 2023
935ea02
cleaning
Borda Oct 11, 2023
352b7ac
Merge branch 'master' into ci/oldest
Borda Oct 11, 2023
3edc415
wget
Borda Oct 11, 2023
0c7f65a
Merge branch 'ci/oldest' of https://github.com/PyTorchLightning/metri…
Borda Oct 11, 2023
178b55e
Merge branch 'master' into ci/oldest
Borda Oct 11, 2023
42e6fef
<2.0
Borda Oct 11, 2023
8392cb5
Merge branch 'master' into ci/oldest
Borda Oct 17, 2023
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
9 changes: 6 additions & 3 deletions .azure/gpu-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
"oldest":
docker-image: "pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime"
torch-ver: "1.11.0"
requires: "oldest"
"latest":
docker-image: "pytorch/pytorch:2.0.0-cuda11.7-cudnn8-runtime"
torch-ver: "2.0.0"
Borda marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -67,11 +68,13 @@ jobs:
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py
python adjust-torch-versions.py requirements/base.txt $(torch-ver)
python adjust-torch-versions.py requirements/integrate.txt $(torch-ver)
# FixMe: this shall not be for all integrations/cases
python .github/assistant.py set-oldest-versions --req_files='["requirements/integrate.txt"]'
cat requirements/integrate.txt
displayName: "Adjust versions"

- bash: |
python .github/assistant.py set-oldest-versions --req_files='["requirements/integrate.txt"]'
condition: and(succeeded(), eq(variables['requires'], 'oldest'))
displayName: "Setting oldest req."

- bash: |
pip install -q -r requirements/integrate.txt
# force reinstall TM as it could be overwritten by integration's dependencies
Expand Down
9 changes: 2 additions & 7 deletions .azure/gpu-unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,22 @@ jobs:
- job: unitest_GPU
strategy:
matrix:
"PyTorch | old":
"PyTorch | 1.8":
# Torch does not have build wheels with old Torch versions for newer CUDA
docker-image: "pytorchlightning/torchmetrics:ubuntu20.04-cuda11.1.1-py3.8-torch1.8.1"
agent-pool: "lit-rtx-3090"
torch-ver: "1.8.1"
"PyTorch | 1.X":
docker-image: "pytorchlightning/torchmetrics:ubuntu22.04-cuda11.8.0-py3.9-torch1.13"
agent-pool: "lit-rtx-3090"
torch-ver: "1.13.1"
"PyTorch | 2.X":
docker-image: "pytorchlightning/torchmetrics:ubuntu22.04-cuda11.8.0-py3.10-torch2.0"
agent-pool: "lit-rtx-3090"
torch-ver: "2.0.1"
# how long to run the job before automatically cancelling
timeoutInMinutes: "120"
# how much time to give 'run always even if cancelled tasks' before stopping them
cancelTimeoutInMinutes: "2"

pool: "$(agent-pool)"
pool: "lit-rtx-3090"

variables:
DEVICES: $( python -c 'name = "$(Agent.Name)" ; gpus = name.split("_")[-1] if "_" in name else "0,1"; print(gpus)' )
Expand Down Expand Up @@ -81,11 +78,9 @@ jobs:
- bash: |
pip install -q packaging
wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py
python adjust-torch-versions.py requirements.txt $(torch-ver)
for fpath in `ls requirements/*.txt`; do
python adjust-torch-versions.py $fpath $(torch-ver)
done
# FixMe: missing setting minumal configurations for testing
displayName: "Adjust versions"

- bash: |
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/ci-integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ jobs:
with:
requires: ${{ matrix.requires }}

- name: Freeze PIL (hotfix)
# import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__
run: pip install "Pillow<9.0" # It messes with torchvision

- name: Install all dependencies
run: |
set -e
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ jobs:
pip install -r requirements/doctest.txt -U -f $PYPI_CACHE
pip list

# todo: copy this to install checks
- name: DocTests
timeout-minutes: 25
working-directory: ./src
Expand All @@ -107,11 +106,6 @@ jobs:
# NOTE: run coverage on tests does not propagate failure status for Win, https://github.com/nedbat/coveragepy/issues/1003
run: python -m pytest torchmetrics --reruns 3 --reruns-delay 2

- name: Freeze PIL (hotfix)
if: ${{ matrix.python-version != '3.11' }}
# import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__
run: pip install "Pillow<9.0" # It messes with torchvision

- name: Install all dependencies
run: |
curl https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py -o adjust-torch-versions.py
Expand Down
10 changes: 9 additions & 1 deletion src/torchmetrics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
r"""Root package info."""
"""Root package info."""
import logging as __logging
import os

from lightning_utilities.core.imports import package_available

from torchmetrics.__about__ import * # noqa: F403

_logger = __logging.getLogger("torchmetrics")
Expand All @@ -11,6 +13,12 @@
_PACKAGE_ROOT = os.path.dirname(__file__)
_PROJECT_ROOT = os.path.dirname(_PACKAGE_ROOT)

if package_available("PIL"):
import PIL
Borda marked this conversation as resolved.
Show resolved Hide resolved

if not hasattr(PIL, "PILLOW_VERSION"):
PIL.PILLOW_VERSION = PIL.__version__

from torchmetrics import functional # noqa: E402
from torchmetrics.aggregation import ( # noqa: E402
CatMetric,
Expand Down
Loading