Set the number of threads that OMP can use.#2
Conversation
|
PS: also fixed a minor bug. Apologies for not using git branches correctly so it went into the same pullreq. |
|
Hi Arjen, I was also wondering where you saw the 200x speedup? The examples are supposed to use FAISS by performing queries one by one (no multithreading). I will, of course, accept the PR; thanks a lot! We are working to improve the code in a separate branch. (Sorry for the long delay in answering; I went away for a long holiday!) |
|
No problem! The 200x referred to my first trying the "simple" example that does not use FAISS; that used all cores, but then the FAISS vatiant did not do that. I noticed the benchmark scripts are controlling that perfectly, indeed. (Hope you had a great holiday!) |
* Super IMI-PDX * Trying Balanced Clusters * Towards releasing 8 bit PDX * Code is nice and refactored * Better kernels benchmarking * New structure * AVX512 kernels * AVX512 kernels * AVX512 kernels * AVX512 kernels * AVX512 kernels * AVX512 kernels * BOND 32-bit working again * Python bindings v0.2 * First readme iteration * First readme iteration * First readme iteration * IVF probe as a true parameter * Fixing datasets of d=128 * FAISS SQ8 benchmarking script * Adding simple plotter * Adding simple plotter * Adding updated datasets link * AVX build fix * AVX build fix * Final touches * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Removing unnecessary stuff from sigmod * README * Removing results showcasing in examples
* Super IMI-PDX * Trying Balanced Clusters * Towards releasing 8 bit PDX * Code is nice and refactored * Better kernels benchmarking * New structure * AVX512 kernels * AVX512 kernels * AVX512 kernels * AVX512 kernels * AVX512 kernels * AVX512 kernels * BOND 32-bit working again * Python bindings v0.2 * First readme iteration * First readme iteration * First readme iteration * IVF probe as a true parameter * Fixing datasets of d=128 * FAISS SQ8 benchmarking script * Adding simple plotter * Adding simple plotter * Adding updated datasets link * AVX build fix * AVX build fix * Final touches * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Readme * Removing unnecessary stuff from sigmod * README * Removing results showcasing in examples
Finally found some time to try out the great PDX library!
The initial results were a little too impressive, as I noticed a 200x speedup (instead of the 5-7 reported). Then I realized I was working on a machine with 48 cores - which is still highly impressive to see how PDX uses them all to the max. But FAISS needs a little help to use internal multiprocessing.
The pull request uses the function from the FAISS python bindings to increase the number of threads for OMP, and sets it to half the available cores according to the python multiprocessing library.
(I'd understand if you do not want to do this by default, but would recommend documenting it if so.)