Skip to content

Hoist SIMD dispatch outside loops in 4 call sites#5074

Open
algoriddle wants to merge 1 commit intofacebookresearch:mainfrom
algoriddle:export-D100144174
Open

Hoist SIMD dispatch outside loops in 4 call sites#5074
algoriddle wants to merge 1 commit intofacebookresearch:mainfrom
algoriddle:export-D100144174

Conversation

@algoriddle
Copy link
Copy Markdown
Contributor

Summary:
Move with_simd_level / with_simd_level_256bit calls outside the
enclosing loops so the SIMD level is resolved once rather than on every
iteration.

Sites fixed:

  • distances.cpp: knn_inner_products_by_idx, knn_L2sqr_by_idx
  • NeuralNet.cpp: ZnLUTCodec::encode
  • ClusteringInitialization.cpp: init_kmpp_plus_plus
  • residual_quantizer_encode_steps.cpp: beam_search_encode_step_tab

Differential Revision: D100144174

Summary:
Move `with_simd_level` / `with_simd_level_256bit` calls outside the
enclosing loops so the SIMD level is resolved once rather than on every
iteration.

Sites fixed:
- distances.cpp: knn_inner_products_by_idx, knn_L2sqr_by_idx
- NeuralNet.cpp: ZnLUTCodec::encode
- ClusteringInitialization.cpp: init_kmpp_plus_plus
- residual_quantizer_encode_steps.cpp: beam_search_encode_step_tab

Differential Revision: D100144174
@meta-cla meta-cla bot added the CLA Signed label Apr 10, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Apr 10, 2026

@algoriddle has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100144174.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant