faiss icon indicating copy to clipboard operation
faiss copied to clipboard

Parallelize compute_residuals in IndexIVFPQ

Open Ray0907 opened this issue 2 months ago • 3 comments

Add OpenMP parallelization to compute_residuals function. This addresses the TODO comment about parallelization.

Changes:

  • Add #pragma omp parallel for to residual computation loop
  • Use if(n > 1000) to avoid overhead for small batches
  • Each iteration is independent and thread-safe

Ray0907 avatar Nov 02 '25 09:11 Ray0907