Commit 21cac97
Fix cuVS build (#5107)
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: D1010723041 parent 582246b commit 21cac97
2 files changed
Lines changed: 12 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
291 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
292 | 295 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
302 | 301 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
| 302 | + | |
309 | 303 | | |
310 | 304 | | |
311 | 305 | | |
312 | 306 | | |
313 | | - | |
314 | 307 | | |
315 | | - | |
316 | 308 | | |
317 | 309 | | |
318 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
0 commit comments