← Back to Pull requests

feat(hipblaslt): run PartitionedGemm and --split-devices tests on two gfx950 GPUs #16725

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Nov 25, 2026 16:35 UTC
Author

JIRA ID : AIHPBLAS-5661

Motivation

A split GEMM divides one matrix multiplication into slices that run at the same time on two HIP devices: the two partitions of a GPU in DPX mode, or two separate GPUs. hipBLASLt offers it through the experimental PartitionedGemm class, and its kernel generator, TensileLite, benchmarks it with tensilelite-client --split-devices. No automated check ran either on two devices: the TensileLite split configs need a gfx1250 in DPX mode, which no CI runner has, and PartitionedGemm refused every architecture except gfx1250, so on a two-GPU gfx950 machine 26 of its 27 tests skip.

This PR runs both on the two-GPU gfx950 node of Math CI, AMD's internal Jenkins CI that posts the mci/... checks. Getting the split runs to pass there took two fixes to the TensileLite client.

Related: #15976 added PartitionedGemm, and #16403 moved it into the experimental tier at revision 1. #16104 and #16186 added the 256-byte slice alignment and the shared placements that the new configs exercise; AIHPBLAS-5661 lists the follow-ups from #16186's review. #16404 added the client join that the first fix replaces. AIHPBLAS-5609 has the gfx1250 measurements of the free-run write, and AIHPBLAS-5704 tracks the experimental tier.

Technical Details

