Re add cuvs to cmakelists.txt (#4953)

Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4953

Reviewed By: scsiguy

Differential Revision: D97118209

fbshipit-source-id: f29135b7801664fbbf8cb65c836ad1a92b2193db
This commit is contained in:
Michael Norris
2026-03-19 08:06:00 -07:00
committed by meta-codesync[bot]
parent e57a8939c9
commit 645a742b51
5 changed files with 49 additions and 23 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ runs:
:
# regular CUDA for GPU builds
elif [ "${{ inputs.gpu }}" = "ON" ] && [ "${{ inputs.cuvs }}" = "OFF" ]; then
conda install -y -q cuda-toolkit=12.6 gxx_linux-64=12.4 -c "nvidia/label/cuda-12.6"
conda install -y -q cuda-libraries-dev=12.6 cuda-nvcc=12.6 cuda-nvtx=12.6 cuda-cupti=12.6 cuda-cudart-dev=12.6 gxx_linux-64=12.4 -c "nvidia/label/cuda-12.6"
# and CUDA from cuVS channel for cuVS builds
elif [ "${{ inputs.cuvs }}" = "ON" ]; then
conda install -y -q libcuvs=26.02 'cuda-version=12.9' cuda-toolkit=12.9 sysroot_linux-64=2.34 -c rapidsai -c rapidsai-nightly -c conda-forge
+20 -19
View File
@@ -20,7 +20,7 @@ jobs:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
with:
label: nightly
linux-x86_64-GPU-CUDA-12-4-nightly:
linux-x86_64-GPU-CUDA-12-6-nightly:
name: Linux x86_64 GPU nightlies (CUDA 12.6)
runs-on: 4-core-ubuntu-gpu-t4
env:
@@ -37,24 +37,25 @@ jobs:
with:
label: nightly
cuda: "12.6"
linux-x86_64-GPU-CUVS-CUDA12-4-0-nightly:
name: Linux x86_64 GPU w/ cuVS nightlies (CUDA 12.6)
runs-on: 4-core-ubuntu-gpu-t4
env:
CUDA_ARCHS: "70-real;72-real;75-real;80;86-real"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: ./.github/actions/build_conda
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
with:
label: nightly
cuvs: "ON"
cuda: "12.6"
# TODO: re-enable when we have a newer machine in CI that can run CUDA 13.2
# linux-x86_64-GPU-CUVS-CUDA13-2-0-nightly:
# name: Linux x86_64 GPU w/ cuVS nightlies (CUDA 13.2)
# runs-on: 4-core-ubuntu-gpu-t4
# env:
# CUDA_ARCHS: "75-real;80;86-real;90;100"
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# fetch-tags: true
# - uses: ./.github/actions/build_conda
# env:
# ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
# with:
# label: nightly
# cuvs: "ON"
# cuda: "13.2"
windows-x86_64-nightly:
name: Windows x86_64 nightlies
runs-on: windows-2022
+11 -3
View File
@@ -6,9 +6,10 @@
{% set version = environ.get('GIT_DESCRIBE_TAG').lstrip('v') %}
{% set suffix = "_nightly" if environ.get('PACKAGE_TYPE') == 'nightly' else "" %}
{% set number = GIT_DESCRIBE_NUMBER %}
{% set cuda_constraints=">=12.9,<13.0" %}
{% set libcublas_constraints=">=12.9,<13.0" %}
{% set cudart_constraints=">=12.9,<13.0" %}
{% set cuda_major = (cudatoolkit | default("12.0")).split('.')[0] | int %}
{% set cuda_constraints=">=13.2,<13.3" %}
{% set libcublas_constraints=">=13.3,<13.4" %} # libcublas 13.3 is actually for cuda 13.2
{% set cudart_constraints=">=13.2,<13.3" %}
package:
name: faiss-pkg
@@ -117,13 +118,20 @@ outputs:
requires:
- numpy >=2.0,<2.3
- scipy
# TODO: remove cuda_major guard when we move to PyPI (pytorch via PyPI works on CUDA 13)
{% if cuda_major < 13 %}
- pytorch-gpu >=2.7
{% endif %}
commands:
- python -X faulthandler -m unittest discover -v -s tests/ -p "test_*"
{% if cuda_major < 13 %}
- python -X faulthandler -m unittest discover -v -s tests/ -p "torch_*"
{% endif %}
- cp tests/common_faiss_tests.py faiss/gpu/test
- python -X faulthandler -m unittest discover -v -s faiss/gpu/test/ -p "test_*"
{% if cuda_major < 13 %}
- python -X faulthandler -m unittest discover -v -s faiss/gpu/test/ -p "torch_*"
{% endif %}
- sh test_cpu_dispatch.sh # [linux64]
files:
- test_cpu_dispatch.sh # [linux64]
+14
View File
@@ -6,9 +6,16 @@
{% set version = environ.get('GIT_DESCRIBE_TAG').lstrip('v') %}
{% set suffix = "_nightly" if environ.get('PACKAGE_TYPE') == 'nightly' else "" %}
{% set number = GIT_DESCRIBE_NUMBER %}
{% set cuda_major = (cudatoolkit | default("12.0")).split('.')[0] | int %}
{% if cuda_major >= 13 %}
{% set cuda_constraints=">=13.2,<13.3" %}
{% set libcublas_constraints=">=13.3,<13.4" %} # libcublas 13.3 is actually for cuda 13.2
{% set cudart_constraints=">=13.2,<13.3" %}
{% else %}
{% set cuda_constraints=">=12.6,<12.7" %}
{% set libcublas_constraints=">=12.6,<12.7" %}
{% set cudart_constraints=">=12.6,<12.7" %}
{% endif %}
package:
name: faiss-pkg
@@ -104,13 +111,20 @@ outputs:
requires:
- numpy >=2.0,<3.0
- scipy
# TODO: remove cuda_major guard when we move to PyPI (pytorch via PyPI works on CUDA 13)
{% if cuda_major < 13 %}
- pytorch-gpu >=2.7
{% endif %}
commands:
- python -X faulthandler -m unittest discover -v -s tests/ -p "test_*"
{% if cuda_major < 13 %}
- python -X faulthandler -m unittest discover -v -s tests/ -p "torch_*"
{% endif %}
- cp tests/common_faiss_tests.py faiss/gpu/test
- python -X faulthandler -m unittest discover -v -s faiss/gpu/test/ -p "test_*"
{% if cuda_major < 13 %}
- python -X faulthandler -m unittest discover -v -s faiss/gpu/test/ -p "torch_*"
{% endif %}
- sh test_cpu_dispatch.sh # [linux64]
files:
- test_cpu_dispatch.sh # [linux64]
+3
View File
@@ -230,6 +230,9 @@ if(FAISS_ENABLE_GPU)
target_link_libraries(faiss_example_external_module PRIVATE hip::host)
else()
find_package(CUDAToolkit REQUIRED)
if(FAISS_ENABLE_CUVS AND NOT TARGET cuvs::cuvs)
find_package(cuvs)
endif()
target_link_libraries(swigfaiss PRIVATE CUDA::cudart $<$<BOOL:${FAISS_ENABLE_CUVS}>:cuvs::cuvs>)
target_link_libraries(swigfaiss_avx2 PRIVATE CUDA::cudart $<$<BOOL:${FAISS_ENABLE_CUVS}>:cuvs::cuvs>)
target_link_libraries(swigfaiss_avx512 PRIVATE CUDA::cudart $<$<BOOL:${FAISS_ENABLE_CUVS}>:cuvs::cuvs>)