fix(hip-kernel-provider): keep conv dgrad AOT plan build and destroy off the device #16591
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 301 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.342
Real PR Conversation Timeline
1 comments
"Review active on #16591"
general
weight: 0.35
BrianHarrisonAMD
Fixes #16569.
hipkernel:Gfx950ConvDgradAot(andGfx1250ConvDgradAot) allocated the implicit-GEMMsub-GEMM tables with
hipMallocand a blockinghipMemcpyat plan build, and released themwith
hipFreeat destroy. When anot stream capture (PyTorch'sdefault), those calls fail ("operation not permitted when stream is capturing") and
invalidate that thread's capture.
Changes
reports theregion, so the workspace grows by 480 B for a 3x3 stride-2 problem).
ConvDgradTableUpload, a small pebuilds alongside theimplicit-GEMM kernels: it takes upvalue kernel argument and
writes them into the workspace.
lnk on the launch streamprepare()ahead of the GEMM; the arguments aost never waits and a
captured graph replays the upload.
refuses an implicit-GEMM instance whose
Plan build and destroy make no hipMallocengine lacks the kernel. Every launch re-uploads, because the caller may reuse its
workspace between launches.
,hipFreeor blocking copy calls for the tables.
DeviceTablesis removed.launch()Limitation
A HIP graph captured from
d, so it keeps restoringthe plan's tables from its by-value kernel arguments on every replay rather than reading
device memory the caller could have me guarantee the kernels
the plan launches already give. Thisrchitecture the pack
serves (
gfx950_conv_dgrad_aot_table_aot_table_upload),built and shipped alongside the exisernels.
Tests
BuildingAPlanKeepsAnotherThre1250): builds and destroys animplicit-GEMM plan while another tture. It fails on develop
TestGfx950ConvDgradDispatch.WorkseachesCodeLoadingwith the allocation error and pass
: the
ACapturedPlanRestoresItsTablesOnE: captures animplicit-GEMM workspace expectation is now the table size instead of 0.
implicit-GEMM execution, poisons two replays, and checks
dX against the CPU reference.
Verified on gfx950 (ROCm 10.2 SDK,
OR=ON-DHIPKERNELPROVIDER_ENABLE_ROCKE=ON| | develop | this PR |
|---|---|---|
| Reproducer from #16569 |
FAIL(ted) |PASS||
hip_kernel_provider_integration_tnvDgrad*| 1 new test fails |173/173 pass |
| `hip_kernel_provider_tests --gtest pass, 2 skipped (gfx1250) |
JIRA ID: AICK-2562
🤖 Generated with [Claude Code](http