Repository navigation
[FlyDSL] V0.4.2 Tdm new interface refactor: make_tdm_atom -> make_tiled_tdm_atom - #7655
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
WAITING ON AUTHORPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
… atom Seven make_tdm_atom sites: the A load and the six scale atoms _tdm1 builds. _tdm1 now returns (atom, blk). Every scale view spans the whole K rather than one k-tile, because the rest index the copy uses carries the split-k base and a one-split extent would put the later tiles out of bounds, where boundary_check returns zeros instead of failing. The ragged last tile is clamped by that same extent, so _tail -- which wrote extent_1 per iteration, a slot the tiled atom does not expose -- is gone, and with it K_REM and the six sa_imm/sb_imm closures. The mx128 B scale is the site the migration notes recorded as unconvertible: its (N_BLOCKS, K_WS) tile collapses to one element along the contiguous mode at tile_k == 128, which deriveTdmAtom could not describe. flydsl 0.4.2 carries ROCm/FlyDSL#1309, which puts the contiguous mode's filler dim at the front, so it builds now. The non-m-major mx128 A scale keeps K on its outer axis and takes its rest from there. The A load pads once per A_PAD_INTERVAL. A flat (row, stride) box states a single skip at the end, so a row needing more than one pad splits its K axis on the global view and the LDS box alike; A_PAD_SPLIT == 1 keeps the flat form, so the common path is untouched. early_timeout is dropped rather than restored as atom state: on the tiled atom bit 21 comes from a runtime slot guarded by assume(early == 0 || mask != 0), and writing it under a zero mask is undefined behaviour. Unverified: the AOT dry run reaches the GPU runtime on this machine for every config on main as well (0 ok / 2011 failed either side), so it is not a usable compile gate here, and the GPU was busy. Co-Authored-By: Claude Opus 5 <[email protected]>
add_tdm_loads was the one site PR #7213 left behind: it carved each wave's slice out by hand, folding the slice offset into the base pointer, and the tiled coordinate rest counts tiles rather than rows, so that offset had to move somewhere else across six callers with different geometries. It does not have to move anywhere. The atom is now built with num_warps=len(wv) and tdm_partition hands each owner its share of the same compact LDS traversal, whichever axis that splits. The outer/inner segment arithmetic, the per-wave base offsets and the split_inner flag that chose between the two axes all go away, along with the Job fields that carried them. Each view spans every k-tile its rest index reaches instead of one tile at a runtime offset, so the ragged last tile is clamped by the view's own extent: the per-iteration extent_1 write, its is_tail predicate and the tail_ext field are gone, and imm_offset becomes the rest's tile number. pad_interval / pad_amount are implicit in a box row wider than the tile, so the pad argument survives only as an assertion that the two agree. Net -5 lines, and the remaining asserts state the invariants the old form computed: the rest steps exactly one tile per k-tile, and a padded row stays inside the pad interval's encodable range. No make_tdm_atom call sites remain in aiter. Unverified: the GPU was busy and the AOT dry run reaches the GPU runtime for every config on main as well, so neither path could gate this yet. Co-Authored-By: Claude Opus 5 <[email protected]>
Both skills still described fx.rocdl.make_tdm_atom as a live interface with a migration pending. No aiter kernel calls it any more, so they now say so and spell out what replaced each parameter: extents and strides move into the global view's layout, imm_offset becomes the coordinate tensor's tile index, pad_interval / pad_amount become row slack in the LDS box, and a hand-split across waves becomes num_warps plus a matching tdm_partition warp layout. early_timeout is called out as dropped rather than rewritten, because on the tiled atom that bit comes from a runtime slot guarded by assume(early == 0 || mask != 0) and writing it under a zero mask is undefined behaviour. The remaining exception is the gather/scatter family. The 16-byte innermost span is noted as a FlyDSL check rather than an ISA rule, and the one-element contiguous-mode tile is noted as fixed in flydsl 0.4.2 (ROCm/FlyDSL#1309). Co-Authored-By: Claude Opus 5 <[email protected]>
The assert added with the tiled-atom migration referenced _TDM_MAX_PAD_INTERVAL_BYTES, which is defined in gemm_a8w8_gfx1250.py and not here. It sits inside a traced function, so the NameError was a trace-time crash rather than a lint error: every launch of this kernel died before the migrated loader ran at all. Co-Authored-By: Claude Opus 5 <[email protected]>
89bcf7a to
584fbb7
Compare
aoli26
left a comment
There was a problem hiding this comment.
Tested representative a8w8 GEMM/BMM shapes, no precision/performance regressions were observed.
…led_tdm_atom (#7655)" This reverts commit 6850fe1 on the K3 test branch only. With the pinned flydsl 0.5.0 the tiled atom cannot describe the mx128 B scale tile at tile_k == 128 ((N_BLOCKS, 1), one element along the contiguous mode): make_tiled_tdm_load_atom fails with "no common tile/global vectorization". #7655 relies on ROCm/FlyDSL#1309 for that case, which 0.5.0 does not carry. On gfx1250, 18 of the 106 FlyDSL kernels that the Kimi-K3 mxscale table selects fail to compile (every non-compute wmma kernel with tile_k == 128, M = 1 to 8192), and the K3 TP8 server dies in CUDA graph capture. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
This breaks the gfx1250 FlyDSL AOT build for 37 block-128 MXFP8 GEMM configs: |
|
Thanks, I'll check.
|
ROCm/FlyDSL#1313 will fix this issue. It will be resolved in the next version of FlyDSL. Thanks~ |
Resolve conflicts with main's grouped-MoE rework (#7726), the tiled TDM atom interface (#7655), the FlyDSL 0.5 bump (#7600) and the shared-expert byte model in the grouped GEMM test. - tdm kernel: keep main's HYPER_PARAMS scheduler, tiled TDM loads and k_step WMMA ordering; reapply ds_first_n (now overriding ds_first_group), mma_prio, N-partitioned LDS loads, resident-B skip, split-K offsets and the per-feature kernel-name tags on top. - grouped_gemm_mxfp4: main's gemm_stage and m_align cluster handling, then decode static M. - grouped_moe_gfx1250: keep both new helpers and both sets of gemm1 kwargs. - tuned_grouped_fmoe.csv: drop the DSR1 rows main moved to model_configs/, take main's 96-expert 16384-token update, keep the Kimi K2 a8w4 rows. - moe_contiguous_psum: drop the HERD import main removed. - test: main's byte model plus the AITER_MOE_NUM_EXPERT_ACTIVATED cap.
Summary
Motivation
Changes
Performance (if applicable)
Testing
Documentation
Dependencies
Breaking Changes
PR Self-Review
Reviewed revision
Behavior and intent
Validation and unverified scope
PR-specific question
Changed op tests