Skip to content

Commit

Permalink
Use _mm512_popcnt_epi64 to speedup hamming distance evaluation. (#4020)
Browse files Browse the repository at this point in the history
Summary:
The `_mm512_popcnt_epi64` intrinsic is used to accelerate Hamming distance calculations in `HammingComputerDefault` and `HammingComputer64`.

Benchmarking with [bench_hamming_computer](https://github.com/facebookresearch/faiss/blob/main/benchs/bench_hamming_computer.cpp) on AWS [r7i](https://aws.amazon.com/ec2/instance-types/r7i/) instance shows a performance improvement of up to 30% compared to AVX-2.

This PR depends on [PR#4025](#4025)

Pull Request resolved: #4020

Reviewed By: junjieqi

Differential Revision: D67650183

Pulled By: mengdilin

fbshipit-source-id: 17e5b68570dced1fea0b885dd4e67c17dfc7bece
  • Loading branch information
mulugetam authored and facebook-github-bot committed Dec 27, 2024
1 parent ab479a1 commit 0cbc2a8
Show file tree
Hide file tree
Showing 3 changed files with 494 additions and 0 deletions.
1 change: 1 addition & 0 deletions faiss/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ set(FAISS_HEADERS
utils/hamming_distance/hamdis-inl.h
utils/hamming_distance/neon-inl.h
utils/hamming_distance/avx2-inl.h
utils/hamming_distance/avx512-inl.h
)

if(NOT WIN32)
Expand Down
Loading

0 comments on commit 0cbc2a8

Please sign in to comment.