-
Notifications
You must be signed in to change notification settings - Fork 4k
Dynamic Dispatch Task 7 (distances.cpp) #4559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
subhadeepkaran
wants to merge
8
commits into
facebookresearch:main
Choose a base branch
from
subhadeepkaran:export-D80500327
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dynamic Dispatch Task 7 (distances.cpp) #4559
subhadeepkaran
wants to merge
8
commits into
facebookresearch:main
from
subhadeepkaran:export-D80500327
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request was exported from Phabricator. Differential Revision: D80500327 |
This pull request was exported from Phabricator. Differential Revision: D80500327 |
subhadeepkaran
pushed a commit
to subhadeepkaran/faiss
that referenced
this pull request
Aug 27, 2025
Summary: Pull Request resolved: facebookresearch#4559 Reviewed By: mnorris11 Differential Revision: D80500327
f4adb15
to
71f29cb
Compare
…DQ, Vl, DL) detection Summary: * Added support to detect SIMD instruction set for both `AVX2` and `AVX512F, AVX512VL` related levels * Added hardware specific unit tests (eg: checks when unit tests are ran on x86 arch then relevant SIMD levels are returned, also respective instructions are executed) * Reason for explicitly running computation and not relying on `__builtin_cpu_supports("avx512f")` [link](https://stackoverflow.com/questions/48677575/does-gccs-builtin-cpu-supports-check-for-os-support) * Also, fixes the bug in existing `AVX2` detection * Incorrect CPUID Bit Check: Function uses `ebx & (1 << 16)` to check for `AVX2` support. This is incorrect because bit 16 in `ebx` is actually used for `AVX-512F`, not `AVX2`. * Correct Bit for AVX2: Correct bit for detecting AVX2 is bit 5 in `ebx` when `eax = 7` and `ecx = 0`. This is based on Intel's documentation for the CPUID instruction. * Another bug observed in constructor for SIMDConfig (if env variable is set, the codepath still follows detection via code) * Improving SIMDConfig to take parameters to its constructor to support and enable injection mechanism for better testing* Adding more unit tests for other Hardware * Added variable with SIMDConfig to track all possible supported SIMD Levels Differential Revision: D72937710 Reviewed By: mdouze
Summary: `fvec_madd` is the first function to test dispatching to AVX and AVX512 distances_simd.cpp is split into specialized files distances_avx2.cpp distances_avx512.cpp that are compiled with appropriate flags. Differential Revision: D72937708 Reviewed By: mnorris11
Summary: Pull Request resolved: facebookresearch#4291 moved IndexIVFPQ and IndexPQ to dynamic dispatch. Since the code was already quite modular (thanks Alex!), this boils down to make independent cpp files for the different SIMD versions. Differential Revision: D72937709
…training code, split quantizer code into headers, Make headers more independent Summary: Move the interface of SIMD functions to use the simdXfloat32 API to mutualize code. Begin splitting the ScalarQuantizer.cpp Continue splitting. Purely in header files for now. Differential Revision: D72945865
) Summary: Pull Request resolved: facebookresearch#4296 Splits the ScalarQuantizer code into parts so that the AVX2 and AVX512 can be compiled independently. Differential Revision: D73037185
This pull request was exported from Phabricator. Differential Revision: D80500327 |
subhadeepkaran
pushed a commit
to subhadeepkaran/faiss
that referenced
this pull request
Aug 28, 2025
Summary: Pull Request resolved: facebookresearch#4559 Reviewed By: mnorris11 Differential Revision: D80500327
71f29cb
to
fe5ef5b
Compare
Summary: Migration of the 4-bit codecs to dynamic dispatch. The migration consists in: - templatizing the SIMD ResultHandlers to the SIMDLevel - instantiating the AVX2 and AVX512 code in their own files (compile units) - removing any SIMD dependency from IndexFastScan and IndexIVFFastScan - adding dispatching code for the SIMD code Differential Revision: D73581633
Summary: buck test mode/opt -c fbcode.arch=aarch64 //faiss/tests/:test_fast_scan_ivf Differential Revision: D74275821
This pull request was exported from Phabricator. Differential Revision: D80500327 |
fe5ef5b
to
79293aa
Compare
subhadeepkaran
pushed a commit
to subhadeepkaran/faiss
that referenced
this pull request
Aug 28, 2025
Summary: Pull Request resolved: facebookresearch#4559 Reviewed By: mnorris11 Differential Revision: D80500327
Summary: Pull Request resolved: facebookresearch#4559 Reviewed By: mnorris11 Differential Revision: D80500327
This pull request was exported from Phabricator. Differential Revision: D80500327 |
79293aa
to
2a02072
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Differential Revision: D80500327