Skip to content
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

Integrate data type enums & Add SIMD support for unt8_t and int8_t Indices #52

Merged
merged 32 commits into from
Jul 31, 2024

Conversation

BlaiseMuhirwa
Copy link
Owner

@BlaiseMuhirwa BlaiseMuhirwa commented Apr 23, 2024

The main goal of this relatively large PR is to allow us to build FlatNav indices of type other than FP32. Currently, with this PR, we support building Uint8 and Int8 indices as well.

Some important changes here include:

  • The distance classes are now templated on datatype Ex.
SquaredL2Distance<DataType::uint8>(dim)
  • The python classes are no longer under a common interface. This is not ideal, but I couldn't find an easy way to get a common interface without sacrificing performance. We now have indices of type, such as IndexL2Float, IndexIPInt8, etc. I linked an issue for fixing this in a subsequent PR: unified interface for all index types  #66
  • Removed the function pointer design for computing distances. With reliance on template meta-programming for compile-time dispatching (and some runtime dispatching for selecting the right SIMD function implementation), we eliminate the need for a function pointer. This is mostly for code readability and extensibility.

@BlaiseMuhirwa BlaiseMuhirwa changed the base branch from main to refactor-simd-code April 23, 2024 08:01
@BlaiseMuhirwa BlaiseMuhirwa requested review from brc7 and vihan29 April 23, 2024 08:21
@BlaiseMuhirwa BlaiseMuhirwa changed the title Integrate data type enums Integrate data type enums & Add SIMD support for int8_t Indices Apr 23, 2024
@BlaiseMuhirwa BlaiseMuhirwa changed the base branch from refactor-simd-code to main July 26, 2024 21:09
@BlaiseMuhirwa BlaiseMuhirwa changed the title Integrate data type enums & Add SIMD support for int8_t Indices Integrate data type enums & Add SIMD support for unt8_t Indices Jul 31, 2024
@BlaiseMuhirwa BlaiseMuhirwa changed the title Integrate data type enums & Add SIMD support for unt8_t Indices Integrate data type enums & Add SIMD support for unt8_t and int8_t Indices Jul 31, 2024
@BlaiseMuhirwa BlaiseMuhirwa merged commit 4ddf860 into main Jul 31, 2024
5 checks passed
@BlaiseMuhirwa BlaiseMuhirwa deleted the data-type-templates branch July 31, 2024 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants