faiss icon indicating copy to clipboard operation
faiss copied to clipboard

How to dynamicly choose simd level at runtime?

Open chasingegg opened this issue 2 years ago • 2 comments

In faiss some features like IVFPQFastScan rely on at least AVX2 level simd, and we could turn on the flag at the compilation, but we can not decide it dynamicly, that is if we turn on the opt flag on a very old machine, it could not run. Another question is that when we conda install faiss, it seems it could detect the simd level and choose the AVX2 or just no simd, how does it happen?

chasingegg avatar Jul 19 '23 04:07 chasingegg

The packaged faiss comes with two compiled versions of the .so library (_swigfaiss.so and _swigfaiss_avx2.so) that are selected at the python layer. It is a current discussion on how we can switch platforms with a finer granulairty.

mdouze avatar Jul 24 '23 07:07 mdouze

I see, when we install python package, it is on our 'run machines' where we could detect the simd level. Otherwise, there is possibly the problem between 'compile machines' and 'run machines'. So you mean you guys are discussing the proper solution recently? Curious about the result.

chasingegg avatar Jul 24 '23 07:07 chasingegg