-
Notifications
You must be signed in to change notification settings - Fork 115
Fix find dense columns out of bounds #793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughThe change increases histogram array sizes by one slot (columns: m+1, rows: n+1) in the dual simplex CUDA barrier code and adds runtime assertions to prevent histogram bin index overflow. No public APIs or exported entities were changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@cpp/src/dual_simplex/barrier.cu`:
- Around line 1147-1153: The loop that builds histogram_row accesses
histogram_row[row_nz[k]] before validating the index; move the cuopt_assert that
checks row_nz[k] <= n to immediately before the histogram_row[row_nz[k]]++ line
(in the same loop that iterates k) so the bound is validated prior to the array
access; keep updating max_row_nz and incrementing histogram_row only after the
assertion.
chris-maes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the fix @hlinsen . Apologies for my buggy code.
|
/ok to test 640a33f |
There was a problem hiding this 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cpp/src/dual_simplex/barrier.cu (1)
1147-1164: Fix histogram_row loop bounds to avoid OOB when m > n.
histogram_rowis sizedn + 1, but subsequent loops usek < m. Ifm > n, those loops can access past the end ofhistogram_row.🐛 Proposed fix
`#ifdef` HISTOGRAM - for (i_t k = 0; k < m; k++) { + for (i_t k = 0; k <= n; k++) { if (histogram_row[k] > 0) { settings.log.printf("%6d %6d\n", k, histogram_row[k]); } } `#endif` n_dense_rows = 0; - for (i_t k = 0; k < m; k++) { + for (i_t k = 0; k <= n; k++) { if (histogram_row[k] > .1 * n) { n_dense_rows++; } }
|
/merge |
d72865d
into
NVIDIA:release/26.02
This PR fixes a bug observed on miplib on H100 during concurrent root solve.
The number of nnz in columns can be equal to m.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.