Repository navigation
[FLYDSL] Fea/mxfp4 flydsl a8w4 opt & replace - #6464
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
6082c41 to
17eeb33
Compare
84a6b11 to
32782a0
Compare
NOT READY FOR HUMAN REVIEWPR 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 |
There was a problem hiding this comment.
🟡 Changes recommended
The standard runner exits before executing the new test because required arguments are missing, while unresolved fallback and validation defects can raise errors or incorrectly report successful results.
4 open issues
What changed in this PR
This PR extends gfx950 A8W4 mixture-of-experts execution to pair FlyDSL MXMOE GEMM1 with OPUS Stage2 through explicit CSV configurations, while aligning runtime and ahead-of-time compilation contracts.
Changes:
- Add consumer-specific scale layouts, runtime bias selection, compatibility checks, and per-call fallback handling.
- Improve GEMM1 staging, synchronize BM128 shared-memory reuse, and preserve 64-bit payload store offsets.
- Update model configurations and add runtime, compilation, auxiliary-kernel, and public CSV validation coverage.
| File | Description |
|---|---|
op_tests/tuning_tests/test_public_a8w4_csv_lookup.py |
Tests padded-token CSV selection. |
op_tests/tuning_tests/test_mxmoe_opus_runtime.py |
Tests pair selection, input contracts, and fallback behavior. |
op_tests/tuning_tests/test_mxmoe_opus_aot.py |
Tests runtime/AOT layout and bias consistency. |
op_tests/tuning_tests/test_mxfp4_moe_aux_codegen.py |
Checks auxiliary catalogs and generated instances. |
op_tests/tuning_tests/test_mxfp4_flydsl_tuning.py |
Tests kernel names, candidate constraints, and bias handling. |
op_tests/tuning_tests/test_mxfp4_cpu_test_isolation.py |
Checks restoration of CPU test environment state. |
op_tests/tuning_tests/README.md |
Documents GPU-free test execution and requirements. |
op_tests/tuning_tests/mxfp4_cpu_test_utils.py |
Provides a scoped CPU-only test environment. |
op_tests/test_mxfp4_moe_aux_support.py |
Validates and benchmarks generated sorting kernels. |
op_tests/test_mxfp4_flydsl_public_csv.py |
Adds public CSV execution and JSON reporting. |
csrc/opus_moe/opus_moe_common.py |
Registers a BM64 Stage2 variant using SBM32 sorting. |
csrc/opus_moe/include/gfx950/a8w4/opus_moe_traits_stage2_a8w4_decode_gfx950.cuh |
Defines sort-aware route strides and constraints. |
csrc/opus_moe/include/gfx950/a8w4/opus_moe_stage2_a8w4_decode_dispatch_gfx950.cuh |
Sizes launches using the route stride. |
csrc/opus_moe/include/gfx950/a8w4/opus_moe_pipeline_stage2_a8w4_decode_main_gfx950.cuh |
Restricts route loading to the sorting block boundary. |
csrc/opus_moe/gen_instances.py |
Emits sort-block specialization parameters. |
csrc/kernels/mxfp4_moe/moe_aux/codegen/gen_instances.py |
Extends auxiliary generation to additional model shapes. |
csrc/ck_gemm_moe_2stages_codegen/mxfp4_staged_search.py |
Removes the obsolete kernel-name bias check. |
csrc/ck_gemm_moe_2stages_codegen/gemm_moe_tune.py |
Adds A8W4 preparation and naming support to coupled helpers. |
aiter/ops/moe_mxfp4_aux.py |
Expands support catalogs and adds compiled-instance preflight checks. |
aiter/ops/flydsl/mxfp4_kname.py |
Selects scales by consumer and removes bias name flags. |
aiter/ops/flydsl/mxfp4_gemm1_kernels.py |
Tightens supported variants and permits BM16 native FP8 scales. |
aiter/ops/flydsl/kernels/mxfp4_gemm1.py |
Updates staging, synchronization, addressing, and shared validation. |
aiter/fused_moe.py |
Integrates explicit MXMOE–OPUS pairs and their runtime contracts. |
aiter/configs/model_configs/kimik3_a8w4_tuned_fmoe.csv |
Replaces selected Kimi configurations with MXMOE pairs. |
aiter/configs/model_configs/gptoss_fp8fp4_tuned_fmoe.csv |
Replaces selected GPT-OSS configurations with MXMOE pairs. |
aiter/aot/flydsl/mxfp4_moe.py |
Generates consumer-specific scale and runtime bias variants. |
Review effort: Balanced
|
|
||
| def main() -> None: | ||
| parser = argparse.ArgumentParser(description=__doc__) | ||
| parser.add_argument("--csv", type=Path, required=True) |
| elif _exclude_mxmoe: | ||
| reject_reason = "excluded for this invocation" |
| if is_opus: | ||
| assert math.isfinite(element_error) and element_error <= 0.05 |
| row["kernelName1"], | ||
| row["kernelName2"], |
…itive element counts
Main's gfx1250-strict wheel builds (#7379, #7434) and MegaMoEV2 (#6881) edited the code this branch rewrites; both sides are kept: - moe.py: an arch's replay keeps the jobs of that arch's family, retargets them to it and leaves out the MXFP4 ones on gfx1250-strict; deployment jobs now pass through that filter as rows do. run_aot and moe.py's main run inside fail_build_on_missing_target_feature(), and run_aot still ends with the strict errata check. - mega_moe.py: the MTPR 8192 instances build the opt-in small- and large-input paths, and --check compiles nothing. FUSED_PATHS_MTPR and FUSED_PATHS_ENV stay module constants: they say how the replay builds an instance, not what a deployment is. - README: main's gdn_fused_prefill entries next to the deployment ones. #6464 moved DeepSeek-V4-Pro's TP8 rows at M 32 and 2048 to MXMOE stage 1, which compiles the clamp in, so the clamp the TP8 deployment passes now picks kernels the deployment builds. The merge changes no job list: the 1195 deployment jobs are 88ab025's, the 14374 tuned-row jobs main's (apart from the empty expert_mask_size this branch adds) and the 192 MegaMoE jobs main's. Co-authored-by: Cursor <[email protected]>
main gained the FlyDSL a16w16 path (#6552), the explicit clamped SiLU with an activation_bf16 stage-1 argument (#6995) and the mxfp4 a8w4 replacement (#6464), which were added in the same places as this branch's gfx942 a8w4 path: the kernel registry, the stage-1 signatures and the MoE tuner. Both sides are kept everywhere: the registry registers the _g942 and a16w16 names, stage 1 takes in_dtype, x_layout and activation_bf16, and the tuner picks candidates in the order a16w16, gfx942 a8w4, other, with the bf16-intermediate stage 2 for both a16w-mix and gfx942 a8w4. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#6464 moved the GEMM1 payload store offset to i64 so sorted payloads above 2 GiB cannot sign-wrap. Every lane then carries 64-bit store addresses, which raises the k_wave=2 (8-wave) A8W4 variant from 128 to 136 VGPRs and halves its resident workgroups per CU. Store through a buffer resource based at the block's first sorted row instead: the base is i64 and wave-uniform, and each lane keeps an i32 byte offset below BM * OUT_ROW_BYTES (asserted at compile time). The FP8 dword pair becomes one 2xi32 buffer store; FP4 stores one dword. Validation: the kw2 GEMM1 drops to 112 VGPRs (nt_xcd2 130 -> 126), with no spills and unchanged LDS. On 2.25 GiB A8W4 and A4W4 payloads (87k and 175k rows past 2 GiB), every valid row matches the i64 store bit for bit, while the earlier i32 store faults. test_moe_mxmoe_ep.py: 31 passed. On Kimi K3 inputs the kw2 GEMM1 is 7-8% faster than with the i64 store and 3% faster than before #6464, and test_moe_ep EP32 M=3/4 fmoe is 3.9%/4.0% faster. Signed-off-by: Wulley <[email protected]>
- moe_mxfp4_aux.py: drop the second is_mxfp4_moe_scatter_supported left by the rebase onto #6464, which defines the same check (ruff F811). The file now matches origin/main. - gemm_moe_tune.py: sort the mxfp4_v2_tune_utils import (I001), and drop the expert-inter and token locals that _time_pair and _check_reference_pair no longer use since they build data through _case (F841). - test_moe_mxmoe_ep.py: pass check=False to the CLI subprocess.run, whose return code the test asserts with the captured output (PLW1510), and apply black 26. - aiter/aot/flydsl/gemm.py: restore the executable bit that #7439 dropped; the script keeps its shebang and __main__ like the other FlyDSL AOT scripts (EXE001). Validation: ruff 0.16.0 `ruff check .` passes; black 26.10.1 passes on the changed files and on `black .`. test_fast_tuning.py and test_moe_mxmoe_ep.py: 88 passed, 1 pre-existing failure (local flydsl lacks check_smem_capacity). Signed-off-by: Wulley <[email protected]>
#6464 moved the GEMM1 payload store offset to i64 so sorted payloads above 2 GiB cannot sign-wrap. Every lane then carries 64-bit store addresses, which raises the k_wave=2 (8-wave) A8W4 variant from 128 to 136 VGPRs and halves its resident workgroups per CU. Store through a buffer resource based at the block's first sorted row instead: the base is i64 and wave-uniform, and each lane keeps an i32 byte offset below BM * OUT_ROW_BYTES (asserted at compile time). The FP8 dword pair becomes one 2xi32 buffer store; FP4 stores one dword. Validation: the kw2 GEMM1 drops to 112 VGPRs (nt_xcd2 130 -> 126), with no spills and unchanged LDS. On 2.25 GiB A8W4 and A4W4 payloads (87k and 175k rows past 2 GiB), every valid row matches the i64 store bit for bit, while the earlier i32 store faults. test_moe_mxmoe_ep.py: 31 passed. On Kimi K3 inputs the kw2 GEMM1 is 7-8% faster than with the i64 store and 3% faster than before #6464, and test_moe_ep EP32 M=3/4 fmoe is 3.9%/4.0% faster. Signed-off-by: Wulley <[email protected]>
- moe_mxfp4_aux.py: drop the second is_mxfp4_moe_scatter_supported left by the rebase onto #6464, which defines the same check (ruff F811). The file now matches origin/main. - gemm_moe_tune.py: sort the mxfp4_v2_tune_utils import (I001), and drop the expert-inter and token locals that _time_pair and _check_reference_pair no longer use since they build data through _case (F841). - test_moe_mxmoe_ep.py: pass check=False to the CLI subprocess.run, whose return code the test asserts with the captured output (PLW1510), and apply black 26. - aiter/aot/flydsl/gemm.py: restore the executable bit that #7439 dropped; the script keeps its shebang and __main__ like the other FlyDSL AOT scripts (EXE001). Validation: ruff 0.16.0 `ruff check .` passes; black 26.10.1 passes on the changed files and on `black .`. test_fast_tuning.py and test_moe_mxmoe_ep.py: 88 passed, 1 pre-existing failure (local flydsl lacks check_smem_capacity). Signed-off-by: Wulley <[email protected]>
#6464 moved the GEMM1 payload store offset to i64 so sorted payloads above 2 GiB cannot sign-wrap. Every lane then carries 64-bit store addresses, which raises the k_wave=2 (8-wave) A8W4 variant from 128 to 136 VGPRs and halves its resident workgroups per CU. Store through a buffer resource based at the block's first sorted row instead: the base is i64 and wave-uniform, and each lane keeps an i32 byte offset below BM * OUT_ROW_BYTES (asserted at compile time). The FP8 dword pair becomes one 2xi32 buffer store; FP4 stores one dword. Validation: the kw2 GEMM1 drops to 112 VGPRs (nt_xcd2 130 -> 126), with no spills and unchanged LDS. On 2.25 GiB A8W4 and A4W4 payloads (87k and 175k rows past 2 GiB), every valid row matches the i64 store bit for bit, while the earlier i32 store faults. test_moe_mxmoe_ep.py: 31 passed. On Kimi K3 inputs the kw2 GEMM1 is 7-8% faster than with the i64 store and 3% faster than before #6464, and test_moe_ep EP32 M=3/4 fmoe is 3.9%/4.0% faster. Signed-off-by: Wulley <[email protected]>
- moe_mxfp4_aux.py: drop the second is_mxfp4_moe_scatter_supported left by the rebase onto #6464, which defines the same check (ruff F811). The file now matches origin/main. - gemm_moe_tune.py: sort the mxfp4_v2_tune_utils import (I001), and drop the expert-inter and token locals that _time_pair and _check_reference_pair no longer use since they build data through _case (F841). - test_moe_mxmoe_ep.py: pass check=False to the CLI subprocess.run, whose return code the test asserts with the captured output (PLW1510), and apply black 26. - aiter/aot/flydsl/gemm.py: restore the executable bit that #7439 dropped; the script keeps its shebang and __main__ like the other FlyDSL AOT scripts (EXE001). Validation: ruff 0.16.0 `ruff check .` passes; black 26.10.1 passes on the changed files and on `black .`. test_fast_tuning.py and test_moe_mxmoe_ep.py: 88 passed, 1 pre-existing failure (local flydsl lacks check_smem_capacity). Signed-off-by: Wulley <[email protected]>
* [Test] test_moe_ep: add SiTUv2 A8W4 EP support and per-rank routing stats - Add -a/--activation, --beta and --linear-beta to the mxfp4 EP tests and pass beta/linear_beta through to fused_moe (defaults 4.0/25.0). - gfx950 a8w4: set AITER_SITUV2_A8W4=1 so SiTUv2 runs with fp8 activations instead of the a16w4 path, which rejects expert_mask; the a4w4 path clears it again. - Reference: reuse the quantized-activation path (previously gfx1250 a4w4 only) for a8w4 SiTUv2, quantizing both activations to fp8 with e8m0 scales; torch_moe has no SiTUv2. - SiTUv2 accuracy follows test_moe_2stage: fail only when checkAllclose mismatches and logits_diff exceeds 0.01. - Print local_routes / active_experts once before timing. It draws no random numbers and stays outside the timed fused_moe call, so inputs and timing are unchanged. * [FlyDSL] [MoE] Support EP for MXMOE GEMM1 with layout-v2 GEMM2 Port #7284 (00527e5) and cover the a8w4 SiTUv2 pairing used by Kimi K3 EP32. - get_2stage_cfgs: keep MXMOE rows under EP when GEMM2 is a flydsl_moe2_layout_ kernel. Skip the NE-keyed aux shape check there, since expert is the local count; only the scatter epilog still needs a generated scatter_reduce instance for (model_dim, topk). - _mxfp4_inline_sort_unsupported: accept expert_mask and skip the adaptive-sort instance check, since EP sorts with Opus. - _fused_moe_impl: raise NotImplementedError under EP only for native MXMOE GEMM2. - _mxfp4_a4w4_stage2_fw: forward expert_mask/topk_ids to the layout-v2 wrapper. Without them the reduce epilog sums unwritten remote-route slots. - op_tests/test_moe_mxmoe_ep.py: the PR's a4w4 tests, plus a8w4 SiTUv2 cases at Kimi K3 dims (BM32/64/128 x atomic/reduce, with and without a num_local_tokens dead tail) against an FP8-quantized torch reference, with NaN-filled stage2 buffers. * [FlyDSL] [MoE] Support A8W4 and real EP routing in tuners Add A8W4 candidate generation, activation quantization and gate/up layouts to the coupled MXFP4 tuner. Model real EP routing in the standard layout-v2 and coupled tuners, including route-stat matching, masked sorting, valid token bounds and local-expert references. Cover precision contracts and EP candidate selection with CPU unit tests. Signed-off-by: Wulley <[email protected]> * [Test] Fix A4W4 SiTUv2 reference and dtype selection in EP CLI Use the existing FP4-quantized two-stage reference for gfx950 A4W4 SiTUv2 instead of torch_moe, which does not implement SiTUv2. Set the A4W4 activation opt-in and clear the opposite precision flag when switching A4W4/A8W4. Add native CLI regression cases for real/fake EP modes and default/custom beta values. Validation: 7 dispatch checks and 4 CLI regression cases passed. A8W4 SiTUv2 and Kimi K3 EP32 with BM32 also passed the existing SiTUv2 criterion. The additional EP32 BM16/persist run stalled at GPU synchronization and was terminated; it is not counted as passing. Signed-off-by: Wulley <[email protected]> * [FlyDSL] [MoE] Use bench balanced routing for EP tuning data Replace the independent random EP routing of the layout-v2 and coupled tuners with the balanced routing of amd_moe_bench_share/bench_moe.py: tokens take topk experts at a time from a stream of random global-expert permutations, so every token picks distinct experts and global expert loads differ by at most one. When the global expert count is a multiple of topk the ids equal the bench's for the same seed; other topk/EP combinations skip experts that a permutation-spanning token already holds. Simulate EP rank 0 with 1/topk route weights, keep the test_moe_ep real-mode dispatch layout, and route padding rows to the masked extra slot so they stay inert. Replace --ep-route-match and its seed search with --ep-seed. Validation: ids and rank-0 route stats equal bench make_input() on 104 divisible cases; 49 non-divisible cases keep distinct experts per token and a global spread of at most one. test_fast_tuning.py and test_moe_mxmoe_ep.py: 88 passed, 1 pre-existing failure (local flydsl lacks check_smem_capacity). Kimi K3 A8W4 EP16/EP64 coupled tunes completed, and all 72 test_moe_ep real-mode cases with the tuned configs passed. Signed-off-by: Wulley <[email protected]> * [FlyDSL] [MoE] Keep MXMOE GEMM1 payload stores on 32-bit lane offsets #6464 moved the GEMM1 payload store offset to i64 so sorted payloads above 2 GiB cannot sign-wrap. Every lane then carries 64-bit store addresses, which raises the k_wave=2 (8-wave) A8W4 variant from 128 to 136 VGPRs and halves its resident workgroups per CU. Store through a buffer resource based at the block's first sorted row instead: the base is i64 and wave-uniform, and each lane keeps an i32 byte offset below BM * OUT_ROW_BYTES (asserted at compile time). The FP8 dword pair becomes one 2xi32 buffer store; FP4 stores one dword. Validation: the kw2 GEMM1 drops to 112 VGPRs (nt_xcd2 130 -> 126), with no spills and unchanged LDS. On 2.25 GiB A8W4 and A4W4 payloads (87k and 175k rows past 2 GiB), every valid row matches the i64 store bit for bit, while the earlier i32 store faults. test_moe_mxmoe_ep.py: 31 passed. On Kimi K3 inputs the kw2 GEMM1 is 7-8% faster than with the i64 store and 3% faster than before #6464, and test_moe_ep EP32 M=3/4 fmoe is 3.9%/4.0% faster. Signed-off-by: Wulley <[email protected]> * [MoE] Add Kimi K3 A8W4 EP16/EP32/EP64 MXMOE rows to the tuned fMoE config Add the coupled MXMOE (GEMM1 + layout-v2 GEMM2) rows that real-mode EP16/32/64 runs look up for per-rank batch 1-16 x qlen 1/4/8: lookup tokens EP * {1, 2, 4, ..., 128} with expert = 896 / EP local experts, at topk 16 and 17 (identical except topk; 17 carries the masked column). 48 rows are appended; the existing rows are unchanged. The rows come from the EP tuned configs of the coupled tuner; EP16 lookup 256 and EP32 lookup 128 use the k_wave=2 GEMM1, which assumes the preceding payload-store fix. Validation: the merged tuned_fmoe has no duplicate keys. test_moe_ep.py real mode without AITER_CONFIG_FMOE passes and hits the new rows for EP32 M=1/4/128, EP16 M=1/16/128 and EP64 M=1/128. Signed-off-by: Wulley <[email protected]> * [MoE] Fix black and ruff findings on the EP32 branch - moe_mxfp4_aux.py: drop the second is_mxfp4_moe_scatter_supported left by the rebase onto #6464, which defines the same check (ruff F811). The file now matches origin/main. - gemm_moe_tune.py: sort the mxfp4_v2_tune_utils import (I001), and drop the expert-inter and token locals that _time_pair and _check_reference_pair no longer use since they build data through _case (F841). - test_moe_mxmoe_ep.py: pass check=False to the CLI subprocess.run, whose return code the test asserts with the captured output (PLW1510), and apply black 26. - aiter/aot/flydsl/gemm.py: restore the executable bit that #7439 dropped; the script keeps its shebang and __main__ like the other FlyDSL AOT scripts (EXE001). Validation: ruff 0.16.0 `ruff check .` passes; black 26.10.1 passes on the changed files and on `black .`. test_fast_tuning.py and test_moe_mxmoe_ep.py: 88 passed, 1 pre-existing failure (local flydsl lacks check_smem_capacity). Signed-off-by: Wulley <[email protected]> * [MoE] Add Kimi K3 A8W4 EP16/EP32 token-8192 MXMOE rows and group the EP rows Add the token-8192 rows for EP16 (expert 56) and EP32 (expert 28), at topk 16 and 17: MXMOE GEMM1 64x256x256_fp8out_situv2 with layout GEMM2 t64x256x128_atomic_sbm64, block_m 64, from the coupled tuner (bench balanced routing, full search). These lookups previously fell back to the default heuristics. EP64 already had the same token-8192 row. Also group the EP rows by EP size (EP16, EP32, EP64; topk 16 then 17, by token); the other rows are unchanged. Validation, against the config without these rows: test_moe_ep.py real mode, global -m 5120/6144/8192, passes, hits the new rows, and cuts fmoe time by 46-56% at EP32 and 39-49% at EP16. amd_moe_bench_share at the same batch sizes cuts FC1+FC2 time by 41-52% at EP32 and 31-44% at EP16. EP64, whose row is unchanged, stays within 0.7%. Signed-off-by: Wulley <[email protected]> * [MoE] Drop the Kimi K3 A8W4 EP16/EP32/EP64 token-8192 rows Remove the token-8192 rows for EP16 (expert 56), EP32 (expert 28) and EP64 (expert 14), at topk 16 and 17, from kimik3_a8w4_tuned_fmoe.csv. Those lookups fall back to the default heuristics again. The EP rows now cover lookup tokens up to 2048 (EP16) and 4096 (EP32, EP64); the other rows are unchanged. Signed-off-by: Wulley <[email protected]> * [Test] test_moe_2stage: skip tuned CSV rows whose topk exceeds the expert count Expert-parallel fMoE rows key on the local expert count, so the Kimi K3 A8W4 EP64 rows carry expert=14 with topk=16/17. The tuned-CSV sweep runs every row as a non-EP MoE with E=expert, where fused_topk cannot pick topk distinct experts and pads the extra slots with duplicate expert-0 routes, so the strict accuracy check fails (logits_diff ~0.17). Skip such rows; runtime config selection is unchanged. * Revert "[Test] test_moe_2stage: skip tuned CSV rows whose topk exceeds the expert count" This reverts commit 42e54f9. Signed-off-by: Liu <[email protected]> * [MoE] Drop EP16/EP64 and EP32 topk-17 Kimi K3 rows Retain the eight newly added EP32 topk-16 configurations and all pre-existing Kimi K3 rows. Signed-off-by: Liu <[email protected]> * [MoE] Restore Kimi K3 EP16 and EP32 topk-17 rows Signed-off-by: Liu <[email protected]> * [Test] Remove MXMOE EP regression test Signed-off-by: Liu <[email protected]> * [MoE] Limit MXMOE under EP to validated SiTUv2 atomic/reduce configs get_2stage_cfgs now accepts MXMOE rows under EP only with SiTUv2 and an atomic or reduce layout GEMM2, and rejects BM16 rows. BM16 sorts through the masked Opus aux sort with dispatch_policy=1, which hangs at >= 819 experts (#8014). Other activations and the scatter epilog are not validated under EP, so they stay rejected as on main. Validation: get_2stage_cfgs over every gfx950 tuned MXMOE row with is_ep=True accepts only the Kimi K3 SiTUv2 atomic/reduce rows. A BM16 EP row falls back to the default heuristics; a non-EP BM16 row is still selected. Signed-off-by: Wulley <[email protected]> * [FlyDSL] [MoE] Skip BM16 GEMM1 candidates when tuning under EP The coupled tuner (--mxfp4-flydsl) still enumerated BM16 GEMM1 candidates for A4W4 under --ep-size, and its M_est pruning kept only BM16 for rows below M_est 4. Those candidates sort through the masked Opus aux sort with dispatch_policy=1, which hangs at >= 819 experts (#8014), and the runtime rejects BM16 under EP anyway. Skip BM16 under EP for both precisions and, as for A8W4, keep every larger BM unpruned. Also fix the scatter comment: the runtime rejects the scatter epilog under EP. Validation: test_fast_tuning.py: 59 passed. The new case checks that an EP32 A4W4 row with M_est 1 gets BM32/64/128 instead of BM16 only, and that a dense A4W4 row still gets BM16. Signed-off-by: Wulley <[email protected]> * [FlyDSL] [MoE] Reject non-SiTUv2 rows when tuning MXMOE under EP get_2stage_cfgs rejects every non-SiTUv2 MXMOE row under EP, but the coupled tuner (--mxfp4-flydsl --ep-size N) still accepted SiLU and SwiGLU rows and ran a full search whose winner inference always discards. Reject them in _unsupported_row_reason, and move the EP CPU tests to SiTUv2 rows. Validation: test_fast_tuning.py: 59 passed. The EP case now also checks that a SiLU row is rejected under EP; it fails without this change. Signed-off-by: Wulley <[email protected]> --------- Signed-off-by: Wulley <[email protected]> Signed-off-by: Liu <[email protected]>
- e2e.yaml: kimik3-fp4 (moonshotai/Kimi-K3) on mi355x for vLLM and SGLang; the recipes are InferenceX's vLLM
config at concurrency 48 as AgentX serves it and the SGLang cookbook's MI355X command (draft decoding, prefix
caching and the KV offload kept). The hub holds the draft models beside the model.
- A recipe names the AITER its two modes serve on ("aiter": "image", the default, or "stack"). Kimi-K3's recipes
take stack.json's, installed over the image's as aiter-test does: it has the aiter.plugin through which AKLR
serves AITER's ops, so the modes differ in AKLR alone. The GLM recipes stay on their image's.
- The AKLR-on mode also puts AKLR among aiter's providers (AKLR_AITER_PLUGIN=1); an AITER without aiter.plugin
has none to join.
- SGLang v0.5.23 on stack.json's AITER computes Kimi-K3's MoE wrong: it holds w13 gate/up-interleaved under
AITER_SITUV2_A8W4 and tells AITER "separated", which the image's AITER ignored and ROCm/aiter#6464 obeys. The
install gives its SiTU call the weights' layout, as sgl-project/sglang#51000 does, in both modes; the MoE
provider takes that call.
- e2e.yaml: kimik3-fp4 (moonshotai/Kimi-K3) on mi355x for vLLM and SGLang; the recipes are InferenceX's vLLM
config at concurrency 48 as AgentX serves it and the SGLang cookbook's MI355X command (draft decoding, prefix
caching and the KV offload kept). The hub holds the draft models beside the model.
- A recipe names the AITER its two modes serve on ("aiter": "image", the default, or "stack"). Kimi-K3's recipes
take stack.json's, installed over the image's as aiter-test does: it has the aiter.plugin through which AKLR
serves AITER's ops, so the modes differ in AKLR alone. The GLM recipes stay on their image's.
- The AKLR-on mode also puts AKLR among aiter's providers (AKLR_AITER_PLUGIN=1); an AITER without aiter.plugin
has none to join.
- SGLang v0.5.23 on stack.json's AITER computes Kimi-K3's MoE wrong: it holds w13 gate/up-interleaved under
AITER_SITUV2_A8W4 and tells AITER "separated", which the image's AITER ignored and ROCm/aiter#6464 obeys. The
install gives its SiTU call the weights' layout, as sgl-project/sglang#51000 does, in both modes; the MoE
provider takes that call.
- e2e.yaml: kimik3-fp4 (moonshotai/Kimi-K3) on mi355x for vLLM and SGLang; the recipes are InferenceX's vLLM
config at concurrency 48 as AgentX serves it and the SGLang cookbook's MI355X command (draft decoding, prefix
caching and the KV offload kept). The hub holds the draft models beside the model.
- A recipe names the AITER its two modes serve on ("aiter": "image", the default, or "stack"). Kimi-K3's recipes
take stack.json's, installed over the image's as aiter-test does: it has the aiter.plugin through which AKLR
serves AITER's ops, so the modes differ in AKLR alone. The GLM recipes stay on their image's.
- The AKLR-on mode also puts AKLR among aiter's providers (AKLR_AITER_PLUGIN=1); an AITER without aiter.plugin
has none to join.
- SGLang v0.5.23 on stack.json's AITER computes Kimi-K3's MoE wrong: it holds w13 gate/up-interleaved under
AITER_SITUV2_A8W4 and tells AITER "separated", which the image's AITER ignored and ROCm/aiter#6464 obeys. The
install gives its SiTU call the weights' layout, as sgl-project/sglang#51000 does, in both modes; the MoE
provider takes that call.
- e2e.yaml: kimik3-fp4 (moonshotai/Kimi-K3) on mi355x for vLLM and SGLang; the recipes are InferenceX's vLLM
config at concurrency 48 as AgentX serves it and the SGLang cookbook's MI355X command (draft decoding, prefix
caching and the KV offload kept). The hub holds the draft models beside the model.
- A recipe names the AITER its two modes serve on ("aiter": "image", the default, or "stack"). Kimi-K3's recipes
take stack.json's, installed over the image's as aiter-test does: it has the aiter.plugin through which AKLR
serves AITER's ops, so the modes differ in AKLR alone. The GLM recipes stay on their image's.
- The AKLR-on mode also puts AKLR among aiter's providers (AKLR_AITER_PLUGIN=1); an AITER without aiter.plugin
has none to join.
- SGLang v0.5.23 on stack.json's AITER computes Kimi-K3's MoE wrong: it holds w13 gate/up-interleaved under
AITER_SITUV2_A8W4 and tells AITER "separated", which the image's AITER ignored and ROCm/aiter#6464 obeys. The
install gives its SiTU call the weights' layout, as sgl-project/sglang#51000 does, in both modes; the MoE
provider takes that call.
- e2e.yaml: kimik3-fp4 (moonshotai/Kimi-K3) on mi355x for vLLM and SGLang; the recipes are InferenceX's vLLM
config at concurrency 48 as AgentX serves it and the SGLang cookbook's MI355X command (draft decoding, prefix
caching and the KV offload kept). The hub holds the draft models beside the model.
- A recipe names the AITER its two modes serve on ("aiter": "image", the default, or "stack"). Kimi-K3's recipes
take stack.json's, installed over the image's as aiter-test does: it has the aiter.plugin through which AKLR
serves AITER's ops, so the modes differ in AKLR alone. The GLM recipes stay on their image's.
- The AKLR-on mode also puts AKLR among aiter's providers (AKLR_AITER_PLUGIN=1); an AITER without aiter.plugin
has none to join.
- SGLang v0.5.23 on stack.json's AITER computes Kimi-K3's MoE wrong: it holds w13 gate/up-interleaved under
AITER_SITUV2_A8W4 and tells AITER "separated", which the image's AITER ignored and ROCm/aiter#6464 obeys. The
install gives its SiTU call the weights' layout, as sgl-project/sglang#51000 does, in both modes; the MoE
provider takes that call.
) - e2e.yaml: kimik3-fp4 (moonshotai/Kimi-K3) on mi355x for vLLM and SGLang; the recipes are InferenceX's vLLM config at concurrency 48 as AgentX serves it and the SGLang cookbook's MI355X command (draft decoding, prefix caching and the KV offload kept). The hub holds the draft models beside the model. - A recipe names the AITER its two modes serve on ("aiter": "image", the default, or "stack"). Kimi-K3's recipes take stack.json's, installed over the image's as aiter-test does: it has the aiter.plugin through which AKLR serves AITER's ops, so the modes differ in AKLR alone. The GLM recipes stay on their image's. - The AKLR-on mode also puts AKLR among aiter's providers (AKLR_AITER_PLUGIN=1); an AITER without aiter.plugin has none to join. - SGLang v0.5.23 on stack.json's AITER computes Kimi-K3's MoE wrong: it holds w13 gate/up-interleaved under AITER_SITUV2_A8W4 and tells AITER "separated", which the image's AITER ignored and ROCm/aiter#6464 obeys. The install gives its SiTU call the weights' layout, as sgl-project/sglang#51000 does, in both modes; the MoE provider takes that call.


