feat(hip-kernel-provider): ASM SDPA forward mma_core_mode follows correct semantics #16141
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 592 lines diff across 7 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.382
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16141"
general
weight: 0.35
BrianHarrisonAMD
Summary
The ASM SDPA forward engine declined every fp8 graph that set
mma_core_mode, including theFP8_E4M3that cuDNN'ssdpa_fp8()writes. In cuDNN the mode names the matrix-multiply (MMA) path, not the element type. The engine now acceptsFP8_E4M3andFP8_E5M2on itsFP8_E4M3_FNUZinputs; bf16 behavior is unchanged.JIRA ID : ALMIOPEN-2765
Risk Assessment
3/5. One engine's applicability check changes. No kernel, launch or default changes, and no graph that was accepted before now declines. Three facts keep it above 2:
FP8_E4M3_FNUZinputs now reach the gfx942 fp8 kernel that ALMIOPEN-3125 reports gives wrong output. Graphs withUNSETalready reached it. No in-tree producer sets an FP8 mode on FNUZ inputs.Reviewer sign-off requested. On bf16 graphs the engine accepts
BFLOAT16as an equivalent ofHALF; cuDNN rejects it (include/cudnn_frontend/node/sdpa_support_surface.h, cudnn-frontendv1.24.0). The behavior comes from #14518 and this PR keeps it. TheKNOWN_DIVERGENCES.mdentry is deferred to the hipDNN-levelmma_core_modevalidation ticket.ASIC Coverage
Arch-scoped. The ASM engine has kernels for gfx942 and gfx950 only, and fp8 forward kernels for gfx942 only. gfx942 passed locally, and PR CI tests gfx94X. gfx950 needs one run before merge: PR CI builds gfx950 but does not test it, so this PR carries
ci:gfx950, which adds gfx950 to both build and test. No RDNA or full sweep is needed, because no bundle changes and the engine has no kernels for other families.Testing Summary
DataTypevalue asmma_core_modetoisApplicableand assert accept or decline, one test per input type.ASM_SDPA_ENGINEwith support claims enforced. Saved expected results were not pulled, so the GPU reference checked every compared output.Testing Checklist
build/bin/hip_kernel_provider_tests --gtest_filter='TestSdpaFwdPlanBuilder.*'- Devices: gfx942 (MI300A) - Status: Passed (45 passed, 0 skipped)ctest --test-dir build/dnn-providers/hip-kernel-provider/src -R '^hip-kernel-provider-asm-sdpa-external-integration_(quick|standard)_suite$' -V- Devices: gfx942 (MI300A) - Status: Passed (quick: 76 passed, 144 skipped, 0 failed; standard: 287 passed, 1204 skipped, 0 failed; 0 broken claims)python3 projects/hipdnn/tools/ai/skills/hipdnn-tidy/scripts/tidy_changed.py --build-dir build --base origin/develop- Status: Passedpre-commit run --files <the two changed files>- Status: Passedci:gfx950- ASICs: gfx950 - Status: PendingTechnical Changes
SdpaFwdPlanBuilder::isApplicablechecksmma_core_modeagainst an allow-list keyed by input type. Any mode not listed declines, including enum values added later.| Inputs | Accepted modes |
|---|---|
| bf16 |
UNSET,HALF,BFLOAT16(unchanged) ||
FP8_E4M3_FNUZ|UNSET,FP8_E4M3(new),FP8_E5M2(new) |v1.24.0sendsFP8_E4M3andFP8_E5M2down one FP8 path and casts the softmax output to Q's type. The gfx942 kernels compute in E4M3 FNUZ only, which the existing input-type check enforces.mma_core_mode must be UNSET, or HALF or BFLOAT16 for bf16 inputs, or FP8_E4M3 or FP8_E5M2 for FP8_E4M3_FNUZ inputs (Actual value: …, inputs: …).IsApplicableBf16MmaCoreModePolicy(gfx942, gfx950) andIsApplicableFp8MmaCoreModePolicy(gfx942) replace the mode rows ofIsApplicableSdpaVariationsand the testIsApplicableRejectsFp8WithHalfMmaCoreMode.projects/hipdnnare unchanged. The bundles keep"unset", which every SDPA forward engine accepts.Not in this PR:
generate_sdpa_runtime_scale_test_bundle.pyhas no test.bind_shared.pyvalue_rejectsdeclinesHALFon bf16 requests.Types.hppcomment onFP8_E4M3says it has no hipDNN backend mapping, buttoHipdnnDataTypemaps it.mma_core_modein the frontendvalidate()or the backendfinalize().