@@ -38,42 +38,29 @@ jobs:
38
38
strategy :
39
39
fail-fast : false
40
40
matrix :
41
- include :
41
+ os : [macOS-14, ubuntu-22.04, windows-2022]
42
+ config :
42
43
# only run PyTorch latest
43
- - { os: "macOS-14", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
44
- - { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
45
- - { os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
46
- - { os: "macOS-14", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
47
- - { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
48
- - { os: "windows-2022", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
49
- - { os: "macOS-14", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
50
- - { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
51
- - { os: "windows-2022", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
52
- - { os: "macOS-14", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
53
- - { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
54
- - { os: "windows-2022", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
55
- - { os: "macOS-14", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
56
- - { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
57
- - { os: "windows-2022", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
44
+ - { pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
45
+ - { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
46
+ - { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
47
+ - { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
48
+ - { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
49
+
58
50
# only run PyTorch latest with Python latest, use Fabric scope to limit dependency issues
59
- - { os: "macOS-14", pkg-name: "fabric", python-version: "3.12.7", pytorch-version: "2.6" }
60
- - { os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.12.7", pytorch-version: "2.6" }
61
- - { os: "windows-2022", pkg-name: "fabric", python-version: "3.12.7", pytorch-version: "2.6" }
62
- # "oldest" versions tests, only on minimum Python
63
- - { os: "macOS-14", pkg-name: "fabric", pytorch-version: "2.1", requires: "oldest" }
64
- - { os: "ubuntu-22.04", pkg-name: "fabric", pytorch-version: "2.1", requires: "oldest" }
65
- - { os: "windows-2022", pkg-name: "fabric", pytorch-version: "2.1", requires: "oldest" }
51
+ - { pkg-name: "fabric", python-version: "3.12.7", pytorch-version: "2.6" }
52
+
66
53
# "fabric" installs the standalone package
67
- - { os: "macOS-14", pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.7" }
68
- - { os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.7" }
69
- - { os: "windows-2022", pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.7" }
54
+ - { pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.7" }
55
+
70
56
# adding recently cut Torch 2.7 - FUTURE
71
- - { os: "macOS-14", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.8" }
72
- - { os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.8" }
73
- - { os: "windows-2022", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.8" }
57
+ - { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.8" }
58
+
59
+ # "oldest" versions tests, only on minimum Python
60
+ - { pkg-name: "fabric", pytorch-version: "2.1", requires: "oldest" }
74
61
timeout-minutes : 25 # because of building grpcio on Mac
75
62
env :
76
- PACKAGE_NAME : ${{ matrix.pkg-name }}
63
+ PACKAGE_NAME : ${{ matrix.config. pkg-name }}
77
64
FREEZE_REQUIREMENTS : ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
78
65
PYPI_CACHE_DIR : " _pip-wheels"
79
66
TORCH_URL_STABLE : " https://download.pytorch.org/whl/cpu/"
@@ -83,10 +70,10 @@ jobs:
83
70
steps :
84
71
- uses : actions/checkout@v5
85
72
86
- - name : Set up Python ${{ matrix.python-version }}
73
+ - name : Set up Python ${{ matrix.config. python-version }}
87
74
uses : actions/setup-python@v5
88
75
with :
89
- python-version : ${{ matrix.python-version || '3.9' }}
76
+ python-version : ${{ matrix.config. python-version || '3.9' }}
90
77
91
78
- name : basic setup
92
79
run : pip install -q -r .actions/requirements.txt
106
93
pip install -q -r requirements/ci.txt
107
94
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py
108
95
for fpath in `ls requirements/**/*.txt`; do \
109
- python ./adjust-torch-versions.py $fpath ${{ matrix.pytorch-version }}; \
96
+ python ./adjust-torch-versions.py $fpath ${{ matrix.config. pytorch-version }}; \
110
97
done
111
98
112
99
- name : pip wheels cache
@@ -121,11 +108,11 @@ jobs:
121
108
- name : Expand Env. variables
122
109
run : |
123
110
# Switch PyTorch URL between stable and test/future
124
- python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.pytorch-version }}' == '2.7' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
111
+ python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.config. pytorch-version }}' == '2.7' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
125
112
# Switch coverage scope
126
- python -c "print('COVERAGE_SCOPE=' + str('lightning' if '${{matrix.pkg-name}}' == 'lightning' else 'lightning_fabric'))" >> $GITHUB_ENV
113
+ python -c "print('COVERAGE_SCOPE=' + str('lightning' if '${{matrix.config. pkg-name}}' == 'lightning' else 'lightning_fabric'))" >> $GITHUB_ENV
127
114
# if you install mono-package set dependency only for this subpackage
128
- python -c "print('EXTRA_PREFIX=' + str('' if '${{matrix.pkg-name}}' != 'lightning' else 'fabric-'))" >> $GITHUB_ENV
115
+ python -c "print('EXTRA_PREFIX=' + str('' if '${{matrix.config. pkg-name}}' != 'lightning' else 'fabric-'))" >> $GITHUB_ENV
129
116
- name : Append Env. vars for MacOS
130
117
if : ${{ runner.os == 'macOS' }}
131
118
run : |
@@ -155,7 +142,7 @@ jobs:
155
142
cache-key : " pypi_wheels"
156
143
157
144
- name : Adjust tests
158
- if : ${{ matrix.pkg-name != 'lightning' }}
145
+ if : ${{ matrix.config. pkg-name != 'lightning' }}
159
146
run : |
160
147
python .actions/assistant.py copy_replace_imports --source_dir="./tests" \
161
148
--source_import="lightning.fabric" --target_import="lightning_fabric"
@@ -188,7 +175,7 @@ jobs:
188
175
with :
189
176
token : ${{ secrets.CODECOV_TOKEN }}
190
177
file : tests/tests_fabric/coverage.xml
191
- flags : ${{ env.COVERAGE_SCOPE }},cpu,pytest,python${{ matrix.python-version }}
178
+ flags : ${{ env.COVERAGE_SCOPE }},cpu,pytest,python${{ matrix.config. python-version }}
192
179
name : CPU-coverage
193
180
fail_ci_if_error : false
194
181
0 commit comments