← Back to Pull requests

fix(hipcub): avoid OOM in MergeLargeSizeIterators test on APUs #15674

Closed
unknown closed this pull request without merging on Nov 13, 2026 15:53 UTC
View on GitHub
unknown unknown commented on Nov 12, 2026 19:09 UTC
Author

Motivation

On 30 GB gfx1170 (Medusa) APUs, the out-of-memory killer kills test_hipcub_device_merge, so QA's hipCUB ctest run reports no results (ROCM-34274). Since the CCCL 3.0 port, HipcubDeviceMerge.MergeLargeSizeIterators uses int64_t keys. For the {2^30, 5000} size it holds four buffers of about 8 GiB each at the same time (host inputs, host expected result, device output, host copy of the output), about 32 GiB in total. On an APU the device buffer is also system memory.

JIRA ID : ROCM-34274

Technical Details

  • Removed the host input vectors and the std::merge reference. The inputs are back-to-back counting ranges, so the expected output is just [0, output_size).

  • The output is copied back and checked in chunks of 2^24 elements instead of as one full host copy.

  • Added test_utils_memory_check.hpp, a hipCUB port of rocPRIM's test_utils::MemCheck. The test uses it to skip sizes that don't fit in available memory. On integrated GPUs, device allocations are also checked against available host memory.
  • For the largest size, peak memory drops from about 32 GiB to the 8 GiB device buffer plus temp storage plus 256 MiB of host memory.

    Test Plan

    Verify tests pass without OOM.

    Test Result

    Tests passed on gfx90a plus a simulated APU.

    Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
  • Diff: 176 lines (+132 / -44) across 2 files Reviewer: umfranzw Review duration: 1244m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 176 lines diff across 2 files
    0.35
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.310
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #15674"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 35.4% (MEDIUM) · Higher = larger blast radius
    35.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.0% · Safe to merge
    14.0%