UMAP fix int32 overflow causing illegal mem access#7587
Merged
rapids-bot[bot] merged 5 commits intorapidsai:mainfrom Dec 11, 2025
Merged
UMAP fix int32 overflow causing illegal mem access#7587rapids-bot[bot] merged 5 commits intorapidsai:mainfrom
rapids-bot[bot] merged 5 commits intorapidsai:mainfrom
Conversation
|
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. |
Contributor
|
can we instead use |
Member
Author
Yes, I've updated it to use |
jinsolp
requested changes
Dec 10, 2025
viclafargue
approved these changes
Dec 11, 2025
Member
Author
|
/merge |
mani-builds
pushed a commit
to mani-builds/cuml
that referenced
this pull request
Jan 11, 2026
Resolves rapidsai#7517 The `optimize_batch_kernel` and `optimize_batch_kernel_reg` use the following condition to check for out of bounds `while (row < nnz)` Inside the loop `row += skip_size` is used for iteration. However, when row is close to `INT32_MAX` it can cause an overflow, which leads to the value of row wrapping around to become a negative number. The loop will then be run again since row < nnz still, which will lead to a cuda illegal memory access since row is negative. To solve this we can check for the overflow case and break from the while loop `if (row > nnz - skip_size) break;` Update: We can use `size_t` for row and skip_size instead. See rapidsai#7517 for a concrete reproducer. Authors: - Anupam (https://github.com/aamijar) Approvers: - Jinsol Park (https://github.com/jinsolp) - Victor Lafargue (https://github.com/viclafargue) URL: rapidsai#7587
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #7517
The
optimize_batch_kernelandoptimize_batch_kernel_reguse the following condition to check for out of boundswhile (row < nnz)Inside the loop
row += skip_sizeis used for iteration. However, when row is close toINT32_MAXit can cause an overflow, which leads to the value of row wrapping around to become a negative number. The loop will then be run again since row < nnz still, which will lead to a cuda illegal memory access since row is negative.To solve this we can check for the overflow case and break from the while loop
if (row > nnz - skip_size) break;Update: We can use
size_tfor row and skip_size instead.See #7517 for a concrete reproducer.