Skip to content

Graph degree equals intermediate graph degree bug fix#1834

Merged
rapids-bot[bot] merged 6 commits intorapidsai:mainfrom
irina-resh-nvda:graph_degree_equals_intermediate_graph_degree_bug_fix
Feb 24, 2026
Merged

Graph degree equals intermediate graph degree bug fix#1834
rapids-bot[bot] merged 6 commits intorapidsai:mainfrom
irina-resh-nvda:graph_degree_equals_intermediate_graph_degree_bug_fix

Conversation

@irina-resh-nvda
Copy link
Contributor

This PR fixes a cudaErrorIllegalAddress error in the iterative CAGRA graph build caused by an out-of-bounds memory access. The issue occurred because the algorithm allocated memory for intermediate_graph_degree neighbors but attempted to write one additional neighbor during the search phase. The fix updates the topk allocation to ensure buffers are sized for intermediate_graph_degree + 1.
I also added a new test into NEIGHBORS_ANN_CAGRA_TEST_BUGS to reproduce the failure. It confirms the fix works correctly for float, int8_t, and uint8_t data types.
Fixes #1818
#1818

@copy-pr-bot
Copy link

copy-pr-bot bot commented Feb 23, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@irina-resh-nvda irina-resh-nvda self-assigned this Feb 23, 2026
@irina-resh-nvda irina-resh-nvda added non-breaking Introduces a non-breaking change C++ bug Something isn't working labels Feb 23, 2026
@irina-resh-nvda irina-resh-nvda marked this pull request as ready for review February 23, 2026 12:05
@irina-resh-nvda irina-resh-nvda requested review from a team as code owners February 23, 2026 12:05
@divyegala divyegala mentioned this pull request Feb 23, 2026
8 tasks
Copy link
Member

@dantegd dantegd left a comment

Choose a reason for hiding this comment

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

bug fix looks good to me, just had some small suggestions

Copy link
Contributor

@tfeher tfeher left a comment

Choose a reason for hiding this comment

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

Thanks Irina for the fix, it looks good to me!

@tfeher
Copy link
Contributor

tfeher commented Feb 24, 2026

/merge

@rapids-bot rapids-bot bot merged commit 6026d4d into rapidsai:main Feb 24, 2026
78 checks passed
tfeher pushed a commit to Stardust-SJF/cuvs_rabitq that referenced this pull request Mar 3, 2026
This PR fixes a cudaErrorIllegalAddress error in the iterative CAGRA graph build caused by an out-of-bounds memory access. The issue occurred because the algorithm allocated memory for intermediate_graph_degree neighbors but attempted to write one additional neighbor during the search phase. The fix updates the topk allocation to ensure buffers are sized for intermediate_graph_degree + 1.
I also added a new test into  NEIGHBORS_ANN_CAGRA_TEST_BUGS to reproduce the failure. It confirms the fix works correctly for float, int8_t, and uint8_t data types.
Fixes  rapidsai#1818
rapidsai#1818

Authors:
  - https://github.com/irina-resh-nvda

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)
  - Tamas Bela Feher (https://github.com/tfeher)

URL: rapidsai#1834
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working C++ non-breaking Introduces a non-breaking change

Development

Successfully merging this pull request may close these issues.

[BUG] cuVS 25.12 failed to build index with ITERATIVE_CAGRA_SEARCH and small intermediate_graph_degree

3 participants