TensileLite client (tensilelite/client/main.cpp; the benchmark tool only, not the library)

  • Joined runs work on ROCm 7.2. After every launch a split run makes each device wait for the other, called the join. Since #16404 the join used one hipStreamBatchMemOp per stream, a beta API that ROCm 7.2.4 rejects with hipErrorInvalidValue, so every joined run failed at its first launch. Each stream now writes its own counter with hipStreamWriteValue64 and waits on the other's with hipStreamWaitValue64, as hipblaslt-bench --partitions does.

  • A shared D, one output matrix that both devices write, is cleared before any launch. The client zeroed it with hipMemset on its owning device, but nothing ordered the other device's writes after that; in 2 of 120 free-run runs on develop the second slice read back as zeros. The owning device is now synchronized after the clear.

  • --split-free-run, which skips the join, no longer adds a stream write after each launch, so its times no longer include one. AIHPBLAS-5661 asked for this if no test needs the write. None does: nothing reads another device's D between free-run launches, and validation reads each slice only after a blocking copy on the device that wrote it.
  • TensileLite tests (Tests/common/comm/gfx950/)

    Five configs split a BF16 GEMM over two gfx950 GPUs: M split with B shared, N split with A shared, M and N split with D shared, and M split with D shared under --split-free-run. A sixth splits an MXFP4 GEMM (4-bit floats with per-block scales) along M with B and its scales shared; it turns off MXDataGenerator, which would give both devices the same data and hide a broken redirect. Odd sizes check the slice alignment: the share of M = 51301 is rounded to a 256-byte boundary, and the shares of M = 1001 and N = 301 are not. --output-peerD is left out because gfx950 has no kernels for it; TensileLite's Known Risks table now says that its only config, under dpx/gfx1250, runs in no CI lane. The configs validate after timed launches, so each is added to the SyncsPerBenchmark opt-out list in test_common_yaml_syncs_per_benchmark.py.

    PartitionedGemm on gfx950: PARTITIONED_GEMM revision 2

    setProblem accepts gfx950 as well as gfx1250. The declarations are unchanged, but the contract tests changed (under the experimental-API policy, any change to them raises the revision), so the revision goes from 1 to 2 and code that checks for 1 must check for 2. Without a DPX GPU, the partitioned_gemm_ext__multi_gpu tests use two GPUs with peer access (devicePair()), and two tests that assumed devices 0 and 1 now use the pair's devices.

  • A new contract test, StorePeerDRefusesKernelsWithoutThePeerStore, checks that a storePeerD problem never runs a kernel without the second store, which would leave the peer D unwritten: the heuristic leaves it out, and isAlgoSupported and initialize refuse it.

  • The sample falls back to separate writes and waits when hipStreamBatchMemOp is refused. Stream capture does not record those on ROCm 7.2, so the fallback fails instead of capturing a graph without its join.

  • The CHANGELOG lists the experimental tier and PARTITIONED_GEMM under ROCm 10.3.0, at revision 2. #16403 had put them under 10.1.0, but the tier is introduced in 10.3.

  • The API reference and both TESTING.md files describe gfx950 support.
  • Each commit covers one topic: client fixes, free-run write, configs, SyncsPerBenchmark opt-outs, PartitionedGemm on gfx950, the storePeerD contract test, the sample's capture check, CHANGELOG.

    Test Plan

    On two of a node's eight gfx950 GPUs (HIP_VISIBLE_DEVICES=0,1), ROCm 7.2.4. The hipBLASLt device library was built from fp16 TN and NN logic (-f '_Bljk_HHS_BH'), once without --gemm-a2a-fusion and once with it, as AIHPBLAS-5661 says the two-GPU node builds.

  • tox -e comm in tensilelite/ (the two-GPU node's command) and tox -e unit.

  • The two free-run configs with a shared D, 60 runs per split, with develop's client and this branch's.

  • hipblaslt-test --gtest_filter='partitioned_gemm:ExperimentalApi' on two GPUs and on one, for develop and this branch, with and without --gemm-a2a-fusion.

  • Mutation checks, temporary source edits a good test should catch: partition 1's launch removed from PartitionedGemm::run(); setPeerD removed from PartitionedGemm::setProblem(); the MXFP4 reference without its redirect of the shared scales; the per-solution listeners in reverse order.

  • sample_hipblaslt_gemm_partitioned_ext (2, 2 shared, 1) and hipblaslt-bench --partitions 2 --verify_strict (7 runs), on both builds; check_experimental_api.py --base origin/develop; pytest tools/scripts/tests.
  • Test Result

  • tox -e comm: 8 passed (the 6 new configs and the 2 fused all-to-all configs at world size 2), 4 skipped (world sizes 4 and 8). develop's client fails the 5 joined configs: all 40 launches return hipErrorInvalidValue.

  • tox -e unit: 19,350 passed. 4 failed, all in test_client_identity_build.py, because the test machine has no ninja; Math CI's preliminary ran them and they passed.

  • Free-run with a shared D, 120 runs: develop 118 passed, this branch 120. Without the free-run write: 120 of 120.

  • MXFP4: without the redirect, 8 of 8 validations fail; with the listeners reversed, 8 of 8 pass.

  • hipblaslt-test, two GPUs: 30 passed, 1 skipped (NotSupportedOnOtherArchitectures, which runs only on other architectures); on develop, 4 passed and 26 skipped. One GPU: 25 passed, 6 skipped. --gemm-a2a-fusion gives the same counts.

  • With partition 1's launch removed, 10 of the 12 multi-GPU tests fail; the other 2 check argument errors. With setPeerD removed, the new contract test fails all three of its checks.

  • The sample and all 7 bench runs pass on both builds. The checker reports revision 1 to 2 and passes; tools/scripts/tests: 92 passed.

  • Math CI preliminary, two-GPU node: the 6 split configs passed, none skipped. With the 2 fused all-to-all configs, 8 passed and 4 skipped (world sizes 4 and 8). Run on 46a8c94bea5.

  • Math CI precheckin, two-GPU node: the 12 partitioned_gemm_ext_*_multi_gpu tests passed, none skipped; the stage's 12 skips are fused all-to-all tests for 3 to 8 GPUs. Run on 46a8c94bea5.
  • Nothing ran on gfx1250, which has no hardware here; apart from the revision number, PartitionedGemm on gfx1250 is unchanged. On gfx950 the contract tests ran in TheRock's gfx950-dcgpu job: 12 passed, and NotSupportedOnOtherArchitectures skipped. On every other architecture only NotSupportedOnOtherArchitectures runs.

    CI labels: none chosen. The labeler adds ci:hipsparselt-fast to every TensileLite change; hipSPARSELt cannot reach this diff. ci:no-downstream-test does not apply because library code changes, and ci:run-multi-gpu adds no hipBLASLt job.

    Submission Checklist

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

    Medium (3/5). Library behavior changes only for PartitionedGemm on gfx950, which now runs instead of returning HIPBLAS_STATUS_NOT_SUPPORTED; gfx1250 and the stable API are unchanged. Callers see the revision bump: a program written for revision 1 falls back, or stops as the sample does, until it checks for 2. PARTITIONED_GEMM first ships in ROCm 10.3, so only code built against develop has seen revision 1. The client changes affect only --split-devices runs.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: yzhang93 Review duration: 7648m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    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.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #16725"
    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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 27.7% · Safe to merge
    27.7%