@@ -36,49 +36,51 @@ jobs:
36
36
37
37
steps :
38
38
- uses : actions/checkout@v4
39
+
39
40
- name : Set up Python 3.10
40
- uses : actions /setup-python@v5
41
+ uses : astral-sh /setup-uv@v6
41
42
with :
42
43
python-version : " 3.10"
43
- architecture : " x64"
44
+ activate-environment : true
45
+ enable-cache : true
46
+
47
+ - name : Check lock
48
+ id : check-lock
49
+ run : |
50
+ uv lock --check
44
51
45
52
- name : Get year & week number
46
53
id : get-date
47
- run : echo "date=$(/bin/date "+%Y-%U")" >> $GITHUB_OUTPUT
48
54
shell : bash -l {0}
55
+ run : echo "date=$(/bin/date "+%Y-%U")" >> $GITHUB_OUTPUT
49
56
50
57
- name : Get pip cache dir
51
58
id : pip-cache
59
+ shell : bash -l {0}
52
60
run : |
53
- pip3 install -U "pip<24"
61
+ uv pip install -U "pip<24"
54
62
echo "pip_cache=$(pip cache dir)" >> $GITHUB_OUTPUT
55
- shell : bash -l {0}
56
-
57
- - uses : actions/cache@v4
58
- with :
59
- path : |
60
- ${{ steps.pip-cache.outputs.pip_cache }}
61
- key : ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }}
62
- restore-keys : |
63
- ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.xla-version }}-
64
63
65
64
- name : Install Torch XLA and others
66
65
run : |
67
66
68
67
## Install mkl (alternative approach to https://github.com/pytorch/xla/blob/b0ba29f98a695671972d4a4cc07441014dba2892/.kokoro/common.sh#L31-L32)
69
68
sudo apt-get update && sudo apt-get install -y libopenblas-dev libomp5
70
- pip install mkl==2021.4.0
69
+ uv pip install mkl==2021.4.0
71
70
72
71
## Install torch & xla and torchvision
73
- pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
74
- pip install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly-cp310-cp310-linux_x86_64.whl
72
+ uv pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
73
+ ## TODO: download file and rename as valid file with version
74
+ curl -o torch_xla-2.5.0+gitf0bbaeb-cp310-cp310-linux_x86_64.whl https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly-cp310-cp310-linux_x86_64.whl
75
+ uv pip install torch_xla-2.5.0+gitf0bbaeb-cp310-cp310-linux_x86_64.whl
76
+ # uv pip install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly-cp310-cp310-linux_x86_64.whl
75
77
76
78
# Check installation
77
79
python -c "import torch"
78
80
79
81
## Install test deps and Ignite
80
- pip install -r requirements-dev.txt
81
- pip install .
82
+ uv pip install -r requirements-dev.txt
83
+ uv pip install .
82
84
83
85
# Download MNIST: https://github.com/pytorch/ignite/issues/1737
84
86
# to "/tmp" for tpu tests
0 commit comments