Motivation
Extend the gfx950 MXMOE runtime and AOT pipeline to support A8W4 and allow explicit CSV configurations to pair FlyDSL MXMOE GEMM1 with the existing OPUS Stage2 backend.
The change establishes a consistent intermediate data contract across runtime and AOT and fixes GEMM1 correctness issues involving BM128 LDS reuse and payload addressing beyond 2 GiB.
Technical Details
gemm_moe_tune.py --mxfp4-flydsl) stays A4W4-only, as on main.Mxfp4FlydslTuner.tune()now rejects the batch when a row'sq_dtype_aorq_dtype_wis notfp4x2, naming the row and shape; main would build A4W4 candidates for such a row and write them under its A8W4 key. The_g1_kname,_prepare_caseand_port_e2ehelpers also accept an FP8 activation (a8w4/_fp8outnames, MXFP8 activation, interleaved W1, MXFP8 prequant), so the GPU coupled tests build A8W4 pairs through the production quantization and sorting path.flydsl_mxmoe_g1_a8w4_* → opus_moe2_layout_*configurations through the public runtime. Compatibility checks cover precision, prepared weights, BM/SBM, activation, bias, and sorting requirements. Incompatible per-call overrides trigger a separate cached resolution without modifying previously resolved metadata.i64to avoid signed address wrapping beyond 2 GiB.op_tests/test_mxfp4_flydsl_public_csv.py) that executes configured A8W4 MXMOE pairs through publicfused_moeand writes a JSON execution report.dsv4_fp8fp4,kimik3_a8w4,gptoss_fp8fp4) with 159 faster tuned rows; see Performance. EP rows (DSV4 E24/E48) and DSV4 rows that carrycomm_fused_configsare unchanged. These rows come from A8W4 coupled tuning done during development (DSV4 source table:docs/a8w4_work/dsv4_a8w4_tuned_fmoe.csv); the A4W4-only tuner in this PR does not regenerate them.The OPUS pair uses explicit CSV selection and preserves existing automatic backend selection.
Performance
Full
fused_moelatency reduction of the 159 replaced rows versus the previous model configs on gfx950 (median, with range):Token ranges list power-of-two buckets. Overall: DSV4 122 rows, median 9.9% (up to 33.9%); Kimi-K3 24 rows, median 6.6% (up to 26.7%); GPT-OSS 13 rows, median 9.4% (up to 24.7%); all 159 rows, median 9.8%.
Test Plan
CPU suites at
edab5008fa, each module in its own process (89 tests, all passed;test_fast_tuningandtest_config_shape_collisionneed one visible GPU for arch detection):GPU validation at
edab5008fa(gfx950, FlyDSL 0.4.0):op_tests/flydsl_tests/test_mxfp4_flydsl_coupled.py: 90 passed, covering A4W4/A8W4 coupled pairs at BM16/32/64/128 with Silu/Situv2/Swiglu, the runtime bias switch, BM16 producer/consumer, BM128 fixed-input repeats and GEMM1 stores on both sides of the 2 GiB payload boundary.gemm_moe_tune.py --mxfp4-flydslon one A4W4 DSV4.1 shape (token 1, 5120/640/384/6): all 192 candidates evaluated and the winner written.Pre-rebase GPU validation covered:
cosine_diff_compare <= 0.1, and element mismatch ratio<= 0.05atrtol=0.1,atol=0.05.0xFFpoison, valid-byte coverage, load bounds, selectors, and compiled auxiliary availability on both sides of the sorting crossover.Fixed-configuration benchmarks showed higher latency for the sampled OPUS pairs than existing FlyDSL pairs. The public CSV executions above and the performance results retain their original pre-rebase source revisions.