Skip to content

Conversation

@subhadeepkaran
Copy link

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.

Reviewed By: mnorris11

Differential Revision: D72937708

@meta-cla meta-cla bot added the CLA Signed label Aug 26, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72937708

subhadeepkaran pushed a commit to subhadeepkaran/faiss that referenced this pull request Aug 26, 2025
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.

Reviewed By: mnorris11

Differential Revision: D72937708
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72937708

subhadeepkaran pushed a commit to subhadeepkaran/faiss that referenced this pull request Aug 26, 2025
Summary:
Pull Request resolved: facebookresearch#4553

`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.

Reviewed By: mnorris11

Differential Revision: D72937708
subhadeepkaran pushed a commit to subhadeepkaran/faiss that referenced this pull request Aug 26, 2025
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.

Reviewed By: mnorris11

Differential Revision: D72937708
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72937708

subhadeepkaran pushed a commit to subhadeepkaran/faiss that referenced this pull request Aug 26, 2025
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.

Reviewed By: mnorris11

Differential Revision: D72937708
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72937708

subhadeepkaran pushed a commit to subhadeepkaran/faiss that referenced this pull request Aug 26, 2025
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.

Reviewed By: mnorris11

Differential Revision: D72937708
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72937708

subhadeepkaran pushed a commit to subhadeepkaran/faiss that referenced this pull request Aug 26, 2025
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.

Reviewed By: mnorris11

Differential Revision: D72937708
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72937708

subhadeepkaran pushed a commit to subhadeepkaran/faiss that referenced this pull request Aug 26, 2025
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.

Reviewed By: mnorris11

Differential Revision: D72937708
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72937708

subhadeepkaran pushed a commit to subhadeepkaran/faiss that referenced this pull request Aug 26, 2025
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.

Reviewed By: mnorris11

Differential Revision: D72937708
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72937708


#include <faiss/utils/distances.h>

#define AUTOVEC_LEVEL SIMDLevel::ARM_NEON
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name of the file should be changed to distances_arm_neon.cpp

…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
subhadeepkaran pushed a commit to subhadeepkaran/faiss that referenced this pull request Aug 27, 2025
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.

Reviewed By: mnorris11

Differential Revision: D72937708
Summary:
Pull Request resolved: facebookresearch#4553

`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.

Reviewed By: mnorris11

Differential Revision: D72937708
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72937708

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.

5 participants