Skip to content

Upgrade faiss to 1.14.2#2134

Open
aamijar wants to merge 4 commits into
rapidsai:mainfrom
aamijar:faiss-1.14.2
Open

Upgrade faiss to 1.14.2#2134
aamijar wants to merge 4 commits into
rapidsai:mainfrom
aamijar:faiss-1.14.2

Conversation

@aamijar
Copy link
Copy Markdown
Member

@aamijar aamijar commented May 27, 2026

Faiss has released v1.14.2 which includes an upgrade to cuVS 26.02. We can now remove the corresponding patches from cuvs and bump the faiss version that we are building against.

@aamijar aamijar requested a review from a team as a code owner May 27, 2026 04:35
@aamijar aamijar self-assigned this May 27, 2026
@aamijar aamijar added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels May 27, 2026
@aamijar aamijar moved this to In Progress in Unstructured Data Processing May 27, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 910ca9d4-1302-4cea-8c89-33d25c900732

📥 Commits

Reviewing files that changed from the base of the PR and between fc84a82 and 9487121.

📒 Files selected for processing (1)
  • cpp/cmake/patches/faiss-1.14-cuvs-26.04.diff

📝 Walkthrough

Summary by CodeRabbit

  • Chores

    • Bumped FAISS GPU to 1.14.2; standardized on C++20.
    • Modernized cuVS integration and RMM pinned/managed/device memory usage, switching to synchronized allocation/deallocation patterns and updated pinned-host memory resource.
  • Bug Fixes

    • Improved stability and correctness of GPU index operations, including centroid/rotation handling, neighbor list layouts, and query/update paths.
    • Adjusted includes and platform macros for more reliable compilation across toolchains.

Walkthrough

This PR modernizes FAISS cuVS integration: migrate to cuvs::distance::DistanceType, update RMM pinned/managed/device memory APIs and includes, refactor IVFPQ center/rotation writeback and inverted-list handling, enforce C++20, and pin FAISS to 1.14.2.

Changes

FAISS cuVS Modernization Patches

Layer / File(s) Summary
Distance type and header updates
cpp/cmake/patches/faiss-1.14-cuvs-25.12.diff, cpp/cmake/patches/faiss-1.14-cuvs-26.04.diff
Switch cuVS include to distance.hpp; metricFaissToCuvs returns cuvs::distance::DistanceType. Query sites use auto for the cuVS distance variable; add missing Thrust include.
RMM memory-resource & allocation API modernization
cpp/cmake/patches/faiss-1.14-cuvs-25.12.diff
Update RMM header paths and change StandardGpuResourcesImpl::pmr_ to rmm::mr::pinned_host_memory_resource. Replace async allocation/deallocation calls with the updated sync/positional RMM APIs for pinned, device/unified, and managed paths.
CMake C++ standard
cpp/cmake/patches/faiss-1.14-cuvs-26.02.diff
Unconditionally set CMAKE_CXX_STANDARD to 20.
IVFPQ center & rotation writeback
cpp/cmake/patches/faiss-1.14-cuvs-26.02.diff
CuvsIVFPQ::updateQuantizer writes PQ centers and rotation matrices via mutable device-matrix views, pads centers with norms, then applies rotate_padded_centers instead of helpers::set_centers.
IVFPQ inverted-list spec and helpers
cpp/cmake/patches/faiss-1.14-cuvs-26.02.diff
copyInvertedListsFrom uses ivf_pq::list_spec_interleaved and cuvs::neighbors::ivf_pq::helpers::resize_list; setPQCentroids_ adds a const_cast<float*> for raft::copy.
FAISS version override
cpp/cmake/patches/faiss_override.json
Pin faiss package version to 1.14.2 so the patches target the updated release baseline.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes


Possibly related PRs

  • rapidsai/cuvs#1796: Both PRs modify the build CMake configuration to enforce C++20 (unconditionally setting CMAKE_CXX_STANDARD=20).

Suggested reviewers

  • cjnolet
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Upgrade faiss to 1.14.2' clearly and specifically summarizes the main change in the changeset.
Description check ✅ Passed The description directly relates to the changeset by explaining the rationale for upgrading faiss to 1.14.2 and removing associated patches.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@@ -1,182 +0,0 @@
diff --git a/faiss/gpu/GpuDistance.cu b/faiss/gpu/GpuDistance.cu
index c82c73e7d..b9100c272 100644
--- a/faiss/gpu/GpuDistance.cu
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we maintaining so many diffs? Can't we just use the most recent version?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that is what I was thinking as well. @aamijar lets just maintain a single patch per release. The pinned faiss version is always fixed and the patch should be only tied to that and the current cuvs build.

@@ -1,12 +1,25 @@
diff --git a/faiss/gpu/utils/CuvsUtils.cu b/faiss/gpu/utils/CuvsUtils.cu
Copy link
Copy Markdown
Contributor

@tarang-jain tarang-jain May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'd probably want to rename the suffix to -cuvs-26.08.diff here for the current release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants