← Back to Pull requests

fix(miopen): drop the gfx950 hard-coded 3D forward kernel rule #16428

Closed
unknown closed this pull request without merging on Nov 20, 2026 20:23 UTC
View on GitHub
unknown unknown commented on Nov 20, 2026 15:00 UTC
Author

JIRA ID : ROCM-34321

Motivation

On gfx950, ConvHipImplicitGemm3DGroupFwdXdlops returns one fixed CK instance as the default kernel for FP16 and BF16 3D forward convolutions with input depth of at least 3 and input width of at least 256 whenever that instance is applicable, ahead of the AI heuristic. Wan VAE layers hit this, and they fail the 3D convolution QA baseline gate on MI350X and MI355X.

The cause is a hard-coded gfx950 rule in HeuristicInit (Step 2, added in #2282). For these problems it returns DeviceGroupedConvFwdMultipleABD_Xdl_CShuffle_V3<256, 256, 256, 32, ..., Intrawave, v3> before the AI heuristic runs. Before CK #10245 that instance was not applicable to the large Wan VAE layers, so the rule never fired there. Since #10245 it is applicable, so the rule fires and the AI heuristic never runs for those layers. The rule has no check on channels, filter size, stride, dilation or groups.

The rule also hides the gfx950 3D forward AI model on every problem it matches, so a retrained model can't fix those problems while the rule is in place.

Technical Details

  • Step 2 in PerformanceConfigHipImplicitGemm3DGroupFwdXdlops::HeuristicInit now runs on gfx942 only. The gfx950 branch is removed. gfx950 FP16 and BF16 problems go from the index override straight to the AI heuristic (Step 3), then the default (Step 4), as FP32 already does.

  • gfx942 is unchanged. MIOPEN_DEBUG_3D_CONV_IMPLICIT_GEMM_HIP_FWD_XDLOPS_HARDCODE keeps working there. Its entry in env_variables.rst and the CHANGELOG line added with #12947 now say the hard-coded picks are gfx942 only. On gfx950 the env var no longer changes anything.

  • On gfx950 the new behavior is the same as develop with MIOPEN_DEBUG_3D_CONV_IMPLICIT_GEMM_HIP_FWD_XDLOPS_HARDCODE=0. It also drops the FillValidKernels call that Step 2 made on every gfx950 FP16 and BF16 heuristic init.

  • Only the default perf config changes. A perf-db record for the solver still takes priority, as before.

  • The inner gfx942 check inside Step 2 is now always true. It is left in place because removing it would reindent the whole gfx942 table with no change in behavior.

  • New test Gfx950NoHardcodedPick in test_perf_config_HipImplicitGemm3DGroupFwdXdlops, one BF16 and one FP16 case. On gfx950 it runs HeuristicInit with the HARDCODE env var on and then off, on problems where the removed rule used to fire (Wan VAE stage 2, stride 2 and dilation 2 in all three dimensions), and expects the same kernel both times. It fails if a gfx950 hard-coded pick behind the HARDCODE env var comes back for these problems, and it does not pin a specific AI pick, so model updates don't break it. It skips on other devices.

  • env_debug.cpp registers the HARDCODE env var so the test can set it. Its contents compile only when tests are built.

  • What could break: gfx950 FP16 and BF16 problems that the rule matched now get the AI pick, which isn't guaranteed to beat the fixed instance on every one of them. Problems where it can trail have been flagged in two classes. One is temporal only 3x1x1 filters, such as a BF16 problem with 256 input and output channels, depth 8 and a 256x256 spatial size. The other, from review, is wide channels with a large width, such as C=1024 and K=512 with an input width of 256 or more. A tuned perf-db record still takes priority where one exists, so only problems without an exact record are exposed. Retuning them is tracked in ALMIOPEN-3450.
  • Test Plan

  • Built develop and develop plus this change for gfx950 and ran both on MI355X.

  • Regression test: built develop plus only the new test and ran it, then added the solver change and ran it again. Also ran the change with the env var preset to 0 and to 1 in the process environment.

  • MIOpenDriver in the default find mode with a fresh user db per run, three repetitions, on the same 16 shapes. Compared the selected kernel and kernel time against develop, against develop with MIOPEN_DEBUG_3D_CONV_IMPLICIT_GEMM_HIP_FWD_XDLOPS_HARDCODE=0, and against a MIOPEN_FIND_ENFORCE=SEARCH tuned run.

  • MIOpenDriver in the same mode on 26 more shapes inside the rule's range: the Wan VAE shapes #2282 was written for, plus other channel counts, pointwise and temporal filters, NDHWC layout, groups, batch and wider inputs. Each was compared against develop and checked with -V 1.

  • The 3D convolution QA baseline gate (16 shapes: Wan VAE stages, same padding, stride 2, dilation 2, temporal 1x3x3 and 3x1x1, grouped, FP16 and FP32 variants, a UNet3D layer and a CogVideo like layer) on develop and with the change, same GPU, fresh user db per run, five interleaved timed repetitions each, plus one logged run each to record kernel picks.

  • gtests on the same GPU, on develop and with the change: test_unit_conv_solver_ConvHipImplicitGemm3DGroupFwdXdlops, test_unit_conv_solver_ConvHipImplicitGemm3DGroupFwdXdlops_LargeStride, test_perf_config_HipImplicitGemm3DGroupFwdXdlops, test_perf_config_group_search_starts_at_kernel_zero, test_group_conv3d_fwd, test_conv_ai_nd_kernel_tuning_utils, test_conv_ai_nd_heuristics_test, test_conv_ai_candidate_selection_model, test_lgbm_pcfg_picker, test_conv_api_solution_count_3d_large_stride, test_unit_ck_impl_loader.

  • check_names.py on the updated test list.
  • Test Result

  • The new test fails on develop for all four problems. The hard-coded instance comes back with the env var on and the AI pick with it off. With the change both tests pass, also with the env var preset either way.

  • QA baseline gate: develop fails every timed repetition on Wan VAE stage 2 in BF16 and FP16. The change passes every timed repetition.

  • On develop the rule fired on four of the 16 gate shapes: Wan VAE stage 2 in BF16 and in FP16, stride 2 in all three dimensions, and dilation 2. With the change all four take the AI heuristic pick.

  • The other 12 shapes pick the same kernel as develop.

  • With the change, every shape picks the same kernel as develop with the env var opt out. Kernel picks were the same in all repetitions.

  • On the wider driver set the rule fired on develop on 22 of the 26 shapes. With the change all 22 take the AI heuristic pick. The other four take the AI heuristic pick on both. All 26 pass -V 1 with the change.

  • All listed gtests pass with the change. On develop they pass with the same counts, except the new test, which fails as described above. check_names.py passes.

  • TheRock PR CI runs the MIOpen gtests on gfx950. On this head both Gfx950NoHardcodedPick cases ran there and passed, along with the rest of the MIOpen gtest shards.

  • Not tested: gfx942 (the change keeps its behavior, checked by reading the code), and MI350X on this exact head.
  • Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: JonathanLichtnerAMD Review duration: 323m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #16428"
    general weight: 0.35
    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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 20.5% · Safe to merge
    20.5%