Skip to content

fix(hipstdpar): fix zero size hipMemAdvice() issue - #12110

Merged
amd-jmahovsky merged 2 commits into
developfrom
users/jmahovsk/hipstdpar-interpose-alloc
Sep 16, 2026
Merged

amd-jmahovsky merged 2 commits into
developfrom
users/jmahovsk/hipstdpar-interpose-alloc

Conversation

@amd-jmahovsky

@amd-jmahovsky amd-jmahovsky commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Fixes a process abort when any zero-size allocation (operator new(0), new T[0], malloc(0), an empty std::vector/container triggering a 0-byte allocator call, etc.) when compiling with --hipstdpar --hipstdpar-interpose-alloc.

JIRA ID: ROCM-30883

Technical Details

Don't call hipMemAdvise() in __hipstdpar_aligned_alloc() if the allocation is zero size.

Test Plan

The unit tests and ticket reproducer all pass. A new test was also added to test zero-size allocations.

Test Result

Tests pass.

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@codecov

codecov Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12110      +/-   ##
===========================================
- Coverage    70.27%   69.95%   -0.33%     
===========================================
  Files         2812     2833      +21     
  Lines       462318   463790    +1472     
  Branches     68085    68381     +296     
===========================================
- Hits        324891   324410     -481     
- Misses      113896   116050    +2154     
+ Partials     23531    23330     -201     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 38.39% <ø> (-8.01%) ⬇️ Carriedforward from 0096f8c
TensileLite-Unit 76.40% <ø> (+0.30%) ⬆️ Carriedforward from 0096f8c
hipBLAS 90.62% <ø> (ø) Carriedforward from 0096f8c
hipBLASLt 35.22% <ø> (-0.03%) ⬇️ Carriedforward from 0096f8c
hipCUB 82.68% <ø> (ø) Carriedforward from 0096f8c
hipDNN 87.12% <ø> (+0.11%) ⬆️ Carriedforward from 0096f8c
hipFFT 43.43% <ø> (+0.73%) ⬆️ Carriedforward from 0096f8c
hipRAND 76.12% <ø> (ø) Carriedforward from 0096f8c
hipSOLVER 69.03% <ø> (+0.11%) ⬆️ Carriedforward from 0096f8c
hipSPARSE 86.99% <ø> (ø) Carriedforward from 0096f8c
rocBLAS 48.25% <ø> (-0.06%) ⬇️ Carriedforward from 0096f8c
rocFFT 51.21% <ø> (+3.79%) ⬆️ Carriedforward from 0096f8c
rocRAND 57.04% <ø> (-0.39%) ⬇️ Carriedforward from 0096f8c
rocSOLVER 77.32% <ø> (+0.49%) ⬆️ Carriedforward from 0096f8c
rocSPARSE 74.59% <ø> (-0.02%) ⬇️ Carriedforward from 0096f8c
rocThrust 93.16% <ø> (+1.56%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.
see 677 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amd-hsong amd-hsong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LTGM.

@amd-jmahovsky
amd-jmahovsky merged commit 8d8cf32 into develop Sep 16, 2026
107 of 108 checks passed
@amd-jmahovsky
amd-jmahovsky deleted the users/jmahovsk/hipstdpar-interpose-alloc branch September 16, 2026 20:58
assistant-librarian Bot pushed a commit to ROCm/rocThrust that referenced this pull request Sep 16, 2026
fix(hipstdpar): fix zero size hipMemAdvice() issue

## Motivation

Fixes a process abort when any zero-size allocation (operator new(0),
new T[0], malloc(0), an empty std::vector/container triggering a 0-byte
allocator call, etc.) when compiling with --hipstdpar
--hipstdpar-interpose-alloc.

JIRA ID: ROCM-30883

## Technical Details

Don't call hipMemAdvise() in __hipstdpar_aligned_alloc() if the
allocation is zero size.

## Test Plan

The unit tests and ticket reproducer all pass. A new test was also added
to test zero-size allocations.

## Test Result

Tests pass.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
@assistant-librarian

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

stanleytsang-amd pushed a commit that referenced this pull request Oct 2, 2026
## Motivation

Fixes a process abort when any zero-size allocation (operator new(0),
new T[0], malloc(0), an empty std::vector/container triggering a 0-byte
allocator call, etc.) when compiling with --hipstdpar
--hipstdpar-interpose-alloc.

JIRA ID: ROCM-30883

## Technical Details

Don't call hipMemAdvise() in __hipstdpar_aligned_alloc() if the
allocation is zero size.

## Test Plan

The unit tests and ticket reproducer all pass. A new test was also added
to test zero-size allocations.

## Test Result

Tests pass.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
Naraenda pushed a commit that referenced this pull request Oct 5, 2026
## Motivation

Fixes a process abort when any zero-size allocation (operator new(0),
new T[0], malloc(0), an empty std::vector/container triggering a 0-byte
allocator call, etc.) when compiling with --hipstdpar
--hipstdpar-interpose-alloc.

JIRA ID: ROCM-30883

## Technical Details

Don't call hipMemAdvise() in __hipstdpar_aligned_alloc() if the
allocation is zero size.

## Test Plan

The unit tests and ticket reproducer all pass. A new test was also added
to test zero-size allocations.

## Test Result

Tests pass.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
Naraenda pushed a commit that referenced this pull request Oct 7, 2026
## Motivation

Fixes a process abort when any zero-size allocation (operator new(0),
new T[0], malloc(0), an empty std::vector/container triggering a 0-byte
allocator call, etc.) when compiling with --hipstdpar
--hipstdpar-interpose-alloc.

JIRA ID: ROCM-30883

## Technical Details

Don't call hipMemAdvise() in __hipstdpar_aligned_alloc() if the
allocation is zero size.

## Test Plan

The unit tests and ticket reproducer all pass. A new test was also added
to test zero-size allocations.

## Test Result

Tests pass.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants