Skip to content

Commit 3bd133b

Browse files
Bordaawaelchlipre-commit-ci[bot]
authored
CI: enable testing with coming PT 2.2 (#19289)
* ci: build dockers for PT 2.2 * py3.12 * --pre --extra-index-url * typing-extensions * bump jsonargparse * install latest jsonargparse * Add windows skips for Fabric * convert to xfail * add pytorch skips * skip checkpoint consolidation test * set max torch --------- Co-authored-by: awaelchli <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent ee9f17e commit 3bd133b

File tree

24 files changed

+152
-26
lines changed

24 files changed

+152
-26
lines changed

.azure/gpu-tests-fabric.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ jobs:
5959
"Fabric | latest":
6060
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.0"
6161
PACKAGE_NAME: "fabric"
62+
"Fabric | future":
63+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.11-torch2.2-cuda12.1.0"
64+
PACKAGE_NAME: "fabric"
6265
"Lightning | latest":
6366
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.0"
6467
PACKAGE_NAME: "lightning"
@@ -73,6 +76,10 @@ jobs:
7376
scope=$(python -c 'n = "$(PACKAGE_NAME)" ; print(dict(fabric="lightning_fabric").get(n, n))')
7477
echo "##vso[task.setvariable variable=COVERAGE_SOURCE]$scope"
7578
displayName: "set env. vars"
79+
- bash: |
80+
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/test/cu${CUDA_VERSION_MM}/torch_test.html"
81+
condition: endsWith(variables['Agent.JobName'], 'future')
82+
displayName: "set env. vars 4 future"
7683
7784
- bash: |
7885
echo $(DEVICES)
@@ -99,7 +106,7 @@ jobs:
99106
100107
- bash: |
101108
extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))")
102-
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links ${TORCH_URL}
109+
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links="${TORCH_URL}"
103110
displayName: "Install package & dependencies"
104111
105112
- bash: |

.azure/gpu-tests-pytorch.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ jobs:
5151
"PyTorch | latest":
5252
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.0"
5353
PACKAGE_NAME: "pytorch"
54+
"PyTorch | future":
55+
# todo: failed to install `pygame` with py3.11
56+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.2-cuda12.1.0"
57+
PACKAGE_NAME: "pytorch"
5458
"Lightning | latest":
5559
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.0"
5660
PACKAGE_NAME: "lightning"
@@ -76,6 +80,10 @@ jobs:
7680
scope=$(python -c 'n = "$(PACKAGE_NAME)" ; print(dict(pytorch="pytorch_lightning").get(n, n))')
7781
echo "##vso[task.setvariable variable=COVERAGE_SOURCE]$scope"
7882
displayName: "set env. vars"
83+
- bash: |
84+
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/test/cu${CUDA_VERSION_MM}/torch_test.html"
85+
condition: endsWith(variables['Agent.JobName'], 'future')
86+
displayName: "set env. vars 4 future"
7987
8088
- bash: |
8189
echo $(DEVICES)
@@ -109,7 +117,7 @@ jobs:
109117
110118
- bash: |
111119
extra=$(python -c "print({'lightning': 'pytorch-'}.get('$(PACKAGE_NAME)', ''))")
112-
pip install -e ".[${extra}dev]" -r requirements/_integrations/strategies.txt pytest-timeout -U --find-links ${TORCH_URL}
120+
pip install -e ".[${extra}dev]" -r requirements/_integrations/strategies.txt pytest-timeout -U --find-links="${TORCH_URL}"
113121
displayName: "Install package & dependencies"
114122
115123
- bash: pip uninstall -y lightning

.github/workflows/ci-tests-fabric.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ jobs:
4545
- { os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.10", pytorch-version: "1.13" }
4646
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.9", pytorch-version: "1.12" }
4747
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "1.13" }
48-
# only run PyTorch latest with Python recent
48+
# only run PyTorch latest
4949
- { os: "macOS-11", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0" }
5050
- { os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0" }
5151
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0" }
5252
- { os: "macOS-11", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.1" }
5353
- { os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.1" }
5454
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.1" }
55+
# only run PyTorch future
56+
- { os: "macOS-12", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2" }
57+
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2" }
58+
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2" }
5559
# only run PyTorch latest with Python latest, use Fabric scope to limit dependency issues
5660
- { os: "macOS-12", pkg-name: "fabric", python-version: "3.11", pytorch-version: "2.0" }
5761
- { os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.11", pytorch-version: "2.0" }
@@ -128,7 +132,7 @@ jobs:
128132
- name: Env. variables
129133
run: |
130134
# Switch PyTorch URL
131-
#python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.release }}' == 'pre' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
135+
python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.pytorch-version }}' == '2.2' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
132136
# Switch coverage scope
133137
python -c "print('COVERAGE_SCOPE=' + str('lightning' if '${{matrix.pkg-name}}' == 'lightning' else 'lightning_fabric'))" >> $GITHUB_ENV
134138
# if you install mono-package set dependency only for this subpackage
@@ -157,7 +161,7 @@ jobs:
157161
158162
- name: Testing Warnings
159163
working-directory: tests/tests_fabric
160-
# needs to run outside of `pytest`
164+
# needs to run outside `pytest`
161165
run: python utilities/test_warnings.py
162166

163167
- name: Testing Fabric

.github/workflows/ci-tests-pytorch.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,17 @@ jobs:
4949
- { os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.10", pytorch-version: "1.13" }
5050
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.9", pytorch-version: "1.12" }
5151
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "1.13" }
52-
# only run PyTorch latest with Python recent
52+
# only run PyTorch latest
5353
- { os: "macOS-11", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0" }
5454
- { os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0" }
5555
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0" }
5656
- { os: "macOS-11", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
5757
- { os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
5858
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
59+
# only run PyTorch future
60+
- { os: "macOS-12", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.2" }
61+
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.2" }
62+
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.2" }
5963
# only run PyTorch latest with Python latest, use PyTorch scope to limit dependency issues
6064
- { os: "macOS-12", pkg-name: "pytorch", python-version: "3.11", pytorch-version: "2.0" }
6165
- { os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.11", pytorch-version: "2.0" }
@@ -134,7 +138,7 @@ jobs:
134138
- name: Env. variables
135139
run: |
136140
# Switch PyTorch URL
137-
#python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.release }}' == 'pre' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
141+
python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.pytorch-version }}' == '2.2' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
138142
# Switch coverage scope
139143
python -c "print('COVERAGE_SCOPE=' + str('lightning' if '${{matrix.pkg-name}}' == 'lightning' else 'pytorch_lightning'))" >> $GITHUB_ENV
140144
# if you install mono-package set dependency only for this subpackage
@@ -194,7 +198,7 @@ jobs:
194198
195199
- name: Testing Warnings
196200
working-directory: tests/tests_pytorch
197-
# needs to run outside of `pytest`
201+
# needs to run outside `pytest`
198202
run: python utilities/test_warnings.py
199203

200204
- name: Testing PyTorch

.github/workflows/docker-build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
tags = [f"latest-py{py_ver}-torch{pt_ver}-cuda{cuda_ver}"]
7676
if ver:
7777
tags += [f"{ver}-py{py_ver}-torch{pt_ver}-cuda{cuda_ver}"]
78-
if py_ver == '3.10' and pt_ver == '2.0' and cuda_ver == '12.0.1':
78+
if py_ver == '3.10' and pt_ver == '2.1' and cuda_ver == '12.1.0':
7979
tags += ["latest"]
8080
8181
tags = [f"{repo}:{tag}" for tag in tags]
@@ -103,12 +103,16 @@ jobs:
103103
matrix:
104104
include:
105105
# These are the base images for PL release docker images,
106-
# so include at least all of the combinations in release-dockers.yml.
106+
# so include at least all the combinations in release-dockers.yml.
107107
- { python_version: "3.9", pytorch_version: "1.12", cuda_version: "11.7.1" }
108108
- { python_version: "3.9", pytorch_version: "1.13", cuda_version: "11.8.0" }
109109
- { python_version: "3.9", pytorch_version: "1.13", cuda_version: "12.0.1" }
110110
- { python_version: "3.10", pytorch_version: "2.0", cuda_version: "11.8.0" }
111111
- { python_version: "3.10", pytorch_version: "2.1", cuda_version: "12.1.0" }
112+
- { python_version: "3.10", pytorch_version: "2.2", cuda_version: "12.1.0" }
113+
- { python_version: "3.11", pytorch_version: "2.1", cuda_version: "12.1.0" }
114+
- { python_version: "3.11", pytorch_version: "2.2", cuda_version: "12.1.0" }
115+
# - { python_version: "3.12", pytorch_version: "2.2", cuda_version: "12.1.0" } # todo: pending on `onnxruntime`
112116
steps:
113117
- uses: actions/checkout@v4
114118
- uses: docker/setup-buildx-action@v3

dockers/base-cuda/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
ARG UBUNTU_VERSION=20.04
15+
ARG UBUNTU_VERSION=22.04
1616
ARG CUDA_VERSION=11.7.1
1717

1818

@@ -38,7 +38,7 @@ RUN \
3838
# https://github.com/NVIDIA/nvidia-docker/issues/1631
3939
# https://github.com/NVIDIA/nvidia-docker/issues/1631#issuecomment-1264715214
4040
apt-get update && apt-get install -y wget && \
41-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub && \
41+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub && \
4242
mkdir -p /etc/apt/keyrings/ && mv 3bf863cc.pub /etc/apt/keyrings/ && \
4343
echo "deb [signed-by=/etc/apt/keyrings/3bf863cc.pub] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /" /etc/apt/sources.list.d/cuda.list && \
4444
apt-get update -qq --fix-missing && \
@@ -82,9 +82,7 @@ COPY requirements/_integrations/ requirements/_integrations/
8282
ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages"
8383

8484
RUN \
85-
wget https://bootstrap.pypa.io/get-pip.py --progress=bar:force:noscroll --no-check-certificate && \
86-
python${PYTHON_VERSION} get-pip.py && \
87-
rm get-pip.py && \
85+
curl https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} && \
8886
# Disable cache \
8987
pip config set global.cache-dir false && \
9088
# set particular PyTorch version \
@@ -99,7 +97,8 @@ RUN \
9997
-r requirements/pytorch/extra.txt \
10098
-r requirements/pytorch/test.txt \
10199
-r requirements/pytorch/strategies.txt \
102-
--find-links "https://download.pytorch.org/whl/cu${CUDA_VERSION_MM//'.'/''}/torch_stable.html"
100+
--find-links="https://download.pytorch.org/whl/cu${CUDA_VERSION_MM//'.'/''}/torch_stable.html" \
101+
--find-links="https://download.pytorch.org/whl/test/cu${CUDA_VERSION_MM//'.'/''}/torch_test.html"
103102

104103
RUN \
105104
# Show what we have

requirements/app/app.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
lightning-cloud == 0.5.61 # Must be pinned to ensure compatibility
22
packaging
3-
typing-extensions >=4.4.0, <4.8.0
3+
typing-extensions >=4.4.0, <4.10.0
44
deepdiff >=5.7.0, <6.6.0
55
fsspec[http] >=2022.5.0, <2023.11.0
66
croniter >=1.3.0, <1.5.0 # strict; TODO: for now until we find something more robust.

requirements/fabric/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ numpy >=1.17.2, <1.27.0
55
torch >=1.12.0, <2.2.0
66
fsspec[http] >=2022.5.0, <2023.11.0
77
packaging >=20.0, <=23.1
8-
typing-extensions >=4.4.0, <4.8.0
8+
typing-extensions >=4.4.0, <4.10.0
99
lightning-utilities >=0.8.0, <0.10.0

requirements/pytorch/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ PyYAML >=5.4, <6.1.0
88
fsspec[http] >=2022.5.0, <2023.11.0
99
torchmetrics >=0.7.0, <1.3.0 # needed for using fixed compare_version
1010
packaging >=20.0, <=23.1
11-
typing-extensions >=4.4.0, <4.8.0
11+
typing-extensions >=4.4.0, <4.10.0
1212
lightning-utilities >=0.8.0, <0.10.0

requirements/pytorch/extra.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
matplotlib>3.1, <3.9.0
66
omegaconf >=2.0.5, <2.4.0
77
hydra-core >=1.0.5, <1.4.0
8-
jsonargparse[signatures] >=4.26.1, <4.27.0
8+
jsonargparse[signatures] >=4.26.1, <4.28.0
99
rich >=12.3.0, <13.6.0
1010
tensorboardX >=2.2, <2.7.0 # min version is set by torch.onnx missing attribute
1111
bitsandbytes ==0.41.0 # strict

0 commit comments

Comments
 (0)