← Back to Pull requests

fix(hipccl): use hipStreamWaitValue64 to block streams in caching allocator test #13997

Closed
unknown closed this pull request without merging on Nov 13, 2026 18:41 UTC
View on GitHub
unknown unknown commented on Oct 20, 2026 13:51 UTC
Author

Motivation

hipcubCachingDeviceAllocatorTests.Test1 hangs on Windows (PAL backend, observed on gfx1151) in Debug builds.
The test kept streams busy with a kernel that spins until the host writes a flag. At -O0 that kernel uses scratch, so the first launch on other_stream makes the runtime set up scratch for the new queue, which waits for all queues to go idle. Stream 0 never goes idle because its spinning kernels are waiting for the host, so hipLaunchKernel never returns. Release builds pass because the kernel needs no scratch.

Jira ID: ROCM-31867

Technical Details

Replace the spinning kernel with hipStreamWaitValue32 on a flag in signal memory, released by an atomic store from the host:

  • No kernel runs while a stream is blocked, so no scratch is needed and the runtime is aware of the dependency.

  • Allocate the blockers before any stream is blocked, so the allocation cannot synchronize with a blocked stream.

  • Release the stream in the destructor so a failed assertion cannot hang cleanup.

  • Skip the test if hipDeviceAttributeCanUseStreamWaitValue is not set.

  • Create other_stream as non-blocking, since the test does not depend on implicit synchronization with the null stream.
  • Test Plan

    Build and run the test on Linux and Windows, on systems with APUs and discrete GPUs.

    Test Result

    All manually run tests pass.

    Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
  • Diff: 191 lines (+143 / -48) across 2 files Reviewer: amd-hsong Review duration: 34850m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 191 lines diff across 2 files
    0.36
    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.315
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #13997"
    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.9% (MEDIUM) · Higher = larger blast radius
    35.9%
    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.2% · Safe to merge
    14.2%