@@ -20,27 +20,35 @@ runs:
20
20
with :
21
21
python-version : ' 3.11'
22
22
miniconda-version : latest
23
- - name : Initialize Conda environment
23
+ - name : Configure build environment
24
24
shell : bash
25
25
run : |
26
+ # initialize Conda
26
27
conda config --set solver libmamba
27
28
conda update -y -q conda
28
- - name : Configure Conda environment
29
- shell : bash
30
- run : |
29
+ echo "$CONDA/bin" >> $GITHUB_PATH
30
+
31
+ # install base packages
31
32
conda install -y -q -c conda-forge gxx_linux-64=11.2 sysroot_linux-64=2.28
32
33
conda install -y -q python=3.11 cmake make swig mkl=2023 mkl-devel=2023 numpy scipy pytest
33
- echo "$CONDA/bin" >> $GITHUB_PATH
34
- - name : Install CUDA
35
- if : inputs.gpu == 'ON' && inputs.raft == 'OFF'
36
- shell : bash
37
- run : |
38
- conda install -y -q cuda-toolkit -c "nvidia/label/cuda-11.8.0"
39
- - name : Install RAFT
40
- if : inputs.raft == 'ON'
41
- shell : bash
42
- run : |
43
- conda install -y -q libraft cuda-version=11.8 cuda-toolkit -c rapidsai-nightly -c "nvidia/label/cuda-11.8.0" -c conda-forge
34
+
35
+ # install CUDA packages
36
+ if [ "${{ inputs.gpu }}" = "ON" ] && [ "${{ inputs.raft }}" = "OFF" ]; then
37
+ conda install -y -q cuda-toolkit -c "nvidia/label/cuda-11.8.0"
38
+ fi
39
+
40
+ # install RAFT packages
41
+ if [ "$${{ inputs.raft }}" = "ON" ]; then
42
+ conda install -y -q libraft cuda-version=11.8 cuda-toolkit -c rapidsai-nightly -c "nvidia/label/cuda-11.8.0" -c conda-forge
43
+ fi
44
+
45
+ # install test packages
46
+ conda install -y pytest
47
+ if [ "${{ inputs.gpu }}" = "ON" ]; then
48
+ conda install -y -q pytorch pytorch-cuda=11.8 -c pytorch -c nvidia/label/cuda-11.8.0
49
+ else
50
+ conda install -y -q pytorch -c pytorch
51
+ fi
44
52
- name : Build all targets
45
53
shell : bash
46
54
run : |
@@ -69,22 +77,16 @@ runs:
69
77
working-directory : build/faiss/python
70
78
run : |
71
79
$CONDA/bin/python setup.py install
72
- - name : Install pytest
73
- shell : bash
74
- run : |
75
- conda install -y pytest
76
80
- name : Python tests (CPU only)
77
81
if : inputs.gpu == 'OFF'
78
82
shell : bash
79
83
run : |
80
- conda install -y -q pytorch -c pytorch
81
84
pytest --junitxml=test-results/pytest/results.xml tests/test_*.py
82
85
pytest --junitxml=test-results/pytest/results-torch.xml tests/torch_*.py
83
86
- name : Python tests (CPU + GPU)
84
87
if : inputs.gpu == 'ON'
85
88
shell : bash
86
89
run : |
87
- conda install -y -q pytorch pytorch-cuda=11.8 -c pytorch -c nvidia/label/cuda-11.8.0
88
90
pytest --junitxml=test-results/pytest/results.xml tests/test_*.py
89
91
pytest --junitxml=test-results/pytest/results-torch.xml tests/torch_*.py
90
92
cp tests/common_faiss_tests.py faiss/gpu/test
0 commit comments