← Back to Pull requests

feat(hipblaslt): epilogue, scales, aux, amaxD and MX in PartitionedGemm #17079

Closed
unknown closed this pull request without merging on Dec 02, 2026 18:04 UTC
View on GitHub
unknown unknown commented on Dec 01, 2026 20:37 UTC
Author

Motivation

hipblaslt_experimental::PartitionedGemm runs a plain GEMM only: setProblem refuses bias, scale, aux and amaxD pointers, always uses an empty epilogue, and refuses MX and sub-byte types. The ordinary hipblaslt_ext::Gemm supports all of these, so a framework cannot yet run its real layers as a split GEMM.

JIRA ID : AIHPBLAS-6003

Technical Details

A PartitionedGemm is still N ordinary Gemm objects, one per partition. This change passes the rest of the problem through and gives each partition its slice of every extra input.

  • API: new setProblem overload that takes a hipblaslt_ext::GemmEpilogue. The existing overload is unchanged in signature and forwards with a default epilogue. The feature revision stays 1 (check_experimental_api.py: added method).

  • Bias, scaleAlphaVec, vector scaleA / scaleB: offset by the slice when the split cuts the dimension they run along, passed whole otherwise. Scalar scales pass through.

  • Aux: indexed and sliced like D; each partition gets the full-problem leading dimension and stride.

  • amaxD: one pointer per partition. Each partition writes the amax of its own slice and the caller takes the max; the library does no cross-device reduction. A repeated pointer returns HIPBLAS_STATUS_INVALID_VALUE.

  • Bias gradient: allowed only for a split along the gradient's own dimension (M, or N for BGRADB); any other split would leave each partition a partial sum.

  • MX scale tensors: handled like the matrices, pointer plus slice offset. Blocks run along K, which is never split. A split that cuts the scale rows (M for A, N for B) needs K innermost and batch_count 1, because otherwise the slice's strides differ from the whole tensor's.

  • fp4 / fp6: element sizes are now in bits and every slice starts on a whole byte.

  • Outputs on another device (aux, bias gradient, amaxD) are published like D.

  • Still NOT_SUPPORTED: scale-aux (as in Gemm), BLK32_UE8M0_128_4 cut along its rows, the gfx950 32x8 layout, int4 group scales, device user arguments.

  • Clients: hipblaslt-bench --partitions runs these cases and gathers D, aux, bias gradient and amaxD before the existing check. Header doc, experimental-api.rst and CHANGELOG updated, including what each partition reads so a caller can give it a local copy of just that range.
  • Test Plan

  • hipblaslt-test --gtest_filter='pre_checkin_partitioned_gemm_ext.:pre_checkin_partitioned_gemm_contract.'

  • hipblaslt-test --gtest_filter='partitioned_gemm_ext_epilogue_multi_gpu' (new: each input for M, N and Batch splits against the unsplit Gemm)

  • hipblaslt-test --gtest_filter='partitioned_gemm_ext*'

  • hipblaslt-bench -f matmul -r f16_r -m 1024 -n 1024 -k 1024 --transA T --transB N --partitions 2 --split_dim M -v, plain and with --bias_vector --activation_type relu
  • Test Result

    One gfx1250 GPU in SPX mode (both partitions on one device), device library built from the gfx1250 fp16 and MX logic only:

  • Existing single-device and contract tests: 17 passed, 0 failed, 1 skipped (NotSupportedOffGfx1250, expected on gfx1250).

  • New tests: 19 passed, 0 failed, 12 skipped. Passed: bias (M, N, Batch, shared), ReLU, DGELU, DGELU with bias gradient, BGRADB, alpha vector (M, N, Batch), MXFP8 (M, N, Batch; shared and per-partition scales), MXFP4.

  • All partitioned tests: 32 passed, 0 failed, 17 skipped.

  • Bench runs: exit 0, verification within tolerance.
  • Not yet run:

  • GELU with aux, scalar scales, vector scales and amaxD: skipped with "no algorithm", the test device library had no kernel for them.

  • Cross-partition access on a DPX box: 5 tests skipped for needing two partitions.
  • Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
  • Diff: 480 lines (+360 / -120) across 6 files Reviewer: yzhang93 Review duration: 1286m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 480 lines diff across 6 files
    0.47
    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.369
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #17079"
    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.3% (MEDIUM) · Higher = larger blast radius
    47.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: 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.7% · Safe to merge
    18.7%