Faiss: range_search on GPU

Created on 13 Aug 2018  Â·  8Comments  Â·  Source: facebookresearch/faiss

Is range_search not implemented on GPUs for any index?

The tutorial examples with IndexFlatL2 don't work with range_search when using GPUs.

GPU enhancement

Most helpful comment

+1 for this feature :)

All 8 comments

I facing the same problem which give the error message like this:

~/anaconda2/lib/python2.7/site-packages/faiss/swigfaiss_gpu.pyc in range_search(self, n, x, radius, result)
1457
1458 def range_search(self, n, x, radius, result):
-> 1459 return _swigfaiss_gpu.Index_range_search(self, n, x, radius, result)
1460
1461 def assign(self, n, x, labels, k=1):

RuntimeError: Error in virtual void faiss::Index::range_search(faiss::Index::idx_t, const float, float, faiss::RangeSearchResult) const at Index.cpp:32: range search not implemented

Range search is implemented only for a limited number of index types.
https://github.com/facebookresearch/faiss/wiki/Special-operations-on-indexes#range-search
Implementing it for more index types is not high-priority for us, but of course we welcome PRs in that direction.
CC: @wickedfoo

@mdouze Yes, but the wiki does not state if for those index types for which it is implemented (IndexFlat, IndexIVFFlat), it is compatible to run on GPU or not. It is possible to push these index types to the GPU using faiss.index_cpu_to_gpu and that works fine for a k nearest neighbors search, but doesn't for range_search. I am wondering if that particular part (GPU compatibility of range_search for those indices) is not implemented or if it needs code to be written in a different manner than the wiki example in order to work?

It is not implemented and range search needs a very different memory management pattern, so it is not trivial to add it.
CC: @wickedfoo

This wouldn't be easy to implement, and I don't have the time to do it, but may be a long term feature to add.

+1 for this feature :)

Can someone help me understand the output of range_search?
lims, D, I ?
I understand that lims are used to fetch records but what are D, I?

Was this page helpful?
0 / 5 - 0 ratings