Skip to content

Convert PQ 4 bit code to dynamic dispatch#4309

Open
mdouze wants to merge 8 commits intofacebookresearch:mainfrom
mdouze:export-D73581633
Open

Convert PQ 4 bit code to dynamic dispatch#4309
mdouze wants to merge 8 commits intofacebookresearch:mainfrom
mdouze:export-D73581633

Conversation

@mdouze
Copy link
Contributor

@mdouze mdouze commented Apr 24, 2025

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

@facebook-github-bot
Copy link
Contributor

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

@alexanderguzhva
Copy link
Contributor

@mdouze is it good to review? 'Facebook Internal' tests has been running for 5 days O_o

@mdouze
Copy link
Contributor Author

mdouze commented May 4, 2025

@mdouze is it good to review? 'Facebook Internal' tests has been running for 5 days O_o

Not it's not yet ready, we have a significant TODO list to add.
However, if you have comments, feel free to leave them.

mdouze and others added 8 commits May 5, 2025 13:59
Differential Revision: D73581632
Differential Revision: D72937710
Differential Revision: D72937708
Summary:
Model to apply dynamic dispatch to functions that are auto-vectorized.

Note that the implementation in knowhere prefers using function pointers than to do a switch. The advantage is that it is probably faster. The disadvantage is that it changes the function prototypes.

Differential Revision: D72937711
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
Summary:
Pull Request resolved: facebookresearch#4309

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
@facebook-github-bot
Copy link
Contributor

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

@mdouze mdouze force-pushed the export-D73581633 branch from c2b1a43 to 52abb1a Compare May 6, 2025 07:44
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.

4 participants