Skip to content

Add SIMD dynamic dispatch migration guide (#4973)#4973

Closed
algoriddle wants to merge 1 commit intofacebookresearch:mainfrom
algoriddle:export-D97799584
Closed

Add SIMD dynamic dispatch migration guide (#4973)#4973
algoriddle wants to merge 1 commit intofacebookresearch:mainfrom
algoriddle:export-D97799584

Conversation

@algoriddle
Copy link
Copy Markdown
Contributor

@algoriddle algoriddle commented Mar 23, 2026

Summary:

Add a developer-facing guide for migrating FAISS modules from compile-time
#ifdef SIMD guards to the runtime dynamic dispatch (DD) infrastructure.

Covers:

  • Why separate compilation units are required (auto-vectorization trap)
  • The 4-step conversion recipe with worked examples
  • Two template instantiation patterns (explicit vs macro-driven)
  • Dispatch masks and with_selected_simd_levels
  • Build system setup (CMake + Buck)
  • Common patterns: shared -inl.h kernels, auto-vectorization, SVE forwarding
  • Key design principles
  • Testing workflow with FAISS_OPT_LEVEL=dd and FAISS_SIMD_LEVEL override
  • Common pitfalls

All code examples link to specific lines in the GitHub repo (pinned to
commit 645a742) so readers can verify patterns against real code.

Differential Revision: D97799584

@meta-cla meta-cla bot added the CLA Signed label Mar 23, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Mar 23, 2026

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

@meta-codesync meta-codesync bot changed the title Add SIMD dynamic dispatch migration guide Add SIMD dynamic dispatch migration guide (#4973) Mar 26, 2026
algoriddle pushed a commit to algoriddle/faiss that referenced this pull request Mar 26, 2026
Summary:

Add a developer-facing guide for migrating FAISS modules from compile-time
#ifdef SIMD guards to the runtime dynamic dispatch (DD) infrastructure.

Covers:
- Why separate compilation units are required (auto-vectorization trap)
- The 4-step conversion recipe with worked examples
- Two template instantiation patterns (explicit vs macro-driven)
- Dispatch masks and with_selected_simd_levels
- Build system setup (CMake + Buck)
- Common patterns: shared -inl.h kernels, auto-vectorization, SVE forwarding
- Key design principles
- Testing workflow with FAISS_OPT_LEVEL=dd and FAISS_SIMD_LEVEL override
- Common pitfalls

All code examples link to specific lines in the GitHub repo (pinned to
commit 645a742) so readers can verify patterns against real code.

Differential Revision: D97799584
Summary:
Pull Request resolved: facebookresearch#4973

Add a developer-facing guide for migrating FAISS modules from compile-time
#ifdef SIMD guards to the runtime dynamic dispatch (DD) infrastructure.

Covers:
- Why separate compilation units are required (auto-vectorization trap)
- The 4-step conversion recipe with worked examples
- Two template instantiation patterns (explicit vs macro-driven)
- Dispatch masks and with_selected_simd_levels
- Build system setup (CMake + Buck)
- Common patterns: shared -inl.h kernels, auto-vectorization, SVE forwarding
- Key design principles
- Testing workflow with FAISS_OPT_LEVEL=dd and FAISS_SIMD_LEVEL override
- Common pitfalls

All code examples link to specific lines in the GitHub repo (pinned to
commit 645a742) so readers can verify patterns against real code.

Differential Revision: D97799584
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Mar 27, 2026

This pull request has been merged in e6f5c0c.

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