diff --git a/.github/actions/build_cmake/action.yml b/.github/actions/build_cmake/action.yml index 0ccdda8e15..fa20974af5 100644 --- a/.github/actions/build_cmake/action.yml +++ b/.github/actions/build_cmake/action.yml @@ -54,15 +54,14 @@ runs: conda install -y -q cuda-toolkit=12.4 -c "nvidia/label/cuda-12.4.0" # and CUDA from cuVS channel for cuVS builds elif [ "${{ inputs.cuvs }}" = "ON" ]; then - conda install -y -q libcuvs=24.08 cuda-version=12.4 cuda-toolkit=12.4.1 gxx_linux-64=12.4 -c rapidsai -c conda-forge -c "nvidia/label/cuda-12.4.0" + conda install -y -q libcuvs=24.12 'cuda-version>=12.0,<=12.5' cuda-toolkit=12.4.1 gxx_linux-64=12.4 -c rapidsai -c conda-forge fi - # install test packages if [ "${{ inputs.rocm }}" = "ON" ]; then : # skip torch install via conda, we need to install via pip to get # ROCm-enabled version until it's supported in conda by PyTorch elif [ "${{ inputs.gpu }}" = "ON" ]; then - conda install -y -q "pytorch<2.5" pytorch-cuda=12.4 -c pytorch -c nvidia/label/cuda-12.4.0 + conda install -y -q "pytorch<2.5" pytorch-cuda=12.4 -c pytorch -c "nvidia/label/cuda-12.4.0" else conda install -y -q "pytorch<2.5" -c pytorch fi diff --git a/.github/actions/build_conda/action.yml b/.github/actions/build_conda/action.yml index 683fb7a5ba..95c2d60c1f 100644 --- a/.github/actions/build_conda/action.yml +++ b/.github/actions/build_conda/action.yml @@ -84,7 +84,7 @@ runs: working-directory: conda run: | conda build faiss-gpu-cuvs --variants '{ "cudatoolkit": "${{ inputs.cuda }}" }' \ - -c pytorch -c rapidsai -c rapidsai-nightly -c conda-forge + -c pytorch -c rapidsai -c rapidsai-nightly -c conda-forge -c nvidia - name: Conda build (GPU w/ cuVS) w/ anaconda upload if: inputs.label != '' && inputs.cuda != '' && inputs.cuvs != '' shell: ${{ steps.choose_shell.outputs.shell }} @@ -93,4 +93,4 @@ runs: PACKAGE_TYPE: ${{ inputs.label }} run: | conda build faiss-gpu-cuvs --variants '{ "cudatoolkit": "${{ inputs.cuda }}" }' \ - --user pytorch --label ${{ inputs.label }} -c pytorch -c rapidsai -c rapidsai-nightly -c conda-forge + --user pytorch --label ${{ inputs.label }} -c pytorch -c rapidsai -c rapidsai-nightly -c conda-forge -c nvidia diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index d94abba081..f94077513d 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -132,6 +132,36 @@ jobs: fetch-tags: true - name: Build and Package (conda) uses: ./.github/actions/build_conda + linux-x86_64-GPU-CUVS-CUDA11-8-0-conda: + name: Linux x86_64 GPU w/ cuVS conda (CUDA 11.8.0) + 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 + with: + cuvs: "ON" + cuda: "11.8.0" + linux-x86_64-GPU-CUVS-CUDA12-4-0-conda: + name: Linux x86_64 GPU w/ cuVS conda (CUDA 12.4.0) + 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 + with: + cuvs: "ON" + cuda: "12.4.0" windows-x86_64-conda: name: Windows x86_64 (conda) needs: linux-x86_64-cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ec990a8734..6bd1ad3eaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ # LICENSE file in the root directory of this source tree. # ============================================================================= -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at diff --git a/cmake/thirdparty/fetch_rapids.cmake b/cmake/thirdparty/fetch_rapids.cmake index 8d99161071..2ed6a78cf5 100644 --- a/cmake/thirdparty/fetch_rapids.cmake +++ b/cmake/thirdparty/fetch_rapids.cmake @@ -15,7 +15,7 @@ # or implied. See the License for the specific language governing permissions and limitations under # the License. # ============================================================================= -set(RAPIDS_VERSION "24.08") +set(RAPIDS_VERSION "24.12") if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/FAISS_RAPIDS.cmake) file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${RAPIDS_VERSION}/RAPIDS.cmake diff --git a/conda/faiss-gpu-cuvs/meta.yaml b/conda/faiss-gpu-cuvs/meta.yaml index d14d6af569..a51674b609 100644 --- a/conda/faiss-gpu-cuvs/meta.yaml +++ b/conda/faiss-gpu-cuvs/meta.yaml @@ -7,10 +7,10 @@ {% set suffix = "_nightly" if environ.get('PACKAGE_TYPE') == 'nightly' else "" %} {% set number = GIT_DESCRIBE_NUMBER %} {% if cudatoolkit == '11.8.0' %} -{% set cuda_constraints=">=11.8,<12" %} -{% set libcublas_constraints=">=11.11,<12" %} +{% set cuda_constraints=">=11.4,<12" %} +{% set libcublas_constraints=">=11.6,<12" %} {% elif cudatoolkit == '12.4.0' %} -{% set cuda_constraints=">=12.1,<13" %} +{% set cuda_constraints=">=12.1,<12.5" %} {% set libcublas_constraints=">=12.1,<13" %} {% endif %} @@ -45,7 +45,7 @@ outputs: - CUDA_ARCHS requirements: build: - - {{ compiler('cxx') }} + - {{ compiler('cxx') }} =12.4 - sysroot_linux-64 =2.17 # [linux64] - llvm-openmp # [osx] - cmake >=3.26.4 @@ -58,15 +58,15 @@ outputs: - _openmp_mutex =4.5=2_kmp_llvm # [x86_64] - mkl =2023 # [x86_64] - openblas =0.3 # [not x86_64] - - libcuvs =24.08 - - cuda-version {{ cudatoolkit }} + - libcuvs =24.12 + - cuda-version {{ cuda_constraints }} run: - _openmp_mutex =4.5=2_kmp_llvm # [x86_64] - mkl =2023 # [x86_64] - openblas =0.3 # [not x86_64] - cuda-cudart {{ cuda_constraints }} - libcublas {{ libcublas_constraints }} - - libcuvs =24.08 + - libcuvs =24.12 - cuda-version {{ cuda_constraints }} test: requires: @@ -86,10 +86,10 @@ outputs: string: "py{{ PY_VER }}_h{{ PKG_HASH }}_{{ number }}_cuda{{ cudatoolkit }}{{ suffix }}" requirements: build: - - {{ compiler('cxx') }} + - {{ compiler('cxx') }} =12.4 - sysroot_linux-64 =2.17 # [linux64] - swig =4.0 - - cmake >=3.24.0 + - cmake >=3.26.4 - make =4.2 # [not win] - _openmp_mutex =4.5=2_kmp_llvm # [x86_64] - mkl =2023 # [x86_64] diff --git a/faiss/gpu/GpuDistance.cu b/faiss/gpu/GpuDistance.cu index f36091d26a..c82c73e7d5 100644 --- a/faiss/gpu/GpuDistance.cu +++ b/faiss/gpu/GpuDistance.cu @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. */ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -320,12 +320,7 @@ void bfKnn(GpuResourcesProvider* prov, const GpuDistanceParams& args) { cuvs::neighbors::brute_force::index idx( handle, index.view(), norms_view, distance, metric_arg); cuvs::neighbors::brute_force::search( - handle, - idx, - search.view(), - inds.view(), - dists.view(), - std::nullopt); + handle, idx, search.view(), inds.view(), dists.view()); } else { auto index = raft::make_readonly_temporary_device_buffer< const float, @@ -364,12 +359,7 @@ void bfKnn(GpuResourcesProvider* prov, const GpuDistanceParams& args) { cuvs::neighbors::brute_force::index idx( handle, index.view(), norms_view, distance, metric_arg); cuvs::neighbors::brute_force::search( - handle, - idx, - search.view(), - inds.view(), - dists.view(), - std::nullopt); + handle, idx, search.view(), inds.view(), dists.view()); } if (args.metric == MetricType::METRIC_Lp) { diff --git a/faiss/gpu/GpuIndex.h b/faiss/gpu/GpuIndex.h index 48bb7a17a3..33fd37158e 100644 --- a/faiss/gpu/GpuIndex.h +++ b/faiss/gpu/GpuIndex.h @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. */ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/faiss/gpu/GpuResources.cpp b/faiss/gpu/GpuResources.cpp index 74df9b96d3..8d39fa65af 100644 --- a/faiss/gpu/GpuResources.cpp +++ b/faiss/gpu/GpuResources.cpp @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. */ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/faiss/gpu/GpuResources.h b/faiss/gpu/GpuResources.h index d914dae7ae..c0c851a892 100644 --- a/faiss/gpu/GpuResources.h +++ b/faiss/gpu/GpuResources.h @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. */ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/faiss/gpu/impl/CuvsFlatIndex.cu b/faiss/gpu/impl/CuvsFlatIndex.cu index 08f63300ef..15cf427cf3 100644 --- a/faiss/gpu/impl/CuvsFlatIndex.cu +++ b/faiss/gpu/impl/CuvsFlatIndex.cu @@ -100,8 +100,7 @@ void CuvsFlatIndex::query( cuvs::neighbors::brute_force::index idx( handle, index, norms_view, distance, metricArg); - cuvs::neighbors::brute_force::search( - handle, idx, search, inds, dists, std::nullopt); + cuvs::neighbors::brute_force::search(handle, idx, search, inds, dists); if (metric == MetricType::METRIC_Lp) { raft::linalg::unary_op( diff --git a/faiss/gpu/test/TestGpuDistance.cu b/faiss/gpu/test/TestGpuDistance.cu index 083413fed6..6c5526b1c5 100644 --- a/faiss/gpu/test/TestGpuDistance.cu +++ b/faiss/gpu/test/TestGpuDistance.cu @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. */ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/faiss/gpu/test/TestGpuIndexIVFFlat.cpp b/faiss/gpu/test/TestGpuIndexIVFFlat.cpp index a7d0007b5b..19f15e5da4 100644 --- a/faiss/gpu/test/TestGpuIndexIVFFlat.cpp +++ b/faiss/gpu/test/TestGpuIndexIVFFlat.cpp @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. */ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/faiss/gpu/test/test_gpu_index.py b/faiss/gpu/test/test_gpu_index.py index 05d4ed02c6..d3892e190d 100755 --- a/faiss/gpu/test/test_gpu_index.py +++ b/faiss/gpu/test/test_gpu_index.py @@ -439,7 +439,6 @@ def test_indices_ivfpq(self): xb_indices = (xb_indices_base + 4294967296).astype('int64') config = faiss.GpuIndexIVFPQConfig() - config.use_cuvs = False idx = faiss.GpuIndexIVFPQ(res, d, nlist, M, nbits, faiss.METRIC_L2, config) idx.train(xb) @@ -450,6 +449,8 @@ def test_indices_ivfpq(self): # Store values using 32-bit indices instead config.indicesOptions = faiss.INDICES_32_BIT + # 32-bit indices are not supported with cuVS + config.use_cuvs = False idx = faiss.GpuIndexIVFPQ(res, d, nlist, M, nbits, faiss.METRIC_L2, config) idx.train(xb) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2c97118ef8..dfab76e024 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -82,7 +82,6 @@ find_package(GTest CONFIG REQUIRED) target_link_libraries(faiss_test PRIVATE OpenMP::OpenMP_CXX GTest::gtest_main - $<$:cuvs::cuvs> $<$:hip::host> )