Skip to content

Allow GPU payload HNSW builds without main graph#8832

Merged
IvanPleshkov merged 2 commits into
devfrom
fix/gpu-payload-hnsw-m-zero
Apr 28, 2026
Merged

Allow GPU payload HNSW builds without main graph#8832
IvanPleshkov merged 2 commits into
devfrom
fix/gpu-payload-hnsw-m-zero

Conversation

@qdrant-cloud-bot

Copy link
Copy Markdown
Contributor

Summary

  • Create GPU vector storage when payload HNSW blocks need indexing, even if the main graph is skipped with hnsw.m=0.
  • Keep main graph GPU construction gated separately so payload block construction can still use the GPU context.

Test plan

  • cargo check -p segment
  • cargo check -p segment --features gpu
  • cargo test -p segment --features gpu --test integration gpu_hnsw_test --no-run

Made with Cursor

Create GPU vector storage when payload HNSW links need indexing so hnsw.m=0 does not force payload block construction onto CPU.

Made-with: Cursor
@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f1f15090-e9d0-4a82-9a80-a1626e43d20a

📥 Commits

Reviewing files that changed from the base of the PR and between e772e5c and 6dfe326.

📒 Files selected for processing (1)
  • lib/segment/src/index/hnsw_index/hnsw.rs

📝 Walkthrough

Walkthrough

GPU vector allocation in HNSW index construction is made conditional not only for main-graph builds but also when additional payload link graphs require GPU indexing. The code now creates gpu_vectors when either building the main HNSW graph or when any additional_links_params has non-empty indexed_fields. Main-graph GPU construction (build_main_graph_on_gpu) is executed only when build_main_graph is true, avoiding GPU main-graph work when only payload link graphs are built. GPU vector reuse for payload link building remains supported.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Flacky gpu filterable test #8519: Modifies and tests HNSW GPU vs CPU build paths and payload-index interactions; closely related to GPU/main-graph conditional logic changes.

Suggested reviewers

  • IvanPleshkov
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Allow GPU payload HNSW builds without main graph' accurately summarizes the main change: enabling GPU vector creation for payload HNSW blocks even when the main graph is skipped.
Description check ✅ Passed The description is directly related to the changeset, clearly explaining the purpose of conditional GPU vector creation for payload HNSW indexing and providing relevant test commands.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/gpu-payload-hnsw-m-zero

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Collapse the main-graph GPU condition so the all-features lint job passes.

Made-with: Cursor
@generall generall requested a review from IvanPleshkov April 28, 2026 20:13

@IvanPleshkov IvanPleshkov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clean bugfix

@IvanPleshkov IvanPleshkov merged commit 2fae038 into dev Apr 28, 2026
15 checks passed
@IvanPleshkov IvanPleshkov deleted the fix/gpu-payload-hnsw-m-zero branch April 28, 2026 22:55
timvisee pushed a commit that referenced this pull request May 8, 2026
* fix: allow GPU payload HNSW builds without main graph

Create GPU vector storage when payload HNSW links need indexing so hnsw.m=0 does not force payload block construction onto CPU.

Made-with: Cursor

* fix: satisfy clippy in GPU HNSW path

Collapse the main-graph GPU condition so the all-features lint job passes.

Made-with: Cursor

---------

Co-authored-by: Cursor Agent <[email protected]>
@timvisee timvisee mentioned this pull request May 8, 2026
@coderabbitai coderabbitai Bot mentioned this pull request May 11, 2026
9 tasks
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