Skip to content

[FlyDSL] V0.4.2 Tdm new interface refactor: make_tdm_atom -> make_tiled_tdm_atom - #7655

Merged
coderfeli merged 4 commits into
mainfrom
tdm-tiled-residue-20261109
Nov 11, 2026
Merged

coderfeli merged 4 commits into
mainfrom
tdm-tiled-residue-20261109

Conversation

@xudoyuan

@xudoyuan xudoyuan commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Motivation

Changes

Performance (if applicable)

Hardware Workload/configuration Before After Change

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

PR Self-Review

Reviewed revision

Behavior and intent

Validation and unverified scope

PR-specific question

Changed op tests

@xudoyuan
xudoyuan requested a review from a team November 9, 2026 10:55
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter standard tests on MI35X
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7655 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@github-actions github-actions Bot added the FlyDSL label Nov 9, 2026
@aiter-bot

aiter-bot commented Nov 9, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 584fbb77d5e1 · mode shadow

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

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What is the most important boundary or failure mode introduced by this change, and what evidence covers it?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

xudoyuan and others added 4 commits November 10, 2026 17:33
… 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]>
@yadaish
yadaish force-pushed the tdm-tiled-residue-20261109 branch from 89bcf7a to 584fbb7 Compare November 10, 2026 11:29

@aoli26 aoli26 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested representative a8w8 GEMM/BMM shapes, no precision/performance regressions were observed.

@coderfeli
coderfeli merged commit 6850fe1 into main Nov 11, 2026
@coderfeli
coderfeli deleted the tdm-tiled-residue-20261109 branch November 11, 2026 03:50
zejunchen-zejun added a commit that referenced this pull request Nov 11, 2026
…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]>
@andyluo7

Copy link
Copy Markdown
Contributor

This breaks the gfx1250 FlyDSL AOT build for 37 block-128 MXFP8 GEMM configs: make_tiled_tdm_load_atom: no common tile/global vectorization. The parent commit builds all 2026 GEMM jobs; this commit fails 37. Details and repro in #7833.

@xudoyuan

xudoyuan commented Nov 12, 2026 via email •

Copy link
Copy Markdown
Contributor Author

@xudoyuan

Copy link
Copy Markdown
Contributor Author

This breaks the gfx1250 FlyDSL AOT build for 37 block-128 MXFP8 GEMM configs: make_tiled_tdm_load_atom: no common tile/global vectorization. The parent commit builds all 2026 GEMM jobs; this commit fails 37. Details and repro in #7833.

ROCm/FlyDSL#1313 will fix this issue. It will be resolved in the next version of FlyDSL. Thanks~

amirumoAMD added a commit that referenced this pull request Nov 16, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants