Open AviadHAv opened 2 years ago
hmm this is weird, normally the index_shards should not set successive_ids, see https://github.com/facebookresearch/faiss/blob/main/faiss/gpu/GpuCloner.cpp#L337 could you post a small repro script?
@mdouze dude I've added code example btw when I change successive_ids hardcoded to false I get on first upload
Error in virtual void faiss::gpu::GpuIndexFlat::addImpl_(int, const float*, const idx_t*) at /build/aviad/faiss/faiss/gpu/GpuIndexFlat.cu:204: Error: '!ids' failed: add_with_ids not supported
btw when dropping on function add_with_ids
in IndexShards.cpp
the check
!(successive_ids && xids),
"It makes no sense to pass in ids and "
"request them to be shifted");
everything works well except of one thing I manage to add a lot of vectors one by one but can't do a bulk add with a couple of vectors which means add 1,000,000 million of vectors will take more than one hour https://github.com/facebookresearch/faiss/blob/main/faiss/IndexShards.cpp#L228
replace to IDMap,IVF1,Flat
solve all problems !!! thanks
If you use IVF1,Flat
then IDMap
becomes unnecessary.
Hmm right, I understand the problem: when you move IDMap,Flat to GPU it builds an IDMap + an IndexShards of Flats, instead of an IndexShards of IDMap,Flat. I'd have to think a bit how to fix that in a robust way. Marking as enhancement.
Summary
Platform
OS: linux ubuntu 18.04
Faiss version: https://github.com/facebookresearch/faiss/commit/c08cbff1a4d6c9afb6b8f69004c5530aaf80237a v1.7.2
Installed from: compiled from source
Faiss compilation options: -DBUILD_TESTING=OFF -DFAISS_ENABLE_GPU=ON -DCMAKE_CXX_COMPILER=g++-6 -DFAISS_ENABLE_C_API=ON -DBUILD_SHARED_LIBS=ON -DFAISS_ENABLE_PYTHON=OFF -DFAISS_OPT_LEVEL=avx2
Running on:
Interface:
Reproduction instructions
when adding to IndexShards with sucessive_ids, only add() in a single pass is supported"
how can I add twice data (vector+id) when using gpu sharding ?output
thank you guys !!! :smile: