Skip to content

Enable faiss "sve" opt_level#1587

Open
LizYou wants to merge 3 commits into
NVIDIA:mainfrom
LizYou:sve
Open

Enable faiss "sve" opt_level#1587
LizYou wants to merge 3 commits into
NVIDIA:mainfrom
LizYou:sve

Conversation

@LizYou

@LizYou LizYou commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

The FindSVE.cmake module exists in the repository but was not being included or checked, preventing the use of the SVE-optimized faiss libraries on ARM systems that support SVE instructions.

Linking against dynamic linker library for fixing linking error

The FindSVE.cmake module exists in the repository but was not being
included or checked, preventing the use of the SVE-optimized faiss
libraries on ARM systems that support SVE instructions.

Linking against dynamic linker library for fixing linking error

Signed-off-by: Lizhen You <lyou@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 24, 2025

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cjnolet cjnolet added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Nov 26, 2025
@cjnolet cjnolet moved this from Todo to In Progress in Unstructured Data Processing Nov 26, 2025
@cjnolet

cjnolet commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

/ok to test bd5a9a0

@cjnolet

cjnolet commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

/ok to test 9eb9b8f

@cjnolet

cjnolet commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

/ok to test 9eb9b8f

@cjnolet

cjnolet commented May 13, 2026

Copy link
Copy Markdown
Contributor

/ok to test 271990c

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Improved build configuration for ANN benchmarks to ensure proper dynamic-loading linker support.
    • Enhanced FAISS module discovery and target linking to better support GPU and CPU builds with optional SIMD optimizations.

Walkthrough

This PR updates CMake build configuration in two areas: ANN benchmark targets now link against dynamic-loader libraries, and FAISS discovery is refactored to include local AVX/SVE modules directly with refined target selection for SVE-enabled builds.

Changes

Build Target Configuration and FAISS Support

Layer / File(s) Summary
Benchmark target dynamic loader linking
cpp/bench/ann/CMakeLists.txt
ConfigureAnnBench module targets now include ${CMAKE_DL_LIBS} in target_link_libraries, adding platform-appropriate dynamic-loader linker flags.
FAISS module discovery and configuration
cpp/cmake/thirdparty/get_faiss.cmake
AVX and SVE detection now load FindAVX.cmake and FindSVE.cmake directly from the local modules directory; minor formatting adjustment to rapids_cpm_find block.
FAISS target selection refinement for SVE support
cpp/cmake/thirdparty/get_faiss.cmake
CUVS_FAISS_TARGETS logic adds explicit GPU+static+SVE case using faiss::faiss_sve, and CPU-only builds select faiss::faiss_sve only when both CXX_SVE_FOUND and CUVS_CPU_ONLY_FAISS_ENABLE_SVE are true.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: enabling SVE optimization for faiss libraries, which is the primary objective of the pull request.
Description check ✅ Passed The description explains the problem (FindSVE.cmake module not being used, preventing SVE-optimized faiss on ARM systems) and the solution (enabling SVE by including the module and fixing linker issues), directly relating to the changeset.
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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cpp/cmake/thirdparty/get_faiss.cmake`:
- Around line 36-42: This file contains unresolved git conflict markers around
the include lines for FindAVX/FindSVE and elsewhere; remove the conflict markers
(<<<<<<<, =======, >>>>>>>) and consolidate to the intended includes (use the
fully-qualified includes that reference
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../modules/FindAVX.cmake and FindSVE.cmake
rather than the bare names) so CMake can parse the file; also replace the bare
endif with a proper endif() and scan the other flagged ranges (lines ~48–69 and
~132–136) to resolve any remaining duplicate/contradictory blocks, keeping only
a single consistent implementation for the FindAVX/FindSVE logic and proper
CMake block terminators.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 50e97768-161b-4721-9de1-99c78d4e5d6e

📥 Commits

Reviewing files that changed from the base of the PR and between 59c1992 and 271990c.

📒 Files selected for processing (2)
  • cpp/bench/ann/CMakeLists.txt
  • cpp/cmake/thirdparty/get_faiss.cmake

Comment on lines +36 to +42
<<<<<<< sve
include(cmake/modules/FindAVX)
include(cmake/modules/FindSVE)
=======
include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../modules/FindAVX.cmake)
include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../modules/FindSVE.cmake)
>>>>>>> main

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target="cpp/cmake/thirdparty/get_faiss.cmake"

echo "== Conflict markers (must be empty) =="
rg -n '^(<<<<<<<|=======|>>>>>>>)' "$target" || true

echo
echo "== Bare endif tokens (should generally use endif()) =="
rg -n '^\s*endif\s*$' "$target" || true

Repository: rapidsai/cuvs

Length of output: 292


Resolve unresolved merge-conflict markers before merge.

Lines 36–42, 48–69, and 132–136 contain unresolved conflict markers (<<<<<<<, =======, >>>>>>>). This file will fail CMake parsing and block configuration.

Additionally, line 51 uses bare endif instead of endif() — resolve both issues when consolidating the conflicted blocks.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/cmake/thirdparty/get_faiss.cmake` around lines 36 - 42, This file
contains unresolved git conflict markers around the include lines for
FindAVX/FindSVE and elsewhere; remove the conflict markers (<<<<<<<, =======,
>>>>>>>) and consolidate to the intended includes (use the fully-qualified
includes that reference
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../modules/FindAVX.cmake and FindSVE.cmake
rather than the bare names) so CMake can parse the file; also replace the bare
endif with a proper endif() and scan the other flagged ranges (lines ~48–69 and
~132–136) to resolve any remaining duplicate/contradictory blocks, keeping only
a single consistent implementation for the FindAVX/FindSVE logic and proper
CMake block terminators.

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 stale-active

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants