RETRO-pytorch icon indicating copy to clipboard operation
RETRO-pytorch copied to clipboard

Scann vs faiss

Open afcruzs opened this issue 2 years ago • 6 comments

Could you elaborate on the decision to use faiss instead of scann? In theory scann is open source too, but I'm wondering if you found easier to get the performance needed from faiss instead.

afcruzs avatar Jun 22 '22 05:06 afcruzs

scann is opensource but not really packaged well + it doesn't quantize

but also it's not really a blocker either way in the current state of this repo doing more experiments with the LM and the LM+knn integration is

rom1504 avatar Jul 03 '22 17:07 rom1504

I agree is a bit cumbersome to use, but it should have (rather efficient) quantization, no? See last section of https://medium.com/@kumon/similarity-search-scann-and-4-bit-pq-ab98766b32bd

afcruzs avatar Jul 04 '22 22:07 afcruzs

scann is fast but no it doesn't optimize for memory use, since it uses PQ4 it requires storing the embeddings at full precision for reranking to avoid loss of recall

rom1504 avatar Jul 04 '22 22:07 rom1504

@rom1504 thanks for the answer! So is it correct to say that the open source version of scann does use quantization to compute faster inner products? I mean there's implemented options for using brute force and 2 different quantizers (lut16 and lut256), but I see your point about storing the embeddings. That's also odd since reorder (which I assume is what you mean by reranking) is optional

marcobellagente93 avatar Jul 05 '22 08:07 marcobellagente93

Yes it uses quantization to compute faster inner product. Do they report good results on pq4 and no reordering?

rom1504 avatar Jul 05 '22 09:07 rom1504

https://github.com/erikbern/ann-benchmarks/ https://ann-benchmarks.com/glove-100-angular_10_angular.html

vinnik-dmitry07 avatar May 07 '23 06:05 vinnik-dmitry07