Skip to content

Commit c5ae3d0

Browse files
ethanglasermeta-codesync[bot]
authored andcommitted
Enable use of svs runtime conda package instead of tarball (#4747)
Summary: This PR migrates from using SVS via tarball to using a conda package Currently the package is available at the intel channel. In future releases, it will be available from conda-forge and the channel configuration can be removed Pull Request resolved: #4747 Reviewed By: subhadeepkaran Differential Revision: D91484831 Pulled By: alibeklfc fbshipit-source-id: b94dba1f03b4083ae8aa35cdd258ad71c421d30b
1 parent 32a3912 commit c5ae3d0

9 files changed

Lines changed: 14 additions & 27 deletions

File tree

.github/actions/build_cmake/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ runs:
7777
conda install -y -q libcuvs=25.10 'cuda-version=12.6' cuda-toolkit=12.6 gxx_linux-64=13.4.0 -c rapidsai -c rapidsai-nightly -c conda-forge
7878
fi
7979
80+
# install SVS runtime for SVS builds
81+
if [ "${{ inputs.svs }}" = "ON" ]; then
82+
conda install -y -q libsvs-runtime -c https://software.repos.intel.com/python/conda -c conda-forge
83+
fi
84+
8085
# install test packages
8186
if [ "${{ inputs.rocm }}" = "ON" ]; then
8287
: # skip torch install via conda, we need to install via pip to get

.github/actions/build_conda/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ runs:
4545
conda list --show-channel-urls
4646
conda install -y -q "conda!=24.11.0,<=25.07"
4747
conda install -y -q "conda-build=25.3.1" "liblief=0.14.1"
48+
# Add Intel channel with lowest priority for libsvs-runtime only
49+
conda config --append channels https://software.repos.intel.com/python/conda
50+
conda config --set channel_priority flexible
4851
- name: Enable anaconda uploads
4952
if: inputs.label != ''
5053
shell: ${{ steps.choose_shell.outputs.shell }}

conda/faiss-gpu-cuvs/build-lib.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,3 @@ make -C _build -j$(nproc) faiss faiss_avx2 faiss_avx512 faiss_c faiss_c_avx2 fai
2525

2626
cmake --install _build --prefix $PREFIX
2727
cmake --install _build --prefix _libfaiss_stage/
28-
29-
# Copy SVS runtime if it exists
30-
if [ -d "_build/_deps/svs-src/lib" ]; then
31-
cp -P _build/_deps/svs-src/lib/libsvs_runtime.so* $PREFIX/lib/ || true
32-
cp -P _build/_deps/svs-src/lib/libsvs_runtime.so* _libfaiss_stage/lib/ || true
33-
fi

conda/faiss-gpu-cuvs/meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ outputs:
6262
- openblas =0.3.30 # [not x86_64]
6363
- libcuvs =25.10
6464
- cuda-version {{ cuda_constraints }}
65+
- libsvs-runtime =0.1.0 # [x86_64 and linux]
6566
run:
6667
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64]
6768
- mkl >=2024.2.2,<2025.0a0 # [x86_64]
@@ -71,6 +72,7 @@ outputs:
7172
- libcuvs =25.10
7273
- cuda-version {{ cuda_constraints }}
7374
- libnvjitlink
75+
- libsvs-runtime =0.1.0 # [x86_64 and linux]
7476
test:
7577
requires:
7678
- conda-build

conda/faiss-gpu/build-lib.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,3 @@ make -C _build -j$(nproc) faiss faiss_avx2 faiss_avx512 faiss_c faiss_c_avx2 fai
3131

3232
cmake --install _build --prefix $PREFIX
3333
cmake --install _build --prefix _libfaiss_stage/
34-
35-
# Copy SVS runtime if it exists
36-
if [ -d "_build/_deps/svs-src/lib" ]; then
37-
cp -P _build/_deps/svs-src/lib/libsvs_runtime.so* $PREFIX/lib/ || true
38-
cp -P _build/_deps/svs-src/lib/libsvs_runtime.so* _libfaiss_stage/lib/ || true
39-
fi

conda/faiss-gpu/meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ outputs:
5353
host:
5454
- mkl >=2024.2.2,<2025.0a0 # [x86_64]
5555
- openblas =0.3.30 # [not x86_64]
56+
- libsvs-runtime =0.1.0 # [x86_64 and linux]
5657
run:
5758
- mkl >=2024.2.2,<2025.0a0 # [x86_64]
5859
- openblas =0.3.30 # [not x86_64]
5960
- cuda-cudart {{ cuda_constraints }}
6061
- libcublas {{ libcublas_constraints }}
62+
- libsvs-runtime =0.1.0 # [x86_64 and linux]
6163
test:
6264
requires:
6365
- conda-build

conda/faiss/build-lib.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,3 @@ make -C _build -j$(nproc) faiss faiss_avx2 faiss_avx512 faiss_c faiss_c_avx2 fai
2323

2424
cmake --install _build --prefix $PREFIX
2525
cmake --install _build --prefix _libfaiss_stage/
26-
27-
# Copy SVS runtime if it exists
28-
if [ -d "_build/_deps/svs-src/lib" ]; then
29-
cp -P _build/_deps/svs-src/lib/libsvs_runtime.so* $PREFIX/lib/ || true
30-
cp -P _build/_deps/svs-src/lib/libsvs_runtime.so* _libfaiss_stage/lib/ || true
31-
fi

conda/faiss/meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ outputs:
5656
host:
5757
- python {{ python }}
5858
- libcxx =20.1.1 # [osx and arm64]
59+
- libsvs-runtime =0.1.0 # [x86_64 and linux]
5960
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
6061
- mkl =2024.2.2 # [x86_64]
6162
- python_abi <3.12
@@ -69,6 +70,7 @@ outputs:
6970
run:
7071
- python {{ python }}
7172
- libcxx =20.1.1 # [osx and arm64]
73+
- libsvs-runtime =0.1.0 # [x86_64 and linux]
7274
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
7375
- mkl =2024.2.2 # [x86_64]
7476
- python_abi <3.12

faiss/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -359,16 +359,7 @@ if(NOT WIN32)
359359
endif()
360360

361361
if(FAISS_ENABLE_SVS)
362-
include(FetchContent)
363-
set(SVS_URL "https://github.com/intel/ScalableVectorSearch/releases/download/v0.1.0/svs-cpp-runtime-bindings-0.1.0.tar.gz" CACHE STRING "URL to fetch SVS runtime library")
364-
FetchContent_Declare(
365-
svs
366-
URL "${SVS_URL}"
367-
)
368-
FetchContent_MakeAvailable(svs)
369-
list(APPEND CMAKE_PREFIX_PATH "${svs_SOURCE_DIR}")
370362
find_package(svs_runtime REQUIRED)
371-
#target_compile_options(svs::svs INTERFACE "-DSVS_ENABLE_OMP=1")
372363

373364
target_link_libraries(faiss PUBLIC svs::svs_runtime)
374365
target_link_libraries(faiss_avx2 PUBLIC svs::svs_runtime)

0 commit comments

Comments
 (0)