@@ -35,6 +35,9 @@ defaults:
35
35
run :
36
36
shell : bash
37
37
38
+ env :
39
+ UV_SYSTEM_PYTHON : 1
40
+
38
41
jobs :
39
42
pl-cpu :
40
43
runs-on : ${{ matrix.os }}
@@ -69,33 +72,39 @@ jobs:
69
72
TORCH_URL_STABLE : " https://download.pytorch.org/whl/cpu/"
70
73
TORCH_URL_TEST : " https://download.pytorch.org/whl/test/cpu/"
71
74
FREEZE_REQUIREMENTS : ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
72
- PYPI_CACHE_DIR : " _pip-wheels "
75
+ UV_CACHE_DIR : /tmp/.uv-cache
73
76
# TODO: Remove this - Enable running MPS tests on this platform
74
77
DISABLE_MPS : ${{ matrix.os == 'macOS-14' && '1' || '0' }}
75
78
steps :
76
79
- uses : actions/checkout@v5
77
80
78
- - name : Set up Python ${{ matrix.config.python-version }}
79
- uses : actions /setup-python@v5
81
+ - name : Install uv and set Python version
82
+ uses : astral-sh /setup-uv@v6
80
83
with :
81
84
python-version : ${{ matrix.config.python-version || '3.9' }}
82
85
83
- - name : basic setup
84
- run : pip install -q -r .actions/requirements.txt
86
+ - name : Restore uv cache
87
+ uses : actions/cache@v4
88
+ with :
89
+ path : ${{ env.UV_CACHE_DIR }}
90
+ key : uv-cache-${{ matrix.os }}-${{ matrix.config.python-version || '3.9' }}
91
+
92
+ - name : Basic setup
93
+ run : uv pip install -q -r .actions/requirements.txt
85
94
86
95
- name : Set min. dependencies
87
96
if : ${{ matrix.requires == 'oldest' }}
88
97
run : |
89
98
cd requirements/pytorch
90
- pip install -U "lightning-utilities[cli]"
99
+ uv pip install -U "lightning-utilities[cli]"
91
100
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'extra.txt', 'strategies.txt', 'examples.txt', 'test.txt']"
92
- pip install "cython<3.0" wheel
93
- pip install "pyyaml==5.4" --no-build-isolation
101
+ uv pip install "cython<3.0" wheel
102
+ uv pip install "pyyaml==5.4" --no-build-isolation
94
103
95
104
- name : Adjust PyTorch versions in requirements files
96
105
if : ${{ matrix.requires != 'oldest' }}
97
106
run : |
98
- pip install -q -r requirements/ci.txt
107
+ uv pip install -q -r requirements/ci.txt
99
108
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py
100
109
for fpath in `ls requirements/**/*.txt`; do \
101
110
python ./adjust-torch-versions.py $fpath ${{ matrix.config.pytorch-version }}; \
@@ -125,7 +134,7 @@ jobs:
125
134
- name : Install package & dependencies
126
135
timeout-minutes : 20
127
136
run : |
128
- pip install ".[${EXTRA_PREFIX}extra,${EXTRA_PREFIX}test,${EXTRA_PREFIX}strategies]" \
137
+ uv pip install ".[${EXTRA_PREFIX}extra,${EXTRA_PREFIX}test,${EXTRA_PREFIX}strategies]" \
129
138
-U --upgrade-strategy=eager --prefer-binary \
130
139
-r requirements/_integrations/accelerators.txt \
131
140
--extra-index-url="${TORCH_URL}" \
@@ -135,10 +144,12 @@ jobs:
135
144
- name : Drop LAI from extensions
136
145
if : ${{ matrix.config.pkg-name != 'lightning' }}
137
146
# Lightning is dependency of Habana or other accelerators/integrations so in case we test PL we need to remove it
138
- run : pip uninstall -y lightning
147
+ run : uv pip uninstall -y lightning
148
+
139
149
- name : Drop PL for LAI
140
150
if : ${{ matrix.config.pkg-name == 'lightning' }}
141
- run : pip uninstall -y pytorch-lightning
151
+ run : uv pip uninstall -y pytorch-lightning
152
+
142
153
- name : Dump handy wheels
143
154
if : github.event_name == 'push' && github.ref == 'refs/heads/master'
144
155
continue-on-error : true
@@ -215,6 +226,9 @@ jobs:
215
226
name : CPU-coverage
216
227
fail_ci_if_error : false
217
228
229
+ - name : Minimize uv cache
230
+ run : uv cache prune --ci
231
+
218
232
pl-cpu-guardian :
219
233
runs-on : ubuntu-latest
220
234
needs : pl-cpu
0 commit comments