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

refactor: use transposed centroids in PQ preprocess #594

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

usamoi
Copy link
Collaborator

@usamoi usamoi commented Sep 19, 2024

With this PR, on GIST, (nlist = 4096, residual_quantization = true)


nprobe = 300

  • IVF-RQ 0.9843 2.5s; 1x memory usage
  • IVF-PQ 0.9914 3.3s (ratio = 2, bits = 4; pq_rerank_size = 100); 2x memory usage
  • IVF-PQ 0.9812 2.7s (ratio = 3, bits = 4; pq_rerank_size = 188); 1.5x memory usage
  • IVF-PQ 0.9806 2.5s (ratio = 4, bits = 4; pq_rerank_size = 264); 1x memory usage
  • IVF-PQ 0.9526 2.3s (ratio = 8, bits = 4; pq_rerank_size = 720); 0.5x memory usage

nprobe = 200

  • IVF-RQ 0.9720 1.9s; 1x memory usage
  • IVF-PQ 0.9731 2.3s (ratio = 2, bits = 4; pq_rerank_size = 100); 2x memory usage
  • IVF-PQ 0.9696 2.0s (ratio = 3, bits = 4; pq_rerank_size = 188); 1.5x memory usage
  • IVF-PQ 0.9700 1.9s (ratio = 4, bits = 4; pq_rerank_size = 264); 1x memory usage
  • IVF-PQ 0.9452 1.8s (ratio = 8, bits = 4; pq_rerank_size = 720); 0.5x memory usage

nprobe = 100

  • IVF-RQ 0.9258 1.3s; 1x memory usage
  • IVF-PQ 0.9250 1.5s (ratio = 2, bits = 4; pq_rerank_size = 100); 2x memory usage
  • IVF-PQ 0.9276 1.3s (ratio = 3, bits = 4; pq_rerank_size = 188); 1.5x memory usage
  • IVF-PQ 0.9261 1.3s (ratio = 4, bits = 4; pq_rerank_size = 264); 1x memory usage
  • IVF-PQ 0.9117 1.3s (ratio = 8, bits = 4; pq_rerank_size = 720); 0.5x memory usage

@usamoi usamoi marked this pull request as draft September 19, 2024 08:23
@usamoi usamoi marked this pull request as ready for review September 20, 2024 09:57
@usamoi usamoi added this pull request to the merge queue Sep 20, 2024
Merged via the queue into tensorchord:main with commit b4f5870 Sep 20, 2024
7 checks passed
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.

1 participant