Open bhatiaharsh opened 2 years ago
To me it seems very marginally useful. Could you give a use case where allocating a temp buffer for labels would be a limiting factor?
i think it is quite useful for any sort of memory-limited device.
specifically for our use case, we would like to collocate faiss index and all its queries onto the same gpu that is primarily engaged in a simulation. we are still doing some studies to get exact numbers, but we anticipate requiring all/most of the gpu memory for the simulation. therefore, minimizing the footprint for the faiss queries is an imprtant goal for us.
previously, we have used different devices for faiss and simulation (see here and here), and it works, except the latency of the data movement can be limiting.
Summary
I have a feature request and am curious if it is hard to support for the faiss team.
Currently, the
index.search
method returns both the distances and ids of the resulting points. This is a great feature and the labels I think come for free from the search tree. https://github.com/facebookresearch/faiss/blob/02c8452eb993cd8e6566b4cb00730094fa9ce129/faiss/Index.h#L113However, if the application has no use for labels and is interested only in distances, then it forces us to allocate memory for labels only to throw it away after the query.
Can you support a
search_without_label
search? possibly by allowing to passlabels = nullptr
and just not populate the labels if the application does not want it?