Repository navigation
Conversation
# Conflicts: # aiter/configs/tuned_grouped_fmoe.csv
Rename the benchmark to reproduce.sh and pin the validated zero-input configuration. Include standalone activation/quantization dependencies and tests so the script does not rely on stashed implementation changes. Preserve unrelated work in stash. GPU timing was not rerun for this commit.
Use normal WMMA order with operand B reuse and precomputed payload LDS bases. Initialize accumulators before the prologue TDM wait and select WPT1 for the conc16384 tuned configuration. Include the local benchmark scripts and the reproducer iteration update.
Use the tile-selected VGPR policy and shared clustered persistent pipeline for native A4W4 prefill. Preserve valid K work, quantized output layouts, large-buffer pointer support, and EP scatter behavior. Keep persistent launch Tensor metadata bounded without copying buffers, key compatible ABI classes, and retain source-level GEMM2 throughput. Adapt the new BF16 direct combine reducer to the existing optional route mask, preserving dropped-route handling and shared-add rounding. Validate paired three-process medians, full logical output hashes, default dispatch, partial-M/K-tail inputs, host ABI boundaries, and first/cached combine calls with the pinned FlyDSL toolchain.
1 task
Retune Flash and Pro grouped MoE configurations, generalize short-tile and padding handling, add per-stage B cache hints, and balance persistent GEMM1 N sweeps. Validated 68 workloads with 136 latency checks and 204 correctness records passing.
Balance persistent N sweeps, reuse LDS stage addresses, and dispatch TDM tensor jobs through disjoint wave groups. Keep the ordinary-input buffer ABI and validate expert predictions against live prefix bounds. Validate 204/204 GEMM comparisons for balanced routed/shared workloads on e08-1/GPU3 against rocm_main@95d21128. Small-T changes stay within 1%; T>=1536 reduces each GEMM's time by at least 5%. All 612 accepted correctness and eager/CPU code checks, 34 config collision tests, Black and Ruff 0.16.0 pass.
4 of 10 tasks
Add a single-GPU rank-local MegaMoE compute benchmark with graph replay, stage-level profiler timing, routing fixtures, and accuracy checks. Mirror the DSR1, DSV4.1-Flash, and DSV4-Pro grouped MoE tuning rows under non-scatter EP keys, including token lookup gaps and large-token fallback. Validation: staged Python syntax and whitespace checks; 107 TP/EP config pairs and 856 CPU-only selector cases. GPU execution was not run.
Prefer exact grouped CSV matches, then the nearest larger compatible token bucket for gaps. Retain the largest-bucket fallback above the tuned range. Normalize the MegaMoE local compute CSV key with ceil(recv_tokens / ep), keeping all received rows in routing and GEMM computation. Log both the requested token key and the selected bucket. Validation: 1533 CPU checks covering 107 TP/EP configuration pairs; e08-1 hyg_fyd1 graph validation with warmup=5, iters=101, repeats=1 and acc_verify=1. EP4/T8192 per source rank/H7168/I2048/E256/topk8/shared1: recv_tokens=30345, query=7587, bucket=8192; APRE M256 GEMM1/GEMM2 correctness and replay passed.
This branch has not been deployed
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.
Summary
Improve gfx1250 grouped MXFP4 prefill compute with shared native-layout scheduling for fused GEMM1 and plain GEMM2, while retaining ordinary-input scheduling and existing EP/S1F hooks.
Motivation
Large prefill batches can use already-preshuffled operands and multicast compatible expert weights and scales across cluster peers. Apply these compute improvements to gemm1 && gemm2 while preserving small-batch and existing grouped-MoE performance. The current FlyDSL register API also requires consuming the SSA value returned by
rocdl.experimental.sched_vgpr. Persistent dispatch must distribute short N sweeps without replacing live expert ownership checks with balanced-route assumptions.Technical Details
sched_vgpr, resolving the FlyDSL 0.5rocdl.experimentalnamespace. Compute pin from kernel tile geometry instead of requiringAITER_FLYDSL_EXPLICIT_VGPR_PARTITION; apply occupancy hints per eligible kernel.tensor_shim._run_compiled. Keep device and constexpr/layout/mode specialization keys; remove duplicate bounded Tensor views and their metadata-only cache branches.Code-size cleanup validation — 2026-11-26
The final compact commit is
d312b4642ebb34fb39b713997ce47af9a3bbd125, with optimized release275e5483d5e9d890e2306c3d0b243a36c9abee02as the behavior/performance reference and95d21128485c56fbadb37d5d158508985da5615bas the frozen PR comparison base. Excluding only rootrun_moe_benchmark.pyandtest_moe_ep.py, additions plus deletions decreasefrom 3,570 to 1,997: 1,573 fewer lines (44.06%), strictly below 2,000.
Both the committed Git diff and GitHub PR files statistics confirm this count.
Share activation, scheduling and address/ring helpers, use one Pointer ABI, and
remove redundant CSV values that use the existing GEMM2 fallback. Preserve
short-K CM1 TDM output, valid row-group bounds for longer-K CM1 vector output,
and separate ordinary-input uniform fallback guards. The refactor adds no new
activation approximation or quantization format.
dsr1/dsv41_flash/dsv4_pro,shared0/shared1,T=1,2,4,8,16,32,64,128,256,512,1024,1536,2048,4096,6144,8192,16384.FlyDSL 0.5.0,
cache_hit=False, no GPU initialization or loaded GPU code.125 unique complete ELF pairs are byte-identical, covering 193/204 GEMM
entries. The remaining 11/11 pass adjacent B/A paired-median performance
acceptance; latency changes are -2.235401% to +0.848942%, strictly below
the 1% regression limit. 204/204 entries are accepted.
102/102 effective default configurations, 131/131 Pointer ABI contracts,
and 48/48 CPU host tests pass. Each workload has three adjacent B/A pairs,
each at most 60 seconds, on e08-1 /
hyg_fyd1/HIP_VISIBLE_DEVICES=3.Actual eager GPU ELF bytes match the CPU artifacts; original
run_perftest(testGraph=False)/ torch.profiler uses warmup=5, iters=101.All physical GPUs are checked idle before and after workers, without monitoring
during timing; disturbed pairs are retained and excluded.
samples, medians, TFLOPS/BW calculations and idle/adjacency evidence in the
local workspace. All 8,535 committed Git blobs match the accepted source;
Black 26.5.1, Ruff 0.16.0 and diff whitespace checks pass.
modified test file byte-for-byte.
op_tests/andaiter/ops/flydsl/kernels/mega_moe_gfx1250/have no remaining PR diff.Reproducible commands and the nine-workload detailed timing/TFLOPS/BW record
are retained in local
my_code/moe_config_opt.mdandmy_code/pr_7431_compact_20261125/README.md. The complete evidence archive isphase_ce_complete_acceptance_evidence.zip, SHA2567fd36327dd47660857141768ff5a4d7388ed2daaa9c2ac8ef5f8640375a72bc8, retained locally and under the samemy_code/pr_7431_compact_20261125/path on e08-1.This is validation against the frozen optimized release, not a new measurement
against newer main. GitHub main
afce0474ef1eb1f56eda381e43a3ded6b8491400now pins FlyDSL 0.5.3;its merge conflicts and revalidation are outside this frozen compaction record.
The two dated performance sections below retain their original revisions and values.
Current PR before / after: balanced E64 and E65/shared1 in dsr1_ep4 — 2026-11-16
B (PR before) =
ROCm/aiter:rocm_main,95d21128485c56fbadb37d5d158508985da5615b; A (PR after) =ROCm/aiter:hyg_opt_moe_a4w4_prefill_dsv41,fe8c87751e0850022ab861822f228997e87ac37a.a07-3 /
dsr1_ep4; FlyDSL0.5.0, PyTorch2.11.0+rocm10.1.0a20260811-bkc.20260820. Canonical grouped test; balanced routing, uniform random input, auto scales, SiLU/no bias;AITER_LOG_MORE=0 --warmup 5 --iters 101 --seed 0. 408/408 numerical gates passed; six original fresh-process samples per token/version, pooled across requested pin0/pin1. Maximumlogits_diff=3.895995882e-06(<0.01). All GPUs checked idle before/after each process; no monitoring during timing. Order: E64 B/A, E65 A/B; middle repeat reverses pin order.Every metric tuple is (B,A). Each latency, TFLOPS and BW value is the median of all six original samples pooled across requested
AITER_FLYDSL_EXPLICIT_VGPR_PARTITION=0/1for that workload/version. Both branches actually choose VGPR placement from tile geometry (256x256x256 remains pinned at requested pin0). All six launches per workload/version use identical configurations. APRE/tile/cluster/WPT/persistent use branch defaults; inherited overrides are cleared. GEMM1 excludes input preparation and includes fused activation/requantization. Originalrun_perftest(testGraph=False)/ torch.profiler timer.Δ% =
(A/B-1)*100, calculated from the pooled latency medians; negative means lower latency. BW counts logical quantized inputs/weights/E8M0 scales and actual fused outputs, once per active expert for weights; effective BW, not measured HBM traffic.This is a default-configuration PR before/after comparison. 11 of 68 pooled workload/kernel medians increase by >0.5%; all changes are shown above.
Run on the host from each complete frozen revision:
Artifacts on a07-3:
/data/yanguahe/code/wk_sp1/at_merge/.codex_tmp/pr7431_branch_comparison_20261116/.suite.jsonmaps all four runs;validated_comparison.jsonpreserves the original requested-pin medians/deltas/launch keys. Pooled raw samples, unrounded medians and recalculated deltas are in/data/yanguahe/code/wk_sp1/at_merge/.codex_tmp/pr7431_pooled_medians_20261116/pooled_comparison.json. Run folders retain samples, stdout, exact commands, source hashes, launch audits and idle histories. The driver uses the selected canonical CLI via runpy: observe each eager launch before timing, serialize device fields safely, collect active experts after timing, preserve full-precision results.Additional E64 Pin Performance — 2026-11-12
These refreshed same-source pin measurements use after_pr
eb2355c0c37234da03e7407885e0f185b14d7e07, fromROCm/aiter:hyg_opt_moe_a4w4_prefill_dsv41. All recorded test/config/kernel source hashes match that committed revision.All 102/102 original numerical correctness gates passed. Each sweep directly calls
op_tests/flydsl_tests/test_flydsl_grouped_gemm.py --tokens 1 2 4 8 16 32 64 128 256 512 1024 1536 2048 4096 6144 8192 16384in six fresh processes: pin0 and pin1 each repeated three times, with seventeen token cases in every process. Each token/pin median therefore uses three samples; the middle pair runs in reverse pin order.Header markers: A0 = after_pr/requested pin0, A1 = after_pr/requested pin1, A = the lower-latency selected pin for that GEMM*. Each workload occupies one row. Latency tuples are
(A0 median μs, A1 median μs, selected pin0/pin1); TFLOPS and BW tuples are(A0 median, A1 median). GEMM1 and GEMM2 select independently from unrounded medians; pin0 wins an exact tie. The final column is(GEMM1, GEMM2)pin1 relative to pin0, using(pin1 / pin0 - 1) * 100; positive means slower.Tests ran on a07-3 /
hyg_fyd1, FlyDSL0.4.1.dev1005, PyTorch2.10.0+rocm7.12.0a20260308, withAITER_LOG_MORE=0 --warmup 5 --iters 101 --seed 0 --data-init uniform --scale-init auto, SiLU, no bias and the unchangedrun_perftest(testGraph=False)profiler timer. APRE, tiles, clusters and WPT follow committed CSV defaults; inherited tuning overrides are cleared.AITER_MOE_NUM_EXPERT_ACTIVATED=0leaves the requested routing mode in effect. The task controller confirmed all GPUs idle before and after each complete sweep; the benchmark driver performs no GPU-idle checks. Actual specialization keys are preserved in the per-case launch audits; eager observation is removed before any timing.BW accounting: weight payloads and E8M0 scales are counted once per actually active expert, using distinct nonnegative
topk_idscollected after timing. Quantized input payloads/scales and logical post-activation BF16 outputs use the existing effective-byte model. Values are computed from full-precision samples before taking medians. This is effective bandwidth, not measured physical HBM traffic; no bandwidth clipping or reconstructed active counts are used.E64/topk8/M7168/I2048, balanced: seventeen T values, after_pr pin0 / pin1
Run
20261111_171554_781593_eb2355c0completed at 2026-11-11T17:16:47.966342+00:00 UTC: 6/6 processes, 102/102 case samples, with maximumlogits_diff=3.65196968e-06(<0.01).(A0, A1, A*)(A0, A1)(A0, A1)(A0, A1, A*)(A0, A1)(A0, A1)(GEMM1, GEMM2)(18.469326, 18.588222, pin0)(25.435, 25.272)(6759.520, 6716.284)(5.899940, 5.813740, pin1)(39.811, 40.401)(10595.644, 10752.745)(+0.643749, -1.461032)(23.107244, 23.082529, pin1)(40.659, 40.703)(10805.596, 10817.166)(7.663465, 9.853404, pin0)(61.299, 47.675)(16314.726, 12688.745)(-0.106957, +28.576362)(30.969927, 45.706553, pin0)(60.673, 41.111)(16124.517, 10925.679)(15.474826, 28.231735, pin0)(60.713, 33.279)(16158.802, 8857.219)(+47.583664, +82.436525)(52.850224, 60.793582, pin0)(71.108, 61.817)(18897.748, 16428.547)(27.038025, 34.592415, pin0)(69.497, 54.320)(18496.518, 14457.196)(+15.029940, +27.939871)(52.804697, 60.696830, pin0)(142.339, 123.832)(18923.621, 16463.068)(27.193787, 34.838795, pin0)(138.197, 107.871)(18426.872, 14383.289)(+14.945892, +28.113067)(52.964540, 61.015798, pin0)(283.820, 246.369)(18885.612, 16393.587)(27.415443, 35.088247, pin0)(274.159, 214.208)(18349.903, 14337.300)(+15.201223, +27.987160)(53.425340, 61.757677, pin0)(562.744, 486.818)(18760.596, 16229.419)(27.629487, 35.495827, pin0)(544.070, 423.497)(18350.658, 14283.912)(+15.596226, +28.470813)(53.600227, 62.222500, pin0)(1121.815, 966.363)(18774.884, 16173.218)(27.924413, 35.825136, pin0)(1076.648, 839.209)(18439.649, 14373.047)(+16.086263, +28.293248)(55.322061, 65.237740, pin0)(2173.800, 1843.397)(18336.839, 15549.768)(29.039171, 38.927835, pin0)(2070.636, 1544.641)(18275.678, 13633.189)(+17.923554, +34.052848)(60.688600, 67.512720, pin0)(3963.152, 3562.561)(16982.088, 15265.555)(31.559000, 38.107556, pin0)(3810.611, 3155.781)(17817.386, 14755.575)(+11.244484, +20.750200)(103.162899, 197.758907, pin0)(4662.881, 2432.438)(10304.033, 5375.201)(59.398828, 119.500420, pin0)(4049.207, 2012.697)(10530.100, 5234.087)(+91.695764, +101.183127)(77.947630, 78.720260, pin0)(9256.914, 9166.058)(14052.624, 13914.699)(56.148120, 56.053610, pin1)(6425.456, 6436.289)(12264.922, 12285.601)(+0.991217, -0.168323)(86.237814, 84.708920, pin1)(11156.042, 11357.395)(13077.134, 13313.161)(58.612510, 58.404680, pin1)(8207.059, 8236.264)(12827.108, 12872.753)(-1.772882, -0.354583)(147.827800, 142.358110, pin1)(13016.127, 13516.233)(8504.778, 8831.549)(107.546720, 104.694511, pin1)(8945.625, 9189.333)(9340.460, 9594.923)(-3.700042, -2.652065)(214.436663, 199.918711, pin1)(13459.536, 14436.958)(6466.906, 6936.528)(159.493959, 159.043796, pin1)(9048.048, 9073.658)(7882.697, 7905.009)(-6.770275, -0.282245)(273.995570, 253.434628, pin1)(14045.084, 15184.550)(5533.815, 5982.769)(216.427323, 216.016156, pin1)(8890.492, 8907.414)(6976.704, 6989.984)(-7.504115, -0.189979)(544.288700, 496.892879, pin1)(14140.623, 15489.418)(3737.424, 4093.915)(407.725500, 407.748798, pin0)(9438.435, 9437.896)(6182.534, 6182.181)(-8.707846, +0.005714)Host commands and artifacts
Recorded host entry point at the tested revision, from
/data/yanguahe/code/wk_sp1/at_mergeon a07-3; the archived driver executes the canonical test insidehyg_fyd1:For the exact archived pin0/pin1 sweep and full environment cleanup, use this run's
driver.pyand*_command.json; current driver defaults may differ from this dated run. Each process passes all seventeen values after--tokens.Full-precision medians, samples, commands, stdout, source hashes and eager launches remain in:
Each directory contains
summary.json/csv/md,metadata.json,*_tokens_pin*_repeat*.log/json,*_command.json, per-case*_t*_pin*_repeat*.json,*_launch.json, the exactdriver.pyand CSV snapshot, andartifact_sha256.json. The task-levelsweep_status.jsonand idle histories are inmy_code/e64_e65_pin_benchmark_refresh_20261112/. Publication checks recomputed every displayed median and verified byte/rate consistency, direct multi-token commands, original correctness gates, repeated launch configurations and all artifact/source hashes.