← Back to Pull requests

refactor(hipblaslt): take the fused all-to-all flag regions from the caller #16562

Closed
unknown closed this pull request without merging on Nov 25, 2026 04:18 UTC
View on GitHub
unknown unknown commented on Nov 23, 2026 17:01 UTC
Author

JIRA ID : AIHPBLAS-5721

Motivation


hipblasLtSetDeviceComm made hipBLASLt own peer transport for the fused all-to-all: it allocated each rank's flag region, exchanged the peer addresses through a caller-supplied allgather, enabled peer access, and opened IPC handles (#11940). The caller already owns that transport for the epilogue's receive buffers, the prologue's peer B and gather buffer, and the SDMA queues. RCCL symmetric windows (ncclGetPeerDevicePointer) and rocSHMEM (rocshmem_ptr) now hand out peer addresses directly, so the flag regions can be supplied the same way. Follows #15352.

Closes #11940.

Technical Details


  • hipblasLtSetDeviceComm(handle, rank, world, nChannels, peerFlags) takes a host array of world flag-region addresses in rank order. The library checks that each entry is non-null and aligned to the new HIPBLASLT_DEVICE_COMM_FLAG_ALIGNMENT (64 bytes), and that this rank's own entry is device memory on the handle's device (hipPointerGetAttributes, which accepts fine-grained, uncached and VMM allocations), then records them. It no longer allocates, maps, enables peer access or frees anything, and hipblasLtDeviceCommAllgatherFn is removed.

  • New hipblasLtDeviceCommFlagBytes(nChannels, &bytes) reports the region size the kernels need, so callers do not hard-code it. A static_assert ties the alignment constant to the kernel's flag block layout.

  • The header documents what the caller must guarantee: fine-grained or uncached memory, zero-filled before first use, not written while a collective that uses it is in flight (the kernel zeroes its flags on completion, so a region can be registered again), alive while any handle uses it, and the same world and nChannels on every rank. The library cannot check these, and it no longer detects ranks that disagree; the header warns that a mismatch corrupts memory on the owning GPU rather than returning an error.

  • Callers with several devices in one process must now enable peer access themselves; registration used to do it.

  • The bench (and the multi-process gtest, which uses it) and sample_a2a_sdma allocate fine-grained flag regions and exchange them over the IPC path they already use for receive buffers. The sample sends both handles in its existing exchange, which drops one coordinator round. The allgather-only gtests are replaced by argument checks for caller-supplied regions and by tests for the size query; the prologue fixture from #15352 registers the same way.

  • Everything stays behind HIPBLASLT_ENABLE_GEMM_A2A_FUSION, which has not shipped, so the signature changes without an alias, as #15352 did for the descriptor rename.
  • Test Plan


  • Build with invoke build -c -2 -a gfx950 -f 'gfx950_Cijk_Alik_Bljk_BBS_BH_UserArgs' (plain BF16 TN logic plus both fused logic files) and HIPBLASLT_ENABLE_A2A_SDMA_SAMPLE=ON.

  • hipblaslt-test --gtest_filter='FusedA2A:-multi_gpu' on one GPU.

  • hipblaslt-test --gtest_filter='multi_gpu*' on 8 GPUs: GemmA2A and A2AGemm at world 2 to 8.

  • sample_a2a_sdma at its default 2 processes x 2 ranks, which covers a self peer, a same-process peer on another device, and cross-process peers.

  • clang-format 18.1.4 (the pre-commit pin) on the changed lines.
  • Test Result


    On 8x MI350X (gfx950), ROCm 7.2.1:
  • Single-GPU fused suite: 96 passed, 1 skipped (GroupedMatmulRejectsAFusedDescriptorAfterAPlainLaunch, no grouped MXFP8 solution in the scoped build).

  • Multi-GPU: 14 of 14 passed.

  • Sample: passed, with every rank's receive buffer matching exactly.

  • The RCCL and rocSHMEM routes were not exercised: the installed RCCL 2.27.7 has no ncclGetPeerDevicePointer, and the tests supply the flag regions through HIP IPC.
  • Submission Checklist


  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
  • Risk level


    Low: everything is behind HIPBLASLT_ENABLE_GEMM_A2A_FUSION, which is off by default and has not shipped. A caller of the old signature fails to compile rather than misbehaving.

    Diff: 506 lines (+379 / -127) across 6 files Reviewer: yzhang93 Review duration: 2116m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 506 lines diff across 6 files
    0.48
    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.373
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #16562"
    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: 47.6% (MEDIUM) · Higher = larger blast radius
    47.6%
    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: 18.8% · Safe to merge
    18.8%