Skip to content

put dispatch one level above#4802

Closed
mdouze wants to merge 1 commit intofacebookresearch:mainfrom
mdouze:export-D92966745
Closed

put dispatch one level above#4802
mdouze wants to merge 1 commit intofacebookresearch:mainfrom
mdouze:export-D92966745

Conversation

@mdouze
Copy link
Contributor

@mdouze mdouze commented Feb 12, 2026

Summary:
Dynamic dispatching will be performed when fvec_L2sqr is called. This is problematic for tight loops.
This diff moves the dispatching one level above in the calling code to avoid this pitfall.

In particular, the VectorDistance dispatcher now takes not only the metric type into account but also the SIMD level. The consequence is that there should be no degradation for IVFFlat.

Reviewed By: algoriddle

Differential Revision: D92966745

@meta-cla meta-cla bot added the CLA Signed label Feb 12, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Feb 12, 2026

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

mdouze added a commit to mdouze/faiss that referenced this pull request Feb 12, 2026
Summary:

Dynamic dispatching will be performed when fvec_L2sqr is called. This is problematic for tight loops.
This diff moves the dispatching one level above in the calling code to avoid this pitfall.


In particular, the VectorDistance dispatcher now takes not only the metric type into account but also the SIMD level. The consequence is that there should be no degradation for IVFFlat.

Reviewed By: algoriddle

Differential Revision: D92966745
mdouze added a commit to mdouze/faiss that referenced this pull request Feb 12, 2026
Summary:

Dynamic dispatching will be performed when fvec_L2sqr is called. This is problematic for tight loops.
This diff moves the dispatching one level above in the calling code to avoid this pitfall.


In particular, the VectorDistance dispatcher now takes not only the metric type into account but also the SIMD level. The consequence is that there should be no degradation for IVFFlat.

Reviewed By: algoriddle

Differential Revision: D92966745
Summary:

Dynamic dispatching will be performed when fvec_L2sqr is called. This is problematic for tight loops.
This diff moves the dispatching one level above in the calling code to avoid this pitfall.


In particular, the VectorDistance dispatcher now takes not only the metric type into account but also the SIMD level. The consequence is that there should be no degradation for IVFFlat.

Reviewed By: algoriddle

Differential Revision: D92966745
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Feb 13, 2026

This pull request has been merged in 55698d7.

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.

2 participants