Skip to content

Commit dff5db2

Browse files
authored
Merge branch 'master' into ioannis@18861-CSVLogger-fails-on-remote-fs
2 parents 27ae13d + db77fa7 commit dff5db2

File tree

18 files changed

+666
-110
lines changed

18 files changed

+666
-110
lines changed

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

Lines changed: 29 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -42,42 +42,29 @@ jobs:
4242
strategy:
4343
fail-fast: false
4444
matrix:
45-
include:
45+
os: [macOS-14, ubuntu-22.04, windows-2022]
46+
config:
4647
# only run PyTorch latest
47-
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
48-
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
49-
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
50-
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
51-
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
52-
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
53-
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
54-
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
55-
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
56-
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
57-
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
58-
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
59-
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
60-
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
61-
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
48+
- { pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
49+
- { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
50+
- { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
51+
- { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
52+
- { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
53+
6254
# only run PyTorch latest with Python latest, use PyTorch scope to limit dependency issues
63-
- { os: "macOS-14", pkg-name: "pytorch", python-version: "3.12.7", pytorch-version: "2.6" }
64-
- { os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.12.7", pytorch-version: "2.6" }
65-
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.12.7", pytorch-version: "2.6" }
66-
# "oldest" versions tests, only on minimum Python
67-
- { os: "macOS-14", pkg-name: "pytorch", pytorch-version: "2.1", requires: "oldest" }
68-
- { os: "ubuntu-22.04", pkg-name: "pytorch", pytorch-version: "2.1", requires: "oldest" }
69-
- { os: "windows-2022", pkg-name: "pytorch", pytorch-version: "2.1", requires: "oldest" }
55+
- { pkg-name: "pytorch", python-version: "3.12.7", pytorch-version: "2.6" }
56+
7057
# "pytorch" installs the standalone package
71-
- { os: "macOS-14", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.7" }
72-
- { os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.7" }
73-
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.7" }
58+
- { pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.7" }
59+
7460
# adding recently cut Torch 2.7 - FUTURE
75-
- { os: "macOS-14", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.8" }
76-
- { os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.8" }
77-
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.8" }
61+
- { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.8" }
62+
63+
# "oldest" versions tests, only on minimum Python
64+
- { pkg-name: "pytorch", pytorch-version: "2.1", requires: "oldest" }
7865
timeout-minutes: 50
7966
env:
80-
PACKAGE_NAME: ${{ matrix.pkg-name }}
67+
PACKAGE_NAME: ${{ matrix.config.pkg-name }}
8168
TORCH_URL: "https://download.pytorch.org/whl/cpu/"
8269
TORCH_URL_STABLE: "https://download.pytorch.org/whl/cpu/"
8370
TORCH_URL_TEST: "https://download.pytorch.org/whl/test/cpu/"
@@ -88,10 +75,10 @@ jobs:
8875
steps:
8976
- uses: actions/checkout@v5
9077

91-
- name: Set up Python ${{ matrix.python-version }}
78+
- name: Set up Python ${{ matrix.config.python-version }}
9279
uses: actions/setup-python@v5
9380
with:
94-
python-version: ${{ matrix.python-version || '3.9' }}
81+
python-version: ${{ matrix.config.python-version || '3.9' }}
9582

9683
- name: basic setup
9784
run: pip install -q -r .actions/requirements.txt
@@ -111,7 +98,7 @@ jobs:
11198
pip install -q -r requirements/ci.txt
11299
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py
113100
for fpath in `ls requirements/**/*.txt`; do \
114-
python ./adjust-torch-versions.py $fpath ${{ matrix.pytorch-version }}; \
101+
python ./adjust-torch-versions.py $fpath ${{ matrix.config.pytorch-version }}; \
115102
done
116103
cat requirements/pytorch/base.txt
117104
@@ -127,13 +114,13 @@ jobs:
127114
- name: Env. variables
128115
run: |
129116
# Switch PyTorch URL between stable and test/future
130-
python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.pytorch-version }}' == '2.7' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
117+
python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.config.pytorch-version }}' == '2.7' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
131118
# Switch coverage scope
132-
python -c "print('COVERAGE_SCOPE=' + str('lightning' if '${{matrix.pkg-name}}' == 'lightning' else 'pytorch_lightning'))" >> $GITHUB_ENV
119+
python -c "print('COVERAGE_SCOPE=' + str('lightning' if '${{matrix.config.pkg-name}}' == 'lightning' else 'pytorch_lightning'))" >> $GITHUB_ENV
133120
# if you install mono-package set dependency only for this subpackage
134-
python -c "print('EXTRA_PREFIX=' + str('' if '${{matrix.pkg-name}}' != 'lightning' else 'pytorch-'))" >> $GITHUB_ENV
121+
python -c "print('EXTRA_PREFIX=' + str('' if '${{matrix.config.pkg-name}}' != 'lightning' else 'pytorch-'))" >> $GITHUB_ENV
135122
# Avoid issue on Windows with PyTorch 2.4: "RuntimeError: use_libuv was requested but PyTorch was build without libuv support"
136-
python -c "print('USE_LIBUV=0' if '${{matrix.os}}' == 'windows-2022' and '${{matrix.pytorch-version}}' == '2.4' else '')" >> $GITHUB_ENV
123+
python -c "print('USE_LIBUV=0' if '${{matrix.os}}' == 'windows-2022' and '${{matrix.config.pytorch-version}}' == '2.4' else '')" >> $GITHUB_ENV
137124
138125
- name: Install package & dependencies
139126
timeout-minutes: 20
@@ -146,11 +133,11 @@ jobs:
146133
--find-links="https://download.pytorch.org/whl/torch-tensorrt"
147134
pip list
148135
- name: Drop LAI from extensions
149-
if: ${{ matrix.pkg-name != 'lightning' }}
136+
if: ${{ matrix.config.pkg-name != 'lightning' }}
150137
# Lightning is dependency of Habana or other accelerators/integrations so in case we test PL we need to remove it
151138
run: pip uninstall -y lightning
152139
- name: Drop PL for LAI
153-
if: ${{ matrix.pkg-name == 'lightning' }}
140+
if: ${{ matrix.config.pkg-name == 'lightning' }}
154141
run: pip uninstall -y pytorch-lightning
155142
- name: Dump handy wheels
156143
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
@@ -171,10 +158,10 @@ jobs:
171158
run: |
172159
set -e
173160
python requirements/pytorch/check-avail-extras.py
174-
python -c "from torch import __version__ as ver; assert ver.startswith('${{ matrix.pytorch-version }}'), ver"
161+
python -c "from torch import __version__ as ver; assert ver.startswith('${{ matrix.config.pytorch-version }}'), ver"
175162
176163
- name: Adjust tests / env. -> PL
177-
if: ${{ matrix.pkg-name != 'lightning' }}
164+
if: ${{ matrix.config.pkg-name != 'lightning' }}
178165
run: |
179166
python .actions/assistant.py copy_replace_imports --source_dir="./tests" \
180167
--source_import="lightning.fabric,lightning.pytorch" \
@@ -224,7 +211,7 @@ jobs:
224211
with:
225212
token: ${{ secrets.CODECOV_TOKEN }}
226213
file: tests/tests_pytorch/coverage.xml
227-
flags: ${{ env.COVERAGE_SCOPE }},cpu,pytest-full,python${{ matrix.python-version }},pytorch${{ matrix.pytorch-version }}
214+
flags: ${{ env.COVERAGE_SCOPE }},cpu,pytest-full,python${{ matrix.config.python-version }},pytorch${{ matrix.config.pytorch-version }}
228215
name: CPU-coverage
229216
fail_ci_if_error: false
230217

.github/workflows/docs-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ jobs:
165165
path: docs/build/html/
166166

167167
- name: Authenticate to Google Cloud
168-
uses: google-github-actions/auth@v2
168+
uses: google-github-actions/auth@v3
169169
with:
170170
credentials_json: ${{ secrets.GCS_SA_KEY }}
171171

172172
- name: Setup gcloud
173-
uses: google-github-actions/setup-gcloud@v2
173+
uses: google-github-actions/setup-gcloud@v3
174174
with:
175175
project_id: ${{ secrets.GCS_PROJECT }}
176176

.lightning/workflows/fabric.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@ trigger:
44
pull_request:
55
branches: ["master"]
66

7-
timeout: "75" # minutes
8-
machine: "L4_X_2"
7+
timeout: "55" # minutes
98
parametrize:
109
matrix: {}
1110
include:
12-
# note that this is setting also all oldest requirements which is linked to Torch == 2.0
11+
# note that this is setting also all oldest requirements which is linked to Torch == 2.1
1312
- image: "pytorchlightning/pytorch_lightning:base-cuda12.1.1-py3.10-torch2.1"
1413
PACKAGE_NAME: "fabric"
15-
- image: "pytorchlightning/pytorch_lightning:base-cuda12.6.3-py3.12-torch2.7"
14+
machine: "A100_X_2"
15+
- image: "pytorchlightning/pytorch_lightning:base-cuda12.6.3-py3.12-torch2.8"
1616
PACKAGE_NAME: "fabric"
17+
machine: "L4_X_2"
1718
# - image: "pytorchlightning/pytorch_lightning:base-cuda12.6.3-py3.12-torch2.7"
1819
# PACKAGE_NAME: "fabric"
19-
- image: "pytorchlightning/pytorch_lightning:base-cuda12.6.3-py3.12-torch2.7"
20+
- image: "pytorchlightning/pytorch_lightning:base-cuda12.6.3-py3.12-torch2.8"
2021
PACKAGE_NAME: "lightning"
22+
machine: "L4_X_2"
2123
exclude: []
2224

2325
env:
@@ -30,6 +32,7 @@ run: |
3032
python --version
3133
pip --version
3234
pip install -q fire wget packaging
35+
pip list
3336
set -ex
3437
3538
CUDA_VERSION="${image##*cuda}" # Remove everything up to and including "cuda"
@@ -40,12 +43,15 @@ run: |
4043
echo "Torch URL: ${TORCH_URL}"
4144
COVERAGE_SOURCE=$(python -c 'n = "$(PACKAGE_NAME)" ; print(dict(fabric="lightning_fabric").get(n, n))')
4245
echo "collecting coverage for: ${COVERAGE_SOURCE}"
46+
TORCH_VER=$(python -c "import torch; print(torch.__version__.rsplit('.', 1)[0])")
4347
4448
if [ "${TORCH_VER}" == "2.1" ]; then
4549
echo "Set oldest versions"
46-
cd requirements/fabric
50+
pip uninstall -y deepspeed
4751
pip install -U "lightning-utilities[cli]"
52+
cd requirements/fabric
4853
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'strategies.txt']"
54+
python -m lightning_utilities.cli requirements prune-pkgs --packages deepspeed --req_files strategies.txt
4955
cd ../..
5056
pip install "cython<3.0" wheel # for compatibility
5157
fi
@@ -92,6 +98,7 @@ run: |
9298
export PL_RUN_STANDALONE_TESTS=1
9399
wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/run_standalone_tests.sh
94100
bash ./run_standalone_tests.sh "tests_fabric"
101+
export PL_RUN_STANDALONE_TESTS=0
95102
96103
# echo "Reporting coverage" # todo
97104
# python -m coverage report

.lightning/workflows/pytorch.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@ trigger:
44
pull_request:
55
branches: ["master"]
66

7-
timeout: "75" # minutes
8-
machine: "L4_X_2"
7+
timeout: "55" # minutes
98
parametrize:
109
matrix: {}
1110
include:
12-
# note that this is setting also all oldest requirements which is linked to Torch == 2.0
11+
# note that this is setting also all oldest requirements which is linked to Torch == 2.1
1312
- image: "pytorchlightning/pytorch_lightning:base-cuda12.1.1-py3.10-torch2.1"
1413
PACKAGE_NAME: "pytorch"
15-
- image: "pytorchlightning/pytorch_lightning:base-cuda12.6.3-py3.12-torch2.7"
14+
machine: "A100_X_2"
15+
- image: "pytorchlightning/pytorch_lightning:base-cuda12.6.3-py3.12-torch2.8"
1616
PACKAGE_NAME: "pytorch"
17+
machine: "L4_X_2"
1718
# - image: "pytorchlightning/pytorch_lightning:base-cuda12.6.3-py3.12-torch2.7"
1819
# PACKAGE_NAME: "pytorch"
19-
- image: "pytorchlightning/pytorch_lightning:base-cuda12.6.3-py3.12-torch2.7"
20+
- image: "pytorchlightning/pytorch_lightning:base-cuda12.6.3-py3.12-torch2.8"
2021
PACKAGE_NAME: "lightning"
22+
machine: "L4_X_2"
2123
exclude: []
2224

2325
env:
@@ -30,6 +32,7 @@ run: |
3032
python --version
3133
pip --version
3234
pip install -q fire wget packaging
35+
pip list
3336
set -ex
3437
3538
CUDA_VERSION="${image##*cuda}" # Remove everything up to and including "cuda"
@@ -40,12 +43,15 @@ run: |
4043
echo "Torch URL: ${TORCH_URL}"
4144
COVERAGE_SOURCE=$(python -c 'n = "$(PACKAGE_NAME)" ; print(dict(fabric="pytorch_lightning").get(n, n))')
4245
echo "collecting coverage for: ${COVERAGE_SOURCE}"
46+
TORCH_VER=$(python -c "import torch; print(torch.__version__.rsplit('.', 1)[0])")
4347
4448
if [ "${TORCH_VER}" == "2.1" ]; then
45-
recho "Set oldest versions"
46-
cd requirements/pytorch
49+
echo "Set oldest versions"
50+
pip uninstall -y deepspeed
4751
pip install -U "lightning-utilities[cli]"
52+
cd requirements/pytorch
4853
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'extra.txt', 'strategies.txt', 'examples.txt']"
54+
python -m lightning_utilities.cli requirements prune-pkgs --packages deepspeed --req_files strategies.txt
4955
cd ../..
5056
pip install "cython<3.0" wheel # for compatibility
5157
fi
@@ -108,6 +114,7 @@ run: |
108114
export PL_RUN_STANDALONE_TESTS=1
109115
wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/run_standalone_tests.sh
110116
bash ./run_standalone_tests.sh "tests_pytorch"
117+
export PL_RUN_STANDALONE_TESTS=0
111118
112119
echo "Testing: PyTorch standalone tasks"
113120
cd tests_pytorch/

dockers/base-cuda/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
ARG UBUNTU_VERSION=22.04
16-
ARG CUDA_VERSION=11.7.1
16+
ARG CUDA_VERSION=12.1.1
1717

1818

1919
FROM nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}

0 commit comments

Comments
 (0)