fix(hipblaslt): reject out-of-range batch modes in hipblasLtMatrixLayoutSetAttribute #16291
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
yzhang93
JIRA ID : ROCM-34601
Motivation
hipblasLtMatrixLayoutSetAttribute(HIPBLASLT_MATRIX_LAYOUT_BATCH_MODE)rejects onlya 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-arraypath only when the mode equals
HIPBLASLT_BATCH_MODE_POINTER_ARRAY, so it runs sucha 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
HIPBLAS_STATUS_INVALID_VALUEfor a mode other thanHIPBLASLT_BATCH_MODE_STRIDED,HIPBLASLT_BATCH_MODE_POINTER_ARRAYorHIPBLASLT_BATCH_MODE_GROUPED, and leaves the layout unchanged. Grouped mode isstill accepted only on a grouped layout.
HIPBLASLT_MATRIX_LAYOUT_BATCH_MODEdoc inhipblaslt.hsays that othervalues, and a switch to or from grouped mode, return
HIPBLAS_STATUS_INVALID_VALUE.GroupedMatmul.smoke_AttributeValidationsets 3, 7 and -1 on a regular layout andchecks 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-testwith the groupedlogic files (
TENSILELITE_LOGIC_FILTER='_GG_'):hipblaslt-test --gtest_filter='GroupedMatmul.*';GroupedMatmul.smoke_AttributeValidationagainst the library without the setterchange, and with strided or grouped mode dropped from the allowed modes.
Test Result
those cases), 0 failed.
smoke_AttributeValidationfails: the threeout-of-range modes return
HIPBLAS_STATUS_SUCCESSand 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.
smoke_AttributeValidationpassed on gfx942, gfx950, Windows gfx110X andthe hipBLASLt ASAN lane.
Submission Checklist
https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
Risk level
Low (1/5): only callers that pass a value outside
hipblasLtBatchMode_tsee achange, and they now get
HIPBLAS_STATUS_INVALID_VALUEinstead of a matmul that canaccess wild GPU addresses.