Repository navigation
[HIP] [FlyDSL] Add gfx1250 implicit-GEMM conv3d - #6662
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
Host pre-pads to NDHWC with C/groups aligned to 32; A uses rank-3 TDM boxes (optional kH×kW patch reuse), B uses 2D TDM tiles, and compute is WMMA 16x16x32 bf16. Wire flydsl_conv_implicit to the new backend and extend the op_test keyword surface for gfx1250 tiles and tail blocks. Co-authored-by: Cursor <[email protected]>
84a5e4c to
f18f160
Compare
Extend the MVP TDM+WMMA path with 64-bit stores, fp32 atomic split-K, variable-resolution extents, gfx1250 tile policy, tuned-table lookup (block_rows), and AOT dispatch; ship a small smoke tuned CSV. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Resolve conflicts with #6421 (gfx950 kW / kH x kW LDS reuse), which also added a block_rows field to the conv3d tuned table: - Use main's tuned-CSV column block_r (TUNED_BLOCK_ROWS_COLUMN, _parse_block_rows) for gfx1250 as well, drop TUNED_OPTIONAL_RESULT_COLUMNS, and rename the gfx1250 tuned CSV header from block_rows to block_r. With two column names the config merge zero-fills the other arch's column, and AOT parse_csv let block_r's default override the gfx1250 value. - conv3d_tune.py: gfx950 keeps main's per-tile block_rows sweep; gfx1250 keeps its policy, which already returns block_rows. Both use main's task tuple order and write block_r. - _conv3d_impl takes both block_rows and patch_reuse; keep the new op test cases from both sides. Co-authored-by: Cursor <[email protected]>
…e strict Blocks of 8 or 16 waves return wrong results on gfx1250: re-running the 38 shipped 8/16-wave winners gave wrong elements on 35 of them, a different subset on every run, while the same shapes are exact with 4-wave tiles. Until the kernel is fixed, MAX_WAVES = 4 rejects such tiles in validate_launch_config_gfx1250, the tuned-table lookup ignores them with a one-time warning, and the heuristic ladder and DEFAULT_TILE drop to 2x2 waves. The tuner now scores candidates with strict_compare (1.0 on any element outside tolerance): mp_tuner rounds the error ratio to 4 decimals, which let thousands of wrong elements pass as errRatio=0. Borrowed candidates must also be legal gfx1250 tiles. The op test maps the gfx950-sized pinned tiles to the widest legal gfx1250 tiles, and the tuner README documents the strict gate. The tuned CSVs are re-tuned under the cap in a follow-up commit. Co-authored-by: Cursor <[email protected]>
…wave cap The tap main loop issued the next tile's TDM before the barrier, into the buffer other waves were still reading (WAR race with num_buffers=2). That is why 8/16-wave blocks returned a different set of wrong elements on every run. Replace both bodies with one pipeline that mirrors compile_gemm_a16w16: prologue of B-1 TDM tiles, an scf.for main loop carrying accumulators and register-prefetched fragments, tensor_wait((B-2)*2), a drain, and sched_barrier(0) before the epilogue when B>2. num_buffers (2..8), variant (bandwidth_bound / compute_bound) and main_loop_unroll are now real knobs, passed through run_conv3d_gfx1250 and clamped to the LDS / K-tile budget. _body is @flyc.jit so the AST rewriter lowers the yield-carrying loop; as a plain helper it is a Python generator and the kernel traces empty. The kH x kW patch-reuse body is removed for now (patch_reuse is accepted and ignored on gfx1250), MAX_WAVES goes back to 16, the heuristic ladder regains a 2x4-wave tile, and the op test runs the pinned tiles unmapped. Verified on gfx1250 against an fp32 CPU reference, zero elements outside rtol=atol=2e-2, 3 runs per config: Wan2.1 down_0_1 @368x544, all 918 policy configs; and all 76 shapes of both gfx1250 tuned CSVs, 20313 configs (CSV tile plus 24 policy tiles x num_buffers 2/3/4 x 3 variants, including 8/16-wave, split-K 2/4 and dyn_hw on/off). Co-authored-by: Cursor <[email protected]>
…peline Re-tune both gfx1250 tables (Qwen-Image VAE, Wan2.1 VAE) against the pipeline from 01509cf. Every candidate the tuner enumerates for the 76 shapes (7444 configs, including 2164 8-wave and 689 16-wave) ran 10 times against an fp32 CPU reference, each output NaN-filled before it was freed: zero elements outside rtol=atol=2e-2, no NaNs, no hangs. Per shape, the 5 fastest passing configs by CUDA-event screening plus the previously committed tile were re-timed with run_perftest, the tuner's own measurement (conv3d_tune agrees with it to within 1% on two rows). Against the previously committed tiles on the new pipeline, the winners are 5.5% (Qwen-Image) and 9.0% (Wan2.1) faster in sum; 8-wave tiles win 19/32 and 17/44 rows, and one Wan2.1 row takes a 16-wave tile. The us column is high in absolute terms: the card measured the same kernels 1.0-2.6x slower than it did on 2026-10-21 (same harness, same toolchain), so the ranking holds but the times do not compare with the previous table. Co-authored-by: Cursor <[email protected]>
The runtime turned dyn_hw off when (K / groups) % tile_n != 0 after calling _dyn_hw_ok_gfx1250, but AOT only called the helper. On the K=3 output convs of both tuned tables (Qwen-Image 1024^2, Wan2.1 482x834) AOT therefore built a dyn_hw kernel the runtime never requests: those rows raise under FLYDSL_RUNTIME_RUN_ONLY=1 and JIT on first call otherwise. Move the rule into _dyn_hw_ok_gfx1250 so both sides use it. Co-authored-by: Cursor <[email protected]>
gfx1250 dyn_hw launchers still close over the full param, geometry and launch args, and FlyDSL keys a launch on its closure scalars, so every resolution and batch size is its own artifact. Deduping dyn_hw jobs across N/D/H/W left 4 of the 76 tuned rows without one (Qwen-Image 1328^2 rows 16 and 30, Wan2.1 N=4 rows 25 and 40). Key gfx1250 dyn_hw jobs on the whole row until the launcher is shape-agnostic. Co-authored-by: Cursor <[email protected]>
…il gate The 32x32 input under a 2x2x2 filter with no padding gives Ho = Wo = 31, so npq = 2883 is not a multiple of tile_m = 64 and the explicit splitk=2 hit the split-K tail assertion on gfx950 (and the 2D block tail check on gfx1250). Use a 33x33 input so Ho = Wo = 32 and the tile divides the problem. Co-authored-by: Cursor <[email protected]>
On gfx1250 the tuner timed flydsl_conv_implicit on raw operands, so every timed call also paid run_conv3d_gfx1250's host-side zeros pad, channel pad to a multiple of 32 and weight pack. The weight pack is memoized, but run_perftest rotates weight copies, so it missed on every iteration while a deployed layer pays it once. The GEMM and MoE tuners hand their timed call ready-made (quantized, shuffled, sorted) operands instead. Add prepare_operands_gfx1250, which runs those three steps once with the dispatcher's own helpers, and an optional packed_weight argument to run_conv3d_gfx1250 that skips the pack. gfx1250 tuner tasks now generate the prepared operands in generate_data_gfx1250 and time run_conv3d_gfx1250 on them with padding=0; the reference still uses the raw operands. gfx950 is unchanged. The kernel param is unchanged: for all 7440 candidates of the 76 tuned shapes the old and new calls build equal params on CPU, and on gfx1250 the 76 tuned configs return bitwise-equal outputs both ways, 3 runs each, with no element outside rtol=atol=2e-2. The timing A/B against the old call is still to be measured; the tuned tables are not re-tuned here. Co-authored-by: Cursor <[email protected]>
Align conv3d_tune with the GEMM tuners: - Time with --warmup/--iters (5/101 by default), which the GEMM tuners pass to run_perftest; it ran run_perftest's default of 2 warmups. run_config does the same. - Check against fp32 F.conv3d with an fp32 bias, rounded to bf16 once, the reference of op_tests/test_flydsl_conv_implicit.py and the GEMM tuners. It was bf16 F.conv3d with the bias rounded to bf16 first. - run_config uses the base class's err-ratio limit and status format; strict_compare still turns any element outside rtol=atol=2e-2 into 1.0, so the limit's margin does not loosen it. Kept as is: errRatio=0 with strict_compare, shape_grouped always on, and the best-of-3 run_config. Preallocated outputs with NaN init would need an out= argument on run_conv3d_gfx1250 and are left out. Retune both gfx1250 VAE tables with this tuner (prepared operands from 3f7d146, so `us` is the kernel alone): all 7440 candidates of the 76 shapes are within rtol=atol=2e-2 of the fp32 reference, none failed or timed out. The winner changes on 8/32 Qwen-Image and 18/44 Wan2.1 rows; in the same run the previous tiles time 0.2% slower in sum on both tables (at most 6.4% on a row). Co-authored-by: Cursor <[email protected]>
With --run_config <tuned_csv>, report each row's tuned `us` as kernel_us next to the end-to-end time, as the MoE tuner does; the base class then prints Kernel(us) and E2E(us) side by side. On gfx1250 the two differ by up to 4.8x on padded shapes, where the entry point's host-side pad dominates. Co-authored-by: Cursor <[email protected]>
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
…didate
run_conv3d_gfx1250 takes an optional out= (written in place; behavior is
unchanged without it). The gfx1250 tuner preallocates the NDHWC output and
passes output_keys=("out",), so mp_tuner NaN-fills it before every candidate
and a kernel that leaves elements unwritten fails strict_compare instead of
inheriting the previous candidate's result.
Co-authored-by: Cursor <[email protected]>
The gfx1250 backend accepted splitk in its public signature but the entry point never forwarded it, and the tuner adapter deleted it before the call. The tuned row could therefore record a split-K that was not the one executed, while AOT compiled a third value from that row. - Forward the public splitk argument to the gfx1250 backend. - Resolve split-K in one gfx1250 helper that applies the tile-tail and BIG_OUT gates and distinguishes a caller's explicit request from a tuned/automatic value; use it from the runtime, the tuner and AOT so the tuned metadata, the executed kernel and the prepared artifact agree. - Keep the compile-only gate in the gfx1250 dispatch so a launcher warmed in the same process is not dispatched with the AOT CPU probe arguments. - Require a zero strict error count in run_config instead of letting the historical CSV error ratio forgive a current mismatch. - Reject gfx1250 grid.y values above the shared MAX_GRID_YZ limit, as the gfx950 grid builder already does. Verified on gfx1250 (FlyDSL 0.4.1): strict accuracy on representative NDHWC and NCDHW shapes with no split-K, bitwise-identical outputs against the unmodified kernel for those cases, and graph-replay time unchanged within noise. The added host-side resolution costs a few percent on ~10-40us launches only.
Every numerical case in this file compares values, so a split-K that changes between the tuned row, the launched kernel and the AOT artifact was invisible to it. Add one assertion set to the existing script, run unfiltered like the compile-key and block-rows checks: - no_tail, x=(1,64,1,8,768): an explicit split-K of 2 must be the value the kernel is compiled with, and the automatic value must equal the flat resolution the tuner would record. - row_tail, x=(1,64,1,3,2048): Ho=3 is not a multiple of block_rows=8, so split-K must fall back to 1, and an explicit incompatible request must be rejected rather than silently changed. Checked on gfx1250 with FlyDSL 0.4.1: the current tree passes all six checks (no_tail auto=3 with the kernel at split-K=2; row_tail auto=1 with the kernel at split-K=1 and explicit 3 raising). The tree before the shared resolver fails the same function outright, so the check is red on the regression it targets.
op_tests/test_flydsl_conv_implicit.py runs on every supported arch, but the new check captured the gfx1250 compile hook and the gfx1250 resolver. On gfx950 the same shapes take the MFMA path, whose split-K is derived inside _implicit_param_from_problem, so nothing was captured and the check failed there. Skip the check when the backend is not gfx1250, with a log line, matching how the file already skips cases it cannot exercise.
main gained #7331, which rewrote op_tests/test_flydsl_conv_implicit.py into ci/perf modes and added a 2d_splitk2 case asserting that split-K survives host resolution. Keep that file and re-home the gfx1250-only check inside it: the shared resolver assertions and the compile hook stay behind a gfx1250 guard, so the gfx950 CI path is untouched. No other file collides.
Replace the N-D make_tdm_atom + imm_offset pair with the tiled make_tiled_tdm_atom + tdm_partition path the other gfx1250 kernels use. Weights are K-tile aligned, so one descriptor covers the whole channel range, the N tail is clamped by the view extent, and each round indexes the K tile it needs. Input taps shift the base by whole rows and columns, which is not a multiple of the tile, so that side builds its descriptor per issue from a shifted base. The LDS tiles are unchanged, which also keeps the padding: make_tiled_tdm_atom derives pad_interval/pad_amount from the LDS layout, and lds_k already carries LDS_PAD. Behaviour changes to measure on gfx1250: early_timeout is not part of the tiled API, and the input side now rebuilds its descriptor every round.
Pass the complete padded B tile as partition mode zero and retain a singleton rest mode, matching the gfx1250 GEMM load path. Keep the A descriptor/offset path while migrating the weight side independently. Validated two representative shapes on a07 GPU0 and d7 GPU1 with FlyDSL 0.4.1: ten NaN-prefilled accuracy checks per version and three bitwise baseline comparisons per shape. Full configuration coverage and performance testing remain separate follow-ups.
…atom Build the A atom per issue from the runtime tap offset, so the input side no longer uses the legacy N-D atom and no make_tdm_atom call remains in the kernel. B keeps the tiled weight path from the previous commit.
main gained #6956, which rewrote aiter/aot/flydsl/conv.py to build the AOT cache by replaying the runtime. That deleted the hand-enumerated job and per-kernel compile machinery this branch had extended for gfx1250, so all six hunks conflicted; take main's file outright. The gfx1250 compile keys now come from replaying flydsl_conv_implicit, which already owns the channel pad (CGP_ALIGN), the split-K resolver and the dyn_hw gate, so this branch's _conv_dedupe_key, _probe/_conv_probe_args and _compile_conv3d_gfx1250_to_cache paths have no remaining caller. Checked on gfx1250 (one card): replay builds 10 artifacts for a 5-row tuned table, --check passes, and every entry point of those rows (2 input x 2 output layouts, bias omitted where the table has none) hits under FLYDSL_RUNTIME_RUN_ONLY=1. Numerical accuracy was not re-validated here: this container's toolchain reproduces the same op-test failures as the pre-merge head, so the merge is behaviour-neutral but the head's accuracy is still open.
_run_ci() now calls check_splitk_contract(), which reads the get_gfx module global that _load_backend() installs. tests/test_conv3d_ci_modes.py drives _run_ci() directly, so the name was undefined and the job failed with NameError on the default-dispatch case. Patch script.get_gfx to a fixed arch in that test; the contract check is gfx1250-specific and returns early on gfx950, so no GPU backend is needed.
Resolve the conflicts in csrc/flydsl_conv3d/conv3d_tune.py and README.md with ROCm#6662 / ROCm#7503, which brought the gfx1250 tuner with the same fp32 reference, strict_compare, run_kwargs and --run_config kernel_us this branch added. Take main's version and keep this branch's gfx950 part on top of it: a splitK=1 gfx950 candidate is timed as the kernel alone on prepared operands into a NaN-filled buffer (generate_data_kernel / run_flydsl_conv3d_kernel), split-K still through the entry point; conv3d_ref keeps the NCDHW-contiguous fp32 input; the docstrings and README say us is kernel-only on both archs.
Summary
flydsl_conv_implicit: host pre-pads to NDHWC withC/groupsaligned to 32; A is loaded with rank-3 TDM boxes, B with 2D TDM tiles, compute via WMMA 16×16×32 bf16→f32.compile_gemm_a16w16on gfx1250: a prologue ofnum_buffers - 1TDM tiles, anscf.formain loop with register-prefetched fragments, and a drain. Blocks of 1 to 16 waves; split-K (fp32 atomic staging), dyn_hw (runtime extents) and BIG_OUT (64-bit stores).conv3d_policy_gfx1250.py),csrc/flydsl_conv3d/conv3d_tune.pyon gfx1250, AOT inaiter/aot/flydsl/conv.py, and tuned tables for the Qwen-Image VAE and Wan2.1 VAE (aiter/configs/model_configs/*_gfx1250_bf16_tuned_conv3d.csv). The tuner times prepared operands (host pads and weight pack done once), so the tables'usis the kernel alone; warmup/iterations, the fp32 reference andrun_configfollow the GEMM tuners.conv_kernels.py(SUPPORTED_GFXincludesgfx1250); fixconv3d_transposeLDS sync for gfx1250 (gpu.barrierinstead ofs_waitcnt).op_tests/test_flydsl_conv_implicit.pywith gfx1250 tile/block_rowsand a tail-block case.Scope
padding_mode(host-side pad), split-K, dyn_hw, BIG_OUT.patch_reuseis accepted and ignored on gfx1250).num_buffers/variant/main_loop_unrollexist as kernel knobs, but the tuner and the runtime use the defaults (2 /bandwidth_bound/ off).Accuracy
Retuned tables (2026-10-27):
conv3d_tune.pychecks every candidate it times against an fp32F.conv3dreference (fp32 bias) rounded to bf16 and fails it on any element outsidertol=atol=2e-2; all 7440 candidates of the 76 shapes pass. Each of the 76 new rows, run 3 times through the tuner's call, the NDHWC entry point and the NCDHW entry point (tuned lookup), outputs NaN-filled before they are freed: zero elements outsidertol=atol=2e-2.Candidate sweep (2026-10-26): every candidate the tuner enumerates for the 76 shapes of both gfx1250 tuned CSVs: 7444 configs (1/2/4/8/16-wave: 140 / 1259 / 3192 / 2164 / 689; 52 with split-K 2–4), each run 10 times against an fp32 CPU reference, with every output NaN-filled before it is freed. Zero elements outside
rtol=atol=2e-2, no NaNs, no hangs. Called with torch's default NCDHW layout (flydsl_conv_implicit, NCDHW in/out, tuned lookup), the op matchesF.conv3don all 76 shapes. None of these shapes needs BIG_OUT.Performance
gfx1250 (256 CUs), one card, 2026-10-27, retuned tables, FlyDSL 0.4.0. All times are
run_perftest(5 warmup + 101 iterations, the tuner's measurement) on the same seeded inputs, average of two passes; per shape the passes agree within 3.5%, every sum within 0.1%. A monitor sampled the card's KFD processes every 10 s, and any record whose window saw another process holding VRAM was dropped and re-measured, so every number below was taken with no other process on the card.us)flydsl_conv_implicit, tuned lookupflydsl_conv_implicit, tuned lookupF.conv3dbf16, NCDHW (MIOpen)uscolumn matches it on every row (median 0.998x, within 3.8%). It is faster than the baseline on every shape (down to 1.92x on Qwen-Image and 1.41x on Wan2.1). In the previous version of this description the kernel row (24,989 / 24,537 us) was timed through raw operands, which is what the NDHWC entry point row measures now.csrc/flydsl_conv3d/README.md), so the NDHWC entry point row is the one that applies to them; it is slower than the baseline on 3 shapes of each model (down to 0.77x). Its gap to the kernel row is host-side work, mostly the zero pad: on the 38 unpadded shapes the entry point is 5% above the kernel, on the 38 padded ones 186% (up to 4.78x on a row). The rest is the channel pad to a multiple of 32 whereC/groupsneeds it, and the weight pack, whichrun_perftestrepeats on every call because it rotates weight copies, while a deployed layer pays it once.direct_copy(the NCDHW→NDHWC permute, plus a second copy for the host-side zero pad on padded layers) and 3.2% the zero fill of that pad; the FlyDSL pre-transpose kernel is not used.The
usvalues in the tables are bound to the 2026-10-27 machine and FlyDSL 0.4.0. Re-measured on another gfx1250 card with FlyDSL 0.4.1 through the same prepared-operand path, all 76 rows came out faster (median -8.8%, sum -10.3%, up to -30% on individual rows; the only rows above the table are +10.1% and +3.2%), and rotating input and output copies to defeat the cache changed the result by under 2% on 4 of 5 sampled rows, so the gap is the toolchain and the machine rather than the measurement. Read these numbers as relative (which configuration won, and by how much within one environment) rather than as a portable absolute.Wan2.1 VAE @368x544, per layer
Kernel us is the tables'
us(kernel alone, TFLOPS from it); NDHWC entry us is end to end throughflydsl_conv_implicit; torch isF.conv3dbf16 NCDHW on the same inputs; average of the two passes. Rows are the first 22 rows ofwan21_vae_gfx1250_bf16_tuned_conv3d.csv, in table order.Per-shape times (average of the two passes)
Tuning time
gfx1250, one card (256 CUs), 2026-10-27. Both tables re-tuned with
csrc/flydsl_conv3d/conv3d_tune.py --mp 1 --timeout 600.FLYDSL_RUNTIME_RUN_ONLY=1(no JIT while tuning), one process:qwenimage_vae_gfx1250_bf16_tuned_conv3d.csvwan21_vae_gfx1250_bf16_tuned_conv3d.csvWall time covers the whole
conv3d_tune.pyprocess (the tuner itself reports 425 s and 573 s). All 76 shapes tuned, no failed shape,err_ratiois 0 on every row.Known issue
Test plan
PYTHONPATH=. python op_tests/test_flydsl_conv_implicit.pykeyword surface on gfx1250 (all cases err=0)--wan-res 64x64 --wan-frames 5 --qwen-res 64x64(selected cases)F.conv3d(see Performance)aiter.aot.flydsl.convinto an empty cache, all 76 rows served underFLYDSL_RUNTIME_RUN_ONLY=1and matchingF.conv3dPR Self-Review
This self-review covers the source and description at this head. GPU results in the Accuracy, Performance, Tuning time and Test plan sections predate this revision (they were taken at or before
11b8450); they are not a claim that the current head was revalidated end to end.Reviewed revision
2bd7ad791e869b8c44f62e995e4ba4c47297781fBehavior and intent
This PR adds a gfx1250 TDM/WMMA backend to
flydsl_conv_implicit, with host-side spatial padding, NDHWC operands, per-group channels aligned to 32, architecture-specific tile selection, tuning tables, and AOT support. The existing gfx950 MFMA backend does not fit gfx1250's wave32/WMMA execution model, and the previous architecture allow-list rejected gfx1250.Changes since the previous self-reviewed revision (
11b8450):134c1bd: the public entry now forwardssplitkto the gfx1250 backend (previously it was dropped, and the tuner adapter deleted it too). Split-K is resolved by a single helper,_resolve_splitk_gfx1250, which applies the H/W tile-tail, output-channel-tail and BIG_OUT gates; the runtime, the tuner and AOT all call it, so the tuned row, the launched kernel and the AOT artifact agree. Only an explicit caller request that is incompatible with a tail raises; tuned/automatic values fall back to 1._dispatchkeeps the compile-only gate so a launcher warmed in the same process is not run with AOT CPU-probe arguments.run_confignow requires a zero strict error count instead of accepting the historical CSV error ratio. gfx1250grid.yaboveMAX_GRID_YZis rejected, as on gfx950.cb25bbd: addscheck_splitk_contracttoop_tests/test_flydsl_conv_implicit.py.9ba793d: skips that check (with a log line) when the backend is not gfx1250, because on gfx950 the same shapes take the MFMA path and nothing is captured.a2c7577: moves both operands from the legacy N-Dmake_tdm_atom+ immediate-offset copy to the tiledmake_tiled_tdm_atom+tdm_partitionpath used by the other gfx1250 kernels. Weights are K-tile aligned, so one descriptor covers the channel range and each round selects its K tile; input taps shift the base by whole rows and columns, which is not a multiple of the tile, so that side builds its descriptor per issue from a shifted base. The LDS tiles are unchanged, which keepsLDS_PAD/pad_intervalderived from the LDS layout.early_timeoutis not part of the tiled API.06f6f49: fixes the tiled weight partitioning: the complete padded B tile is partition mode 0 and a singleton rest mode is retained, matching the gfx1250 GEMM load path. In this commit A returns to the N-D descriptor/offset path so the weight side can be migrated on its own.5741cb3: moves the input gather to the tiled atom as well, building A per issue from the runtime tap offset; nomake_tdm_atomcall remains in the kernel.6888112,c1b5708,ec511cd: mergemaininto the branch; no kernel source change of their own.Carried over from
11b8450:run_conv3d_gfx1250accepts a caller-ownedout, and the gfx1250 tuner NaN-fills it before each candidate so a kernel that leaves elements unwritten failsstrict_compareinstead of inheriting the previous candidate's values.patch_reuseis accepted but ignored on gfx1250.Validation and unverified scope
At this head's commits (gfx1250, FlyDSL 0.4.1, as recorded in the commit messages of
134c1bd/cb25bbd/06f6f49):check_splitk_contract: all six checks pass (no_tail: automatic resolution 3, kernel compiled with the explicit split-K=2;row_tail: automatic resolution 1, kernel compiled with split-K=1, explicit 3 raises). The tree before the shared resolver fails the same function, so the check catches the regression it targets.06f6f49records two representative shapes on a07 GPU0 and d7 GPU1 with FlyDSL 0.4.1: ten NaN-prefilled accuracy checks per version and three bitwise baseline comparisons per shape. That record covers the weight-side migration only; the input side moved to the tiled atom afterwards, in5741cb3.ec511cd1on gfx1250 (FlyDSL 0.4.1, one card): all 76 tuned rows x 2 output layouts x 10 runs through the tuned lookup (1520 calls), with 456 both-directionrtol=atol=2e-2checks finding zero elements outside tolerance, zero non-finite values and bit-identical output across repeats. The public entry served all 76 rows in NCDHW and NDHWC form (152 calls) underFLYDSL_RUNTIME_RUN_ONLY=1with no JIT fallback, so every tuned row's artifact still matches what the runtime requests. Against an fp64 reference on two layers the kernel stays within one bf16 ulp (99.97% of elements bit-identical) and is closer to fp64 than the fp32 reference. Same-card A/B on four representative layers shows no regression (paired medians -0.47%, -2.84%, -0.08%, -0.03%).Earlier recorded results (gfx1250, one GPU, 256 CUs, FlyDSL 0.4.0, see the sections above):
PYTHONPATH=. python op_tests/test_flydsl_conv_implicit.py: keyword caseserr=0; small VAE smoke with--wan-res 64x64 --wan-frames 5 --qwen-res 64x64.csrc/flydsl_conv3d/conv3d_tune.py --mp 1 --timeout 600from a CPU-precompiled cache underFLYDSL_RUNTIME_RUN_ONLY=1; 7440 candidates pass (2026-10-27). Separate 2026-10-26 sweep: 7444 candidates x 10 runs, NaN-filled outputs, no element outsidertol=atol=2e-2, no NaNs, no hangs.run_perftest(5 warmup + 101 iterations), two passes againstF.conv3dwith interference monitoring.aiter.aot.flydsl.convinto an empty cache, all 76 rows served underFLYDSL_RUNTIME_RUN_ONLY=1and matchingF.conv3d.Unverified at this head:
op_tests/test_flydsl_conv_implicit.pyfails 19/21 cases at this head, but the unmodified5741cb3head and11b8450fail the same way there, and torchF.conv3dmatches CPU on that card. The failure is not attributed to this revision, so it is not used as evidence for or against it; it needs a rerun in the image the earlier results used.check_splitk_contractasserts the compiled split-K value, not the output values.smci355-ccs-aus-n12-25, MI355X, torch 2.10.0+rocm7.2.3, FlyDSL 0.4.1): three conv3d shapes (1x32x4x16x163x3x3,1x64x1x32x321x3x3 with pad,1x32x3x32x32stride 2) ran three times each with no non-finite element and no element outsidertol=atol=2e-2in either direction, max abs error 0.0039 / 0.0078 / 0.0156 (bf16 rounding steps), and outputs were bit-identical across repeats;compile_transpose_ncdhw_ndhwcalso compiles on gfx950 (1x64x1024,2x128x4096).conv3d_implicit_gfx950.pyandconv3d_gfx950_utils.pyare untouched by this PR, so the exposure wasconv_kernels.pyandconv3d_transpose.py, both exercised here. gfx950 performance was not measured and only these three small shapes were used.PR-specific question
The shared entry strips architecture feature suffixes and allow-lists only gfx950 and gfx1250, including before the pointwise matmul path. It checks supported convolution ranks and layouts, GPU tensors, bf16 input/weight, bias shape, consistent groups/channels, positive stride/dilation and valid padding semantics. After padding normalization and the pointwise fast-path check, only the remaining convolutions on gfx1250 select the new TDM/WMMA backend.
Host spatial padding and channel packing adapt valid inputs; they are not rejection checks. The gfx1250 backend requires positive output extents. Parameter/launch construction enforces aligned channels and CRS, WMMA tile/block geometry, at most 16 waves, split-K divisibility, split-K staging and grid limits (
grid.yandgrid.z<=MAX_GRID_YZ), and LDS/prologue capacity._resolve_splitk_gfx1250is the single gate for split-K: H/W or output-channel tile tails and BIG_OUT force split-K 1 for tuned/automatic values and reject an explicit request > 1. Dynamic-shape ineligibility selects static compilation rather than rejecting an otherwise supported input. A suppliedoutmust have the expected shape, bf16 dtype, the input device and contiguous storage.These are the shared-entry and launch invariants, not a claim that direct backend calls validate every input or that cross-device operands are checked.
Changed op tests
The only changed op-test file is op_tests/test_flydsl_conv_implicit.py.
3d_tail_blocks: input(1, 32, 3, 17, 19), 48 output channels,64x64tile,block_rows=4, padding and bias. H=17, W=19 and K=48 produce H/W block tails and an output-channel tail at once, covering the masked epilogue and the tail-driven static fallback; default/tuned model sweeps do not guarantee this combined geometry.3d_tile_128and2d_tile_256pinblock_rows=8, exercising wider-tile 2D-block geometry explicitly instead of relying on heuristic or tuned selection. Validating gfx950's wave64 MFMA mapping does not cover gfx1250's wave32 TDM/WMMA mapping.2d_splitk2(adjusted) and3d_splitk2(added) use fixed tiles,block_rows=4andpatch_reuse=Falseto avoid H/W/N tails in cases that request split-K. These are numerical checks; the 2D case has 27 K-tiles, so a request of 2 resolves to 1.check_splitk_contract(new, gfx1250 only, runs unfiltered):no_tailx=(1,64,1,8,768)checks that an explicit split-K=2 is the value the kernel is compiled with and that the automatic value matches the flat resolution the tuner records;row_tailx=(1,64,1,3,2048)(Ho=3 not a multiple ofblock_rows=8) checks fallback to 1 and that an explicit incompatible request raises. Every other case compares values only, so a split-K that silently differs between the tuned row, the kernel and AOT would pass them; this check is not redundant with them.No negative-input rejection tests were added beyond the explicit split-K tail rejection.