58
58
59
59
# install test packages
60
60
conda install -y pytest
61
- if [ "${{ inputs.gpu }}" = "ON" ]; then
61
+ if [ "${{ inputs.rocm }}" = "ON" ]; then
62
+ : # skip torch install via conda, we need to install via pip to get
63
+ # ROCm-enabled version until it's supported in conda by PyTorch
64
+ elif [ "${{ inputs.gpu }}" = "ON" ]; then
62
65
conda install -y -q pytorch pytorch-cuda=12.4 -c pytorch -c nvidia/label/cuda-12.4.0
63
66
else
64
67
conda install -y -q pytorch -c pytorch
@@ -138,14 +141,19 @@ runs:
138
141
working-directory : build/faiss/python
139
142
run : |
140
143
$CONDA/bin/python setup.py install
144
+ - name : ROCm - install ROCm-enabled torch via pip
145
+ if : inputs.rocm == 'ON'
146
+ shell : bash
147
+ run : |
148
+ pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1
141
149
- name : Python tests (CPU only)
142
150
if : inputs.gpu == 'OFF'
143
151
shell : bash
144
152
run : |
145
153
pytest --junitxml=test-results/pytest/results.xml tests/test_*.py
146
154
pytest --junitxml=test-results/pytest/results-torch.xml tests/torch_*.py
147
155
- name : Python tests (CPU + GPU)
148
- if : inputs.gpu == 'ON' && inputs.rocm == 'OFF'
156
+ if : inputs.gpu == 'ON'
149
157
shell : bash
150
158
run : |
151
159
pytest --junitxml=test-results/pytest/results.xml tests/test_*.py
@@ -160,7 +168,6 @@ runs:
160
168
FAISS_DISABLE_CPU_FEATURES=AVX2 LD_DEBUG=libs $CONDA/bin/python -c "import faiss" 2>&1 | grep faiss.so
161
169
LD_DEBUG=libs $CONDA/bin/python -c "import faiss" 2>&1 | grep faiss_avx2.so
162
170
- name : Upload test results
163
- if : inputs.rocm == 'OFF'
164
171
uses : actions/upload-artifact@v4
165
172
with :
166
173
name : test-results-arch=${{ runner.arch }}-opt=${{ inputs.opt_level }}-gpu=${{ inputs.gpu }}-raft=${{ inputs.raft }}-rocm=${{ inputs.rocm }}
0 commit comments