Skip to content

avx512 for binary quantization#7052

Merged
IvanPleshkov merged 2 commits intodevfrom
avx512-for-binary-quantization
Oct 29, 2025
Merged

avx512 for binary quantization#7052
IvanPleshkov merged 2 commits intodevfrom
avx512-for-binary-quantization

Conversation

@IvanPleshkov
Copy link
Contributor

@IvanPleshkov IvanPleshkov commented Aug 13, 2025

This PR adds AVX512 support for BQ.

It speeds up BQ scoring because of _mm256_popcnt_epi64, which calculates POPCNT for 4 values.

Criterion benches:

encode/score binary linear access u128
                        time:   [614.89 µs 615.02 µs 615.13 µs]
                        change: [−22.744% −22.646% −22.548%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 10 measurements (20.00%)
  1 (10.00%) high mild
  1 (10.00%) high severe
encode/score binary random access u128
                        time:   [1.3676 ms 1.3794 ms 1.3914 ms]
                        change: [−26.581% −25.563% −24.412%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 10 measurements (10.00%)
  1 (10.00%) high mild

dbpedia 1M, qdrant-bq-rps-m-64-ef-256 without rescoring

"mean_time": 0.0008151541272178293,
vs
"mean_time": 0.000877215038286522,

Test docker image: https://github.com/qdrant/qdrant/actions/runs/16938730067

@IvanPleshkov IvanPleshkov marked this pull request as ready for review October 29, 2025 11:48
coderabbitai[bot]

This comment was marked as resolved.

@IvanPleshkov IvanPleshkov force-pushed the avx512-for-binary-quantization branch from 44e87a8 to 9ef1ca7 Compare October 29, 2025 11:54
@qdrant qdrant deleted a comment from coderabbitai bot Oct 29, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 29, 2025

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{"name":"HttpError","status":404,"request":{"method":"PATCH","url":"https://api.github.com/repos/qdrant/qdrant/issues/comments/3461123664","headers":{"accept":"application/vnd.github.v3+json","user-agent":"octokit.js/0.0.0-development octokit-core.js/7.0.5 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":{"body":"<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\n<!-- walkthrough_start -->\n\n<details>\n<summary>📝 Walkthrough</summary>\n\n## Walkthrough\n\nAdds an AVX512-optimized code path for XOR-popcount on 128-bit vectors in the quantization module. A new unsafe function (`impl_xor_popcnt_avx512_uint128`) with target_features (avx512vl, avx512vpopcntdq, avx2, avx, sse4.1, sse2) processes data in 256-bit chunks, XORs lanes, computes popcounts per 64-bit lane, accumulates results, and handles a trailing 128-bit tail. Runtime CPU feature detection is used to choose this path, with an early return placed before the existing SSE4.2 fallback in `xor_popcnt`.\n\n## Estimated code review effort\n\n🎯 3 (Moderate) | ⏱️ ~25 minutes\n\n- Verify correctness of SIMD lanes: XOR, popcount, and accumulation across 256-bit and 128-bit tails.\n- Check CPU feature gating and ordering (avx512vl + avx512vpopcntdq vs. other fallbacks).\n- Inspect unsafe usage for alignment, pointer/length assumptions, and potential UB on non-x86_64.\n- Confirm tests or benchmarks are present or consider adding targeted unit tests.\n\n## Suggested reviewers\n\n- xzfc\n- generall\n\n</details>\n\n<!-- walkthrough_end -->\n\n\n<!-- pre_merge_checks_walkthrough_start -->\n\n## Pre-merge checks and finishing touches\n<details>\n<summary>✅ Passed checks (3 passed)</summary>\n\n|     Check name     | Status   | Explanation                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |\n| :----------------: | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n|     Title Check    | ✅ Passed | The PR title \"avx512 for binary quantization\" directly describes the main change in the changeset, which adds AVX512-based optimization paths for XOR-popcount operations in binary quantization scoring. The title is concise, clear, and specific enough that a teammate reviewing commit history would understand the primary change. It accurately reflects the core objective of introducing AVX512 support to improve binary quantization performance.                         |\n|  Description Check | ✅ Passed | The PR description is clearly related to the changeset, explicitly stating \"This PR adds AVX512 support for BQ\" and explaining the performance improvement mechanism through `_mm256_popcnt_epi64`. The description provides meaningful context including benchmark results demonstrating the improvements and references to test validation. This directly corresponds to the code changes that introduce the AVX512-based implementation paths for binary quantization operations. |\n| Docstring Coverage | ✅ Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.                                                                                                                                                                                                                                                                                                                                                                                                 |\n\n</details>\n\n<!-- pre_merge_checks_walkthrough_end -->\n\n<!-- finishing_touch_checkbox_start -->\n\n<details>\n<summary>✨ Finishing touches</summary>\n\n- [ ] <!-- {\"checkboxId\": \"7962f53c-55bc-4827-bfbf-6a18da830691\"} --> 📝 Generate docstrings\n<details>\n<summary>🧪 Generate unit tests (beta)</summary>\n\n- [ ] <!-- {\"checkboxId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Create PR with unit tests\n- [ ] <!-- {\"checkboxId\": \"07f1e7d6-8a8e-4e23-9900-8731c2c87f58\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Post copyable unit tests in a comment\n- [ ] <!-- {\"checkboxId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Commit unit tests in branch `avx512-for-binary-quantization`\n\n</details>\n\n</details>\n\n<!-- finishing_touch_checkbox_end -->\n\n<!-- tips_start -->\n\n---\n\nThanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=qdrant/qdrant&utm_content=7052)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.\n\n<details>\n<summary>❤️ Share</summary>\n\n- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)\n- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)\n- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)\n- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)\n\n</details>\n\n<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>\n\n<!-- tips_end -->\n\n<!-- internal state start -->\n\n\n<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrI5Ho6gDYkuaCQA8AVgBGACZIADN8PjUMZ3kAR2xMcQAvanh8LEgDADlHAUouAHYABkDwnIBVGwAZLlhcXG5EDgB6NqJ1WGwBDSZmNoTaKgxcIZGUtu5sT082sorIasQiyABJCUwrb0RYAGt8CWWDAGV8bAoGEkgBUYZYXwCQ0LAoijBY+LAklPh08RZSCAJMIYM5SLhbvdHpAlMccqdcNRsK1+NwyCcAMIUEjUOjoTiQUKlUKBMClAAcYGCAGZoLSOKEACwcQJMgBaRgAItIGBR4NxARg3FAAIK0WjIUUANQAGi97NhuNxopD3pAAELwOIuSAARWSY3+GSBAAoNXqAJQaAxQKyUd7MTDXFDMXhHEhsMYE3D8gR4fEESAom74C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+FFn5vxLgLYFHrnm5loTrveN5F5L+hAh9EyBtBKBEEyDSLkn0QIEjGgGgC9BEDGHQHFKUOMU+qEAIOzMMQIHehSAwF+oUKEDSGgKULQIEBSIIVUearYPliIenIEKUM0TSIEH+met+j5GgMUIEFzOlNcCQMUMuoUOCrQGzH0d9C8TGEemgIjLQDSGevDJus9CBlzHQBEKUHsYUb6MdOYcoKQLCmDJGoiHiMJkHiZgHEHH8CwWHIgBHFHCOuPAnEnMuC4KnLYZAFiU7gQEiJ4MGvog8sJsAnrnor2PTAAOrdDGFFHUmHj+5HhlFlFTpXosoYZ+Loah6JxIYdpAA= -->\n\n<!-- internal state end -->"},"request":{"retryCount":1}},"response":{"url":"https://api.github.com/repos/qdrant/qdrant/issues/comments/3461123664","status":404,"headers":{"access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","content-encoding":"gzip","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Wed, 29 Oct 2025 12:01:33 GMT","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","transfer-encoding":"chunked","vary":"Accept-Encoding, Accept, X-Requested-With","x-accepted-github-permissions":"issues=write; pull_requests=write","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"308B:33AE30:8BFF0B:259A8E8:6902021D","x-ratelimit-limit":"15000","x-ratelimit-remaining":"14911","x-ratelimit-reset":"1761742085","x-ratelimit-resource":"core","x-ratelimit-used":"89","x-xss-protection":"0"},"data":{"message":"Not Found","documentation_url":"https://docs.github.com/rest/issues/comments#update-an-issue-comment","status":"404"}}}

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
lib/quantization/src/encoded_vectors_binary.rs (2)

287-303: LGTM: AVX-512 path gating and early return are correct.

The feature checks match the intrinsics used in the AVX-512 path, and placing this check before the SSE fallback is appropriate.

Optional: since AVX2 implies AVX on all practical CPUs and SSE2 is baseline on x86_64, you can drop those two runtime predicates to shorten the branch. If you adopt the AVX2-only lane-reduction below, you can also drop SSE4.1 from here.


1043-1093: Simplify lane reduction to AVX2-only; drop SSE4.1 dependency.

Use AVX2 lane extracts to sum the four 64-bit counters, avoiding the SSE4.1-only _mm_extract_epi64 after 128-bit extract. This lets you remove the sse4.1 target_feature and runtime check without changing behavior. Intrinsics availability: _mm_popcnt_epi64 requires avx512vpopcntdq+avx512vl; _mm256_extract_epi64 requires avx2. (doc.rust-lang.org)

Apply these diffs:

  1. Replace the reduction (sum lanes) with AVX2 extracts
-    // Extract high and low 128-bit lanes
-    let low = _mm256_castsi256_si128(sum); // Elements 0,1
-    let high = _mm256_extracti128_si256(sum, 1); // Elements 2,3
-    let sum128 = _mm_add_epi64(low, high);
-
-    // Extract and add the two 64-bit elements
-    let low64 = _mm_extract_epi64(sum128, 0);
-    let high64 = _mm_extract_epi64(sum128, 1);
-
-    (low64 + high64) as u32
+    // AVX2-only horizontal sum via lane extracts
+    let s0 = _mm256_extract_epi64(sum, 0);
+    let s1 = _mm256_extract_epi64(sum, 1);
+    let s2 = _mm256_extract_epi64(sum, 2);
+    let s3 = _mm256_extract_epi64(sum, 3);
+    (s0 + s1 + s2 + s3) as u32
  1. Drop the SSE4.1 target feature on the function (no longer needed)
 #[target_feature(enable = "avx512vl")]
 #[target_feature(enable = "avx512vpopcntdq")]
 #[target_feature(enable = "avx2")]
 #[target_feature(enable = "avx")]
-#[target_feature(enable = "sse4.1")]
 #[target_feature(enable = "sse2")]
  1. Optionally streamline runtime gating accordingly (now AVX, SSE4.1, SSE2 checks are unnecessary)
-        if is_x86_feature_detected!("avx512vl")
-            && is_x86_feature_detected!("avx512vpopcntdq")
-            && is_x86_feature_detected!("avx2")
-            && is_x86_feature_detected!("avx")
-            && is_x86_feature_detected!("sse4.1")
-            && is_x86_feature_detected!("sse2")
+        if is_x86_feature_detected!("avx512vl")
+            && is_x86_feature_detected!("avx512vpopcntdq")
+            && is_x86_feature_detected!("avx2")
         {

Net result: same correctness, fewer required CPU features and a slightly shorter hot-path branch.

Also applies to: 1083-1092, 1049-1051

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44e87a8 and 9ef1ca7.

📒 Files selected for processing (1)
  • lib/quantization/src/encoded_vectors_binary.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs

📄 CodeRabbit inference engine (.github/review-rules.md)

**/*.rs: Prefer explicit SomeType::from(x) over implicit x.into() in Rust code
Do not use transmute_from_u8, transmute_to_u8, transmute_from_u8_to_slice, transmute_from_u8_to_mut_slice, transmute_to_u8_slice in new code; use bytemuck or zerocopy instead

Files:

  • lib/quantization/src/encoded_vectors_binary.rs
**/src/**/*.rs

📄 CodeRabbit inference engine (.github/review-rules.md)

**/src/**/*.rs: Prefer exhaustive match arms over a catch-all _ arm to avoid missing new enum variants (except in tests/benchmarks or when provably safe)
Prefer explicit field ignoring with : _ over .. in struct patterns (except in tests/benchmarks or when provably safe)

Files:

  • lib/quantization/src/encoded_vectors_binary.rs
🧠 Learnings (2)
📚 Learning: 2025-08-11T07:57:01.399Z
Learnt from: IvanPleshkov
PR: qdrant/qdrant#6986
File: lib/segment/src/vector_storage/quantized/quantized_vectors.rs:81-84
Timestamp: 2025-08-11T07:57:01.399Z
Learning: In `lib/segment/src/vector_storage/quantized/quantized_vectors.rs`, the BitsStoreType parameter difference between single-vector and multi-vector Binary quantization is intentional: single-vector storage uses `EncodedVectorsBin<u128, ...>` to enable 128-bit SIMD/popcount optimizations for longer vectors, while multi-vector storage uses `EncodedVectorsBin<u8, ...>` because multivectors are typically shorter and benefit from byte-granular storage.

Applied to files:

  • lib/quantization/src/encoded_vectors_binary.rs
📚 Learning: 2025-08-15T11:42:00.297Z
Learnt from: IvanPleshkov
PR: qdrant/qdrant#7043
File: lib/segment/src/vector_storage/quantized/quantized_mmap_storage.rs:86-90
Timestamp: 2025-08-15T11:42:00.297Z
Learning: In lib/segment/src/vector_storage/quantized/quantized_mmap_storage.rs, overflow protection for encoded_storage_size computation (quantized_vector_size * vectors_count) is implemented in PR #7048, using checked_mul with u64 casting to prevent silent overflow.

Applied to files:

  • lib/quantization/src/encoded_vectors_binary.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: test-shard-snapshot-api-s3-minio
  • GitHub Check: e2e-tests
  • GitHub Check: test-consensus-compose
  • GitHub Check: integration-tests
  • GitHub Check: test-consistency
  • GitHub Check: integration-tests-consensus
  • GitHub Check: rust-tests (macos-latest)
  • GitHub Check: rust-tests (ubuntu-latest)
  • GitHub Check: rust-tests-no-rocksdb (ubuntu-latest)
  • GitHub Check: rust-tests (windows-latest)
  • GitHub Check: lint

@IvanPleshkov IvanPleshkov merged commit 793b261 into dev Oct 29, 2025
15 checks passed
@IvanPleshkov IvanPleshkov deleted the avx512-for-binary-quantization branch October 29, 2025 12:26
timvisee pushed a commit that referenced this pull request Nov 14, 2025
* avx512 for binary quantization

fix build

* change checks order
@timvisee timvisee mentioned this pull request Nov 14, 2025
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.

3 participants