fix(hipcub): Avoid zero-sized allocation when HMM is enabled#9246
Open
umfranzw wants to merge 1 commit into
Open
fix(hipcub): Avoid zero-sized allocation when HMM is enabled#9246umfranzw wants to merge 1 commit into
umfranzw wants to merge 1 commit into
Conversation
While hipMalloc allows you to allocate buffers of size 0, hipMallocManaged does not. This was causing HipcubDeviceSegmentedRadixSort's SortKeysEmptyData test to fail. This change avoids the zero-sized allocation in the test, and adds a warning message that's printed to stderr whenever we attempt to allocate zero bytes using the hipMallocHelper function.
stanleytsang-amd
approved these changes
Jul 9, 2026
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (76.92%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #9246 +/- ##
========================================
Coverage 64.99% 64.99%
========================================
Files 2685 2685
Lines 422116 422116
Branches 62707 62707
========================================
Hits 274344 274344
Misses 127073 127073
Partials 20699 20699
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
Motivation
While hipMalloc allows you to allocate buffers of size 0, hipMallocManaged does not. This was causing HipcubDeviceSegmentedRadixSort's SortKeysEmptyData test to fail.
JIRA ID: ROCM-27801
Technical Details
This change avoids the zero-sized allocation in the test, and adds a warning message that's printed to stderr whenever we attempt to allocate zero bytes using the hipMallocHelper function.
Test Plan
Export these:
export HSA_XNACK=1export HIPCUB_USE_HMM=1Build the
test_hipcub_device_segmented_radix_sorttarget. Don't forget to enable xnack by appending:xnack+to the GPU target. All tests should pass.Test Result
Everything passes locally.
Submission Checklist