Repository navigation
So/flydsl xcd remap v2 - #3134
Merged
Merged
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the FlyDSL A8W8 “B-preshuffle” GEMM stack to support XCD-aware workgroup remapping (“xcd swizzle”) and propagates that new tuning/config parameter through tuning, dispatch, and AOT compilation paths.
Changes:
- Add
xcd_swizzleas a tunable kernel parameter, propagate it through kernel naming/parsing, and pass it into FlyDSL execution paths. - Implement XCD-based
(bx, by)remapping in the FlyDSL preshuffle GEMM kernel, with tune-time filtering to avoid trying swizzle variants on small grids. - Update AOT compilation to parse/compile the new kernel-name format and to satisfy the new preshuffle GEMM launcher signature (bias placeholder tensor).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
csrc/ck_gemm_a8w8_bpreshuffle/gemm_a8w8_bpreshuffle_tune.py |
Pass xcd_swizzle into FlyDSL runner and prune XCD candidates on small CTA counts. |
aiter/ops/gemm_op_a8w8.py |
Extend FlyDSL kernel-name parsing to include xcd_swizzle and pass it to flydsl_preshuffle_gemm_a8. |
aiter/ops/flydsl/kernels/preshuffle_gemm.py |
Add XCD remap hook in-kernel; introduce bias arg slot and epilogue-related plumbing/refactors. |
aiter/ops/flydsl/kernels/mfma_preshuffle_pipeline.py |
Add xcd_remap_bx_by helper and adjust layout builder arithmetic. |
aiter/ops/flydsl/gemm_tune/flydsl_gemm_a8w8_bpreshuffle_common.py |
Add xcd_swizzle to kernel instance metadata and expand candidate generation. |
aiter/ops/flydsl/gemm_kernels.py |
Thread xcd_swizzle into compile args and pass a dummy bias tensor to match the new launcher signature. |
aiter/configs/model_configs/dsv3_a8w8_bpreshuffle_tuned_gemm.csv |
Update tuned FlyDSL kernel names/ids to the new naming format that includes xcd_swizzle. |
aiter/aot/flydsl/gemm.py |
Update preshuffle kernel-name regex to include xcd_swizzle and pass bias placeholder to AOT cache compilation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yzhou103
reviewed
May 14, 2026
yzhou103
left a comment
Contributor
There was a problem hiding this comment.
LGTM, the model fails are not caused by this pr
yzhou103
approved these changes
May 14, 2026
jiaqiang-dot-liu
added a commit
to jiaqiang-dot-liu/aiter
that referenced
this pull request
Sep 15, 2026
…rop 66 stale ones The 136 unparseable rows this branch's first commit only *reported* are now resolved. Root cause and the migration, both recovered from git history rather than guessed. Root cause: a kernelName schema change that did not migrate the CSVs `kernelInstance.name` in `aiter/ops/flydsl/gemm_tune/flydsl_gemm_a8w8_bpreshuffle_common.py` changed its knob field: | commit | date | knob field | |---|---|---| | `878008c3` (ROCm#3134) | 2026-05-14 | `lds_stage x use_cshuffle_epilog x use_async_copy x waves_per_eu x xcd_swizzle` | | `3910ab39` (ROCm#4151) | 2026-07-10 | `use_async_copy x waves_per_eu x xcd_swizzle x lds_stage` | `a8w8_bpreshuffle_tuned_gemm_qwen3_5_397b_a17b_mxfp4_attnfp8.csv` was added between them by ROCm#4317 / ROCm#4396, so it carries the five-token spelling. ROCm#4151 changed the format without migrating the shipped CSVs, and because the runtime fallback was silent nothing reported it. The mapping is confirmed by the observed value ranges, not inferred: across the 136 rows the tokens take `{1,2}`, `{0,1}`, `{0,1}`, `{0..4}`, `{0,4}` — positionally exactly `lds_stage`, `use_cshuffle_epilog`, `use_async_copy`, `waves_per_eu`, `xcd_swizzle`. Impact was total for those shapes: each of the 289 rows in that file is a distinct `(gfx, cu_num, M, N, K)`, so the 136 affected shapes had no second tuned row to fall back to. They ran on the CK default heuristic, and were also dropped from the AOT build. What this commit does * **70 rows migrated** (`use_cshuffle_epilog == 0`). Reordering the four surviving knobs into the current spelling is exact, so these tuned choices become live again. Example: `..._B16_2x0x1x3x0_default` -> `..._B16_1x3x0x2_default`. * **66 rows dropped** (`use_cshuffle_epilog == 1`). These were tuned for a cshuffle-epilog variant the a8w8 bpreshuffle path no longer has — the remaining `cshuffle` references in the tree belong to the separate mxfp4 kernels. Dropping the flag would name a *different* kernel than the one that was measured, so the `us` figures no longer describe anything buildable. These shapes need re-tuning; leaving inert rows in place only hides that. * `KNOWN_UNBUILDABLE_ROWS` drops to empty, which turns the ratchet into the stronger invariant: **no** shipped tuned row may name an unbuildable kernel. The migration is mechanical and reproducible: ``` old: <prefix>_{lds}x{cshuffle}x{async}x{wpe}x{xcd}_{sched} new: <prefix>_{async}x{wpe}x{xcd}x{lds}_{sched} # cshuffle == 0 only ``` After it, all 1375 `flydsl_bpreshuflle` rows across `aiter/configs/` parse. Verification and why this is a draft Checked here: every remaining row parses under both the runtime and the AOT regex; the migration touches only the `kernelName` column (70 insertions / 136 deletions, no shape keys altered); `ruff check` and `ruff format --check` pass. **Not verified on hardware, and that is the blocking item.** Parsing is not building: whether each migrated `(tile, knobs)` combination compiles and is actually faster than the CK default it currently gets needs a gfx950 run. The downside is bounded — a migrated row that fails to build falls back to exactly today's behaviour — but "bounded downside" is not the same as "measured win", and 70 shapes changing dispatch backend is not something to land unmeasured. Marked draft until an MI355X run confirms the migrated rows build and beat the CK default. Re-tuning the 66 dropped shapes is separate work for whoever owns them. Co-authored-by: Cursor <[email protected]> --- AI-assistance disclosure **AI assistance was used.** This began as a warning-only change (first commit) while auditing an unrelated per-shape dispatch override that was rejected. The schema archaeology above is what turned it into an actual fix. Targets a personal fork as a staging point, not `ROCm/aiter`. Signed-off-by: jiaqiang-dot-liu <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist