You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
D96034911 adds filtered search to BinaryCuvsCagra.cu (calling cuvs::neighbors::cagra::search with a filter_ref), but does not update
fbcode/faiss/gpu/CMakeLists.txt.
In the cmake build, cuVS source files are compiled with -fvisibility=hidden to ensure that RAFT/cuVS function calls resolve locally within libfaiss.so rather than
through the PLT to libcuvs.so. This is critical because RAFT resources (cublas handles, CUDA streams) must be created and used within the same dynamic library
context.
Look at fbcode/faiss/gpu/CMakeLists.txt:302-316:
set_source_files_properties(
GpuIndexCagra.cu # ✓ float CAGRA
GpuDistance.cu
GpuIndexIVFFlat.cu
GpuIndexIVFPQ.cu
GpuIndexFlat.cu
StandardGpuResources.cpp
impl/CuvsCagra.cu # ✓ float CAGRA impl
impl/CuvsFlatIndex.cu
impl/CuvsIVFFlat.cu
impl/CuvsIVFPQ.cu
utils/CuvsFilterConvert.cu
utils/CuvsUtils.cu
TARGET_DIRECTORY faiss
PROPERTIES COMPILE_OPTIONS "-fvisibility=hidden")
Missing:
- GpuIndexBinaryCagra.cu
- impl/BinaryCuvsCagra.cu
Before D96034911, this didn't matter because GpuIndexBinaryCagra::search() threw on any params (FAISS_THROW_IF_NOT_MSG(!params, "params not implemented")). After
D96034911, it processes params and calls cuvs::neighbors::cagra::search with a filter, making the code sensitive to cross-DSO symbol resolution. Without hidden
visibility, cuVS template instantiations (particularly cagra::search<uint8_t, uint32_t> with the filter type) leak out of libfaiss.so and can conflict with/resolve
to libcuvs.so symbols, causing RAFT context mismatches.
The float CAGRA IDSelector tests (TestGpuIndexCagra) pass because GpuIndexCagra.cu and impl/CuvsCagra.cu are in the hidden visibility list. The binary CAGRA tests
fail because they aren't.
Buck doesn't have this issue because it links everything statically — there's no DSO boundary.
Differential Revision: D101072304
0 commit comments