← Back to Pull requests

feat(tensilelite): fused GEMM + all-to-all (GemmA2A) on gfx1250 #16880

Open
unknown opened this pull request with 444 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 27, 2026 15:14 UTC
Author

Motivation


hipBLASLt's fused GEMM + all-to-all (FusedA2A=GemmA2A) runs a matrix multiply on each of up to 8 ranks and, from inside the same kernel, hands each finished block of output to the GPU's copy engine (SDMA), which moves it into the peer's receive buffer and raises a flag there. TensileLite generates this kernel for gfx942 and gfx950 only. This pull request brings it to gfx1250, whose instruction set, copy-command layout, work-group clusters and partitioned devices each need their own handling. It uses the stinkytofu support added in ROCm/rocm-libraries#16863.

JIRA ID : AIHPBLAS-5959

Technical Details


  • Ring, packets and handshake: gfx1250 has no scalar-memory stores or atomics, so reserving queue space, writing copy commands and polling the queue pointers use vector-memory instructions, and every poll carries a cache scope. Copy commands use the gfx1250 layout, which holds the row pitch and width in 16 bits each instead of 19 and 14. Commands are built in one lane from values that are the same in every lane; the second queue-tail command is built in lane 1 inside a narrowed exec mask that closes in the same block, so the scheduler cannot move it into lane 0's commands.

  • Ordering: a barrier pass no longer removes the barrier that makes all waves finish their output stores before the block is handed to the copy engine, and on gfx1250 those stores use device scope instead of work-group scope.

  • Copy-size limits: the predicate that rejects problems whose row pitch or shard width does not fit the copy command now takes the field widths of the solution's architecture. Its serialized value changes from an integer to [MacroTile0, pitch bits, width bits]; the checked-in gfx950 predicate record is regenerated.

  • Clusters: under ClusterDim the work-group reordering runs on whole clusters, so a cluster still covers one aligned block of output, and with ClusterAIDMapping it splits the output between the two halves of the chip. Each band of ClusterDim[1] adjacent token tiles is sent with one copy command.

  • Partitioned devices: the TensileLite client also compares the PCI function when it matches HIP devices to HSA agents, so the second partition of a DPX card no longer opens its copy queues on the first.

  • Temporary dependency: the first commit is the change in ROCm/rocm-libraries#16316 (ClusterAIDMapping=-2 solutions match only devices with 8 XCCs), which the cluster split relies on. @Jinp800125 is working on ClusterAIDMapping, so it may land in another form; this pull request will be rebased on whatever lands.

  • Admission: GemmA2A is accepted on gfx1250, while A2AGemm stays gfx942/gfx950 only. New configurations Tests/common/comm/gfx1250/fused_a2a.yaml and fused_a2a_cluster.yaml. gfx950 output is unchanged apart from one barrier comment.
  • Test Plan


    Characterization tests check the gfx1250 handshake code (poll scopes, the kept barrier, device-scope stores, one command per lane), and that the cluster kernels carry the work-group reordering and keep the cluster barrier before the PUSH/local gate. Unit and C++ tests cover the barrier pass, the copy-size predicate on gfx9 and gfx1250, the admission, and the PCI id matching of the client.

    Test Result


    On the host, the TensileLite unit and characterization suites and tensilelite-tests pass, apart from failures that also occur without these changes in the same environment.

    Submission Checklist


  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
  • Diff: 444 lines (+333 / -111) across 5 files Reviewer: DDEle Review duration: 5430m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 444 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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.365
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #16880"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 45.3% (MEDIUM) · Higher = larger blast radius
    45.3%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 24.2% · Safe to merge
    24.2%