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

Any plan to speed up pgvector.rs with Intel AMX instruction? #547

Open
george-gu-2021 opened this issue Aug 3, 2024 · 4 comments
Open

Comments

@george-gu-2021
Copy link

george-gu-2021 commented Aug 3, 2024

I came across the highly creative project which addresses the vector search inside PosgreSQL, one of the most popular open source databases.

Intel Xeon platform supports AMX instruction which can accelerate vector inner-product computation significantly. May I know if we have a plan to speed up pgvevtor.rs with the advanced CPU instruction? @gaocegege

@VoVAllen
Copy link
Member

VoVAllen commented Aug 3, 2024

I had some investigation with AMX before. The conclusion I got is that AMX won't provide speed up for dot product. It's possible to provide some speed up but not too much on matrix vector multiplication. Is this right?

We're interested in AMX but doesn't know it a lot. Would be nice if we can have some collaborations here!

@george-gu-2021
Copy link
Author

george-gu-2021 commented Aug 3, 2024

Regarding the gain from AMX instruction, it may depend on the scenario and usage method.

May I know the vectors are stored in continuous memory in column oriented? If it is, AMX may speed up ~4X for single query in index flat algorithm per our estimation.

@VoVAllen
Copy link
Member

VoVAllen commented Aug 3, 2024

The storage layout is flexible for us, and we're also doing some new algorithm on IVF. Therefore we're definitely interested on the acceleration for vector matrix distance computation. Is there any real world AMX code we can learn from?

@george-gu-2021
Copy link
Author

Here is the PR which illustrates the AMX acceleration for FAISS library for your reference.
facebookresearch/faiss#3266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants