Skip to content

Commit

Permalink
Begin migrate ScalarQuantizer to simdlib (facebookresearch#3613)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebookresearch#3613

As a demo for Mengdi.

The steps to fully migrate to simdlib are:

1. change all function interfaces to use the generic simd8float32 and friends prototypes -- make sure it compiles on fbcode.

2. make sure it also compiles on ARM

3. see which functions can be mirgrated to only use the generic codepath

4. benchmark if the simd emulated path is competitve with the scalar (for platforms without specific SIMD support)

The rationale here is that there are many SIMD instructions that are straightforward, like adding or subtracting registers, they can be put in common between implementations. The only code that may remain with arch-specific intrinsics is where they way of doing things is very different between AVX and NEON.

Differential Revision: D59395882
  • Loading branch information
mengdilin authored and facebook-github-bot committed Aug 20, 2024
1 parent 4ca6734 commit 9f979d9
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 285 deletions.
1 change: 1 addition & 0 deletions faiss/impl/AdditiveQuantizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <faiss/utils/Heap.h>
#include <faiss/utils/distances.h>
#include <faiss/utils/hamming.h>
#include <faiss/utils/simdlib.h>
#include <faiss/utils/utils.h>

extern "C" {
Expand Down
Loading

0 comments on commit 9f979d9

Please sign in to comment.