Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faiss tuning issue #897

Closed
JinHai-CN opened this issue Jul 21, 2019 · 4 comments
Closed

Faiss tuning issue #897

JinHai-CN opened this issue Jul 21, 2019 · 4 comments
Labels

Comments

@JinHai-CN
Copy link
Contributor

JinHai-CN commented Jul 21, 2019

Dear guys, I am tuning faiss performance and meet following issues:

  1. distance_compute_bias_threshold default is 20 which will influence the L2 precision. According to WIKI and negative distance returned in IndexFlatL2 search query #297, it only works on IndexL2. But when I check the code, it seems Inner Product calculate also impacted by the parameter. Why?

  2. I test the FAISS with MKL and OpenBlas in intel x86 platform. Obviously, FAISS with MKL will be more fast than FAISS with OpenBlas, when index is FLAT L2/IP. Question, if the index is IVF, will FAISS with MKL still be faster?

Thank you for help!

@mdouze
Copy link
Contributor

mdouze commented Jul 23, 2019

  1. right, inner product also switches from the Faiss implementation to BLAS depending on this threshold. However, for inner product there should be no impact on accuracy because the subtraction trick is not used
    https://github.com/facebookresearch/faiss/wiki/Implementation-notes#matrix-multiplication-to-do-many-l2-distance-computations

  2. for IVF there are two factors that impact speed: the coarse-level quantization and the actual search. The coarse-level quantization's speed can be impacted by MKL.

@XuPeng-SH
Copy link

2. for IVF there are two factors that impact speed: the coarse-level quantization and the actual search. The coarse-level quantization's speed can be impacted by MKL.

Does Openblas affect the actual search time? I tested with Openblas and SSE respectively and I see the actual search time from "indexIVF_stats.search_time" are different. It can be reproduced repeatedly.

Thanks!

@mdouze
Copy link
Contributor

mdouze commented Aug 22, 2019

Yes the search time changes depends on openblas vs. SSE.

@mdouze
Copy link
Contributor

mdouze commented Aug 30, 2019

no activity, closing.

@mdouze mdouze closed this as completed Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants