← Back to Pull requests

fix(hipblaslt): reject out-of-range batch modes in hipblasLtMatrixLayoutSetAttribute #16291

Closed
unknown closed this pull request without merging on Nov 20, 2026 11:26 UTC
View on GitHub
unknown unknown commented on Nov 19, 2026 00:58 UTC
Author

JIRA ID : ROCM-34601

Motivation

hipblasLtMatrixLayoutSetAttribute(HIPBLASLT_MATRIX_LAYOUT_BATCH_MODE) rejects only
a switch to or from grouped mode. On a regular layout it stores any int32 (3, 7, -1)
and returns HIPBLAS_STATUS_SUCCESS. The main GEMM kernel takes the pointer-array
path only when the mode equals HIPBLASLT_BATCH_MODE_POINTER_ARRAY, so it runs such
a layout as strided. With GlobalSplitU (GSU, the split-K reduction), an
output-conversion kernel writes D after the main kernel. It gets the raw mode and
reads any nonzero mode as pointer arrays, so it dereferences plain C and D buffers
as arrays of pointers.

Technical Details

  • The setter returns HIPBLAS_STATUS_INVALID_VALUE for a mode other than

  • HIPBLASLT_BATCH_MODE_STRIDED, HIPBLASLT_BATCH_MODE_POINTER_ARRAY or
    HIPBLASLT_BATCH_MODE_GROUPED, and leaves the layout unchanged. Grouped mode is
    still accepted only on a grouped layout.
  • The HIPBLASLT_MATRIX_LAYOUT_BATCH_MODE doc in hipblaslt.h says that other

  • values, and a switch to or from grouped mode, return HIPBLAS_STATUS_INVALID_VALUE.
  • GroupedMatmul.smoke_AttributeValidation sets 3, 7 and -1 on a regular layout and

  • checks that the mode reads back as strided. It also checks that each valid mode is
    still accepted: strided and pointer-array on a regular layout, grouped on a grouped
    layout.

    Test Plan

    On gfx950 (MI350X, ROCm 7.2.1), Release build of hipblaslt-test with the grouped
    logic files (TENSILELITE_LOGIC_FILTER='_GG_'):

  • hipblaslt-test --gtest_filter='GroupedMatmul.*';

  • GroupedMatmul.smoke_AttributeValidation against the library without the setter

  • change, and with strided or grouped mode dropped from the allowed modes.

    Test Result

  • Grouped gtests: 21 passed, 8 skipped (no gfx950 kernel in the loaded library for

  • those cases), 0 failed.
  • Without the setter change, smoke_AttributeValidation fails: the three

  • out-of-range modes return HIPBLAS_STATUS_SUCCESS and the mode reads back as -1.
    With strided or grouped mode dropped from the allowed modes, it fails at the check
    that sets that mode.
  • In CI, smoke_AttributeValidation passed on gfx942, gfx950, Windows gfx110X and

  • the hipBLASLt ASAN lane.

    Submission Checklist

  • Look over the contributing guidelines at

  • https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.

    Risk level

    Low (1/5): only callers that pass a value outside hipblasLtBatchMode_t see a
    change, and they now get HIPBLAS_STATUS_INVALID_VALUE instead of a matmul that can
    access wild GPU addresses.

    Diff: 319 lines (+239 / -80) across 3 files Reviewer: yzhang93 Review duration: 2068m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 319 lines diff across 3 files
    0.40
    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%
    56%
    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.345
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #16291"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 40.4% (MEDIUM) · Higher = larger blast radius
    40.4%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 17.5% · Safe to merge
    17.5%