Skip to content

Informative warnings for CAGRA construction with low intermediate degree#2217

Open
landrumb wants to merge 5 commits into
NVIDIA:mainfrom
landrumb:landrumb/cagra-degree-warning
Open

Informative warnings for CAGRA construction with low intermediate degree#2217
landrumb wants to merge 5 commits into
NVIDIA:mainfrom
landrumb:landrumb/cagra-degree-warning

Conversation

@landrumb

@landrumb landrumb commented Jun 4, 2026

Copy link
Copy Markdown

Resolves #2033 with more informative warnings about the intermediate graph degree parameter.

@copy-pr-bot

copy-pr-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 370edac3-2cf8-4341-b002-bba632d15354

📥 Commits

Reviewing files that changed from the base of the PR and between 41ac9af and 0625256.

📒 Files selected for processing (3)
  • cpp/src/neighbors/detail/cagra/cagra_build.cuh
  • cpp/src/neighbors/detail/cagra/graph_core.cuh
  • cpp/src/neighbors/detail/cagra/utils.hpp
✅ Files skipped from review due to trivial changes (1)
  • cpp/src/neighbors/detail/cagra/graph_core.cuh
🚧 Files skipped from review as they are similar to previous changes (1)
  • cpp/src/neighbors/detail/cagra/cagra_build.cuh

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • Improvements
    • Added configuration validation warnings recommending intermediate degree settings (1.5× target graph degree) to prevent connectivity issues during graph optimization.
    • Enhanced error messages with actionable guidance on configuring graph parameters to resolve construction failures.

Walkthrough

Adds a constexpr helper to compute a recommended intermediate degree (~1.5× graph_degree), warns when provided intermediate_degree is below that threshold during pre-build checks, and enhances the GPU pruning assertion to include the recommended value and more specific diagnostic guidance.

Changes

CAGRA Graph Degree Diagnostics

Layer / File(s) Summary
Recommended-degree helper and pre-check
cpp/src/neighbors/detail/cagra/utils.hpp, cpp/src/neighbors/detail/cagra/cagra_build.cuh
Adds recommended_intermediate_graph_degree(size_t) and updates check_graph_degree to compute the recommended intermediate degree (~1.5 * graph_degree) and emit a warning if intermediate_degree is below it.
Prune assertion diagnostic
cpp/src/neighbors/detail/cagra/graph_core.cuh
Updates prune_graph_gpu assertion to compute and include the recommended intermediate degree in its diagnostic when pruning fails, and reports both output_graph_degree and knn_graph_degree with guidance about invalid/duplicate neighbor causes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 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 accurately describes the main change: adding informative warnings for CAGRA construction when intermediate degree is low, which directly addresses the linked issue's objective.
Description check ✅ Passed The description relates to the changeset by referencing issue #2033 and stating that it adds more informative warnings about intermediate graph degree parameter, which matches the code changes.
Linked Issues check ✅ Passed All coding requirements from issue #2033 are met: warning implementation in cagra_build.cuh [#2033], improved assertion messaging in graph_core.cuh [#2033], and centralized recommendation function in utils.hpp [#2033] that computes 1.5× relationship.
Out of Scope Changes check ✅ Passed All changes are directly scoped to addressing issue #2033: adding warnings and recommendations for intermediate degree parameter across three CAGRA-related files.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@divyegala

Copy link
Copy Markdown
Contributor

Could you make the PR title more specific and descriptive please? As we use squash commits, the PR title acts as the commit message after the PR is merged.

@landrumb landrumb changed the title added informative warnings Informative warnings for CAGRA construction with low intermediate degree Jun 4, 2026
@cjnolet cjnolet added doc Improvements or additions to documentation non-breaking Introduces a non-breaking change labels Jun 5, 2026
@cjnolet cjnolet moved this to In Progress in Unstructured Data Processing Jun 5, 2026
@cjnolet

cjnolet commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

/ok to test 41ac9af

@divyegala

Copy link
Copy Markdown
Contributor

/ok to test dfdeced

@divyegala

Copy link
Copy Markdown
Contributor

/ok to test 9118410

Comment thread cpp/src/neighbors/detail/cagra/graph_core.cuh Outdated
@landrumb landrumb requested a review from cjnolet June 11, 2026 19:22
@dantegd

dantegd commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

/ok to test 0625256

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

Labels

doc Improvements or additions to documentation non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Better warning / assert and handling of cases where CAGRA graph degree is not strictly larger than intermediate graph degree.

4 participants