Skip to content

[FlyDSL] [JIT] [gfx1250] Optimize grouped MXFP4 native prefill GEMM scheduling - #7431

Open
yanguahe wants to merge 90 commits into
mainfrom
hyg_opt_moe_a4w4_prefill_dsv41
Open

yanguahe wants to merge 90 commits into
mainfrom
hyg_opt_moe_a4w4_prefill_dsv41

Conversation

@yanguahe

@yanguahe yanguahe commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Select scheduling by operand layout, tile geometry, K pipeline length and cluster requirements; kernel identifiers and runtime predicates contain no model or experiment-version names. Share the clustered persistent A4W4 pipeline between fused GEMM1 and plain GEMM2.
  • Reuse LDS/ring addresses and cluster-compatible packed operands/scales; keep legal WMMA initialization/reuse and compatible next-N prefetch. Retain every valid K contribution, FP32 accumulation, partial-M output bounds and required synchronization.
  • Partition persistent N sweeps in K-ring-aligned chunks, validating expert ownership and compatible B multicast per M peer. Extend shared CM1/2/4, CN2/4 schedules, bound partial-M computation, and retire output DMA before LDS reuse. Group/reverse adjacent CM1 GEMM1 owners using N-partition properties.
  • Share ordinary short-row mainloops and activation dispatch. Skip back-row WMMA only when the complete row range is invalid; preserve valid-row arithmetic and operand issue scheduling.
  • Retain fused activation/requantization, activation limits, MXFP4/E8M0 formats and independent GEMM1 input/output layouts. Preserve split-K, K-tail, EP/S1F hooks and the ordinary-input path.
  • Consume the SSA returned by sched_vgpr, resolving the FlyDSL 0.5 rocdl.experimental namespace. Compute pin from kernel tile geometry instead of requiring AITER_FLYDSL_EXPLICIT_VGPR_PARTITION; apply occupancy hints per eligible kernel.
  • Pass outputs, scales and optional address placeholders through one Pointer ABI, reusing tensor_shim._run_compiled. Keep device and constexpr/layout/mode specialization keys; remove duplicate bounded Tensor views and their metadata-only cache branches.
  • Preserve complete APRE inverse-map preparation for grouped dispatch.

Code-size cleanup validation — 2026-11-26

The final compact commit is d312b4642ebb34fb39b713997ce47af9a3bbd125, with optimized release
275e5483d5e9d890e2306c3d0b243a36c9abee02 as the behavior/performance reference and
95d21128485c56fbadb37d5d158508985da5615b as the frozen PR comparison base. Excluding only root
run_moe_benchmark.py and test_moe_ep.py, additions plus deletions decrease
from 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.

  • Scope: 102 workloads / 204 GEMM entries, 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.
  • Fresh CPU compilation on both sides: 131/131 contracts per side,
    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.
  • 54/54 GPU correctness executions, 30/30 accepted idle worker guards,
    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.
  • Independently verified 1,713 archived files, complete ELF bytes, original
    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.
  • Pushed to the PR branch and pulled into e08-1, preserving its original
    modified test file byte-for-byte. op_tests/ and
    aiter/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.md and
my_code/pr_7431_compact_20261125/README.md. The complete evidence archive is
phase_ce_complete_acceptance_evidence.zip, SHA256
7fd36327dd47660857141768ff5a4d7388ed2daaa9c2ac8ef5f8640375a72bc8, retained locally and under the same
my_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 afce0474ef1eb1f56eda381e43a3ded6b8491400 now 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; FlyDSL 0.5.0, PyTorch 2.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. Maximum logits_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/1 for 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. Original run_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.

Workload GEMM1 μs (B,A) GEMM2 μs (B,A) GEMM1 TFLOPS (B,A) GEMM1 BW GB/s (B,A) GEMM2 TFLOPS (B,A) GEMM2 BW GB/s (B,A) GEMM1 Δ% GEMM2 Δ%
E64/T1/topk8/M7168/I2048, balanced (14.259,14.305) (9.237,9.107) (32.9,32.8) (8753.8,8725.7) (25.4,25.8) (6767.7,6864.3) 0.322 -1.408
E64/T2/topk8/M7168/I2048, balanced (16.336,16.415) (10.321,10.268) (57.5,57.2) (15281.7,15208.3) (45.5,45.8) (12113.7,12176.9) 0.483 -0.519
E64/T4/topk8/M7168/I2048, balanced (26.370,26.427) (14.570,14.575) (71.3,71.1) (18933.3,18892.5) (64.5,64.5) (17162.4,17156.9) 0.216 0.032
E64/T8/topk8/M7168/I2048, balanced (52.412,52.519) (27.079,27.009) (71.7,71.6) (19052.0,19013.4) (69.4,69.6) (18468.7,18516.3) 0.203 -0.257
E64/T16/topk8/M7168/I2048, balanced (52.588,52.821) (27.210,27.181) (142.9,142.3) (18994.1,18910.5) (138.1,138.3) (18416.0,18435.5) 0.442 -0.106
E64/T32/topk8/M7168/I2048, balanced (52.473,52.648) (27.395,27.349) (286.5,285.5) (19047.9,18984.7) (274.4,274.8) (18363.4,18394.5) 0.333 -0.169
E64/T64/topk8/M7168/I2048, balanced (53.219,53.679) (27.566,27.538) (565.0,560.1) (18805.4,18643.3) (545.3,545.9) (18393.2,18411.6) 0.864 -0.100
E64/T128/topk8/M7168/I2048, balanced (53.382,53.533) (27.827,27.894) (1126.4,1123.2) (18794.1,18740.9) (1080.4,1077.8) (18504.1,18459.7) 0.284 0.240
E64/T256/topk8/M7168/I2048, balanced (56.929,56.757) (29.201,29.055) (2112.4,2118.8) (17711.0,17764.6) (2059.2,2069.5) (18174.3,18265.5) -0.302 -0.499
E64/T512/topk8/M7168/I2048, balanced (60.669,61.167) (33.940,32.684) (3964.5,3932.1) (16784.6,16647.7) (3543.3,3679.5) (16567.6,17204.3) 0.822 -3.702
E64/T1024/topk8/M7168/I2048, balanced (102.907,103.559) (59.597,57.389) (4674.5,4645.1) (10090.2,10026.7) (4035.7,4191.1) (10495.1,10899.0) 0.633 -3.705
E64/T1536/topk8/M7168/I2048, balanced (84.511,73.645) (55.189,48.587) (8538.0,9797.8) (12523.9,14371.8) (6537.2,7425.5) (12478.2,14173.8) -12.858 -11.963
E64/T2048/topk8/M7168/I2048, balanced (85.887,78.952) (60.135,52.832) (11201.7,12185.5) (12556.8,13659.7) (7999.3,9105.1) (12502.3,14230.6) -8.074 -12.145
E64/T4096/topk8/M7168/I2048, balanced (142.645,125.185) (113.788,92.115) (13489.1,15370.4) (8122.8,9255.7) (8455.1,10444.3) (8828.3,10905.3) -12.240 -19.047
E64/T6144/topk8/M7168/I2048, balanced (216.388,186.301) (162.791,133.728) (13338.2,15492.3) (5725.4,6650.0) (8864.8,10791.4) (7723.1,9401.5) -13.904 -17.853
E64/T8192/topk8/M7168/I2048, balanced (274.262,236.551) (218.207,169.751) (14031.5,16268.3) (4809.7,5576.4) (8818.0,11335.1) (6919.8,8895.1) -13.750 -22.207
E64/T16384/topk8/M7168/I2048, balanced (527.374,467.141) (405.031,342.530) (14594.2,16475.9) (3109.7,3510.7) (9501.2,11234.9) (6223.7,7359.3) -11.421 -15.431
E65/T1/topk9/shared1/M7168/I2048, balanced (7.962,8.350) (5.127,5.343) (66.4,63.3) (17637.5,16819.3) (51.5,49.5) (13716.4,13167.8) 4.872 4.209
E65/T2/topk9/shared1/M7168/I2048, balanced (15.519,15.751) (9.011,9.149) (68.1,67.1) (17091.3,16840.2) (58.7,57.8) (14744.2,14521.4) 1.491 1.539
E65/T4/topk9/shared1/M7168/I2048, balanced (28.060,28.011) (14.905,15.067) (75.3,75.5) (18349.9,18381.9) (70.9,70.2) (17304.4,17117.9) -0.174 1.090
E65/T8/topk9/shared1/M7168/I2048, balanced (54.031,53.997) (27.256,27.450) (78.2,78.3) (18770.6,18782.8) (77.6,77.0) (18639.4,18507.2) -0.064 0.714
E65/T16/topk9/shared1/M7168/I2048, balanced (53.387,53.854) (27.373,27.253) (158.4,157.0) (19003.7,18839.0) (154.5,155.1) (18600.3,18681.8) 0.874 -0.436
E65/T32/topk9/shared1/M7168/I2048, balanced (55.341,55.571) (27.126,27.026) (305.6,304.3) (18345.6,18269.6) (311.7,312.9) (18851.6,18921.0) 0.416 -0.367
E65/T64/topk9/shared1/M7168/I2048, balanced (57.451,57.661) (27.740,27.689) (588.7,586.6) (17696.3,17631.8) (609.6,610.8) (18594.2,18628.3) 0.365 -0.183
E65/T128/topk9/shared1/M7168/I2048, balanced (58.107,57.110) (28.507,28.434) (1164.2,1184.5) (17545.0,17851.2) (1186.5,1189.5) (18405.4,18453.0) -1.716 -0.258
E65/T256/topk9/shared1/M7168/I2048, balanced (60.662,60.110) (30.249,30.008) (2230.3,2250.7) (16899.1,17054.2) (2236.3,2254.3) (17933.1,18077.4) -0.910 -0.798
E65/T512/topk9/shared1/M7168/I2048, balanced (66.040,66.207) (34.724,35.379) (4097.3,4086.9) (15693.7,15653.9) (3896.2,3824.0) (16645.3,16337.2) 0.254 1.886
E65/T1024/topk9/shared1/M7168/I2048, balanced (95.222,87.586) (47.933,47.116) (5683.4,6178.7) (11121.3,12090.5) (5645.2,5742.9) (13541.5,13775.9) -8.019 -1.705
E65/T1536/topk9/shared1/M7168/I2048, balanced (97.923,89.161) (62.006,56.011) (8289.7,9104.4) (11044.7,12130.1) (6545.8,7246.4) (11614.2,12857.2) -8.948 -9.668
E65/T2048/topk9/shared1/M7168/I2048, balanced (100.244,92.931) (66.719,62.042) (10797.1,11646.6) (11014.1,11880.7) (8111.2,8722.6) (11859.0,12753.0) -7.295 -7.010
E65/T4096/topk9/shared1/M7168/I2048, balanced (160.161,150.471) (125.688,110.051) (13515.5,14385.9) (7457.0,7937.3) (8611.2,9834.8) (8557.0,9772.8) -6.050 -12.441
E65/T6144/topk9/shared1/M7168/I2048, balanced (243.637,217.247) (178.362,167.107) (13327.2,14946.1) (5272.5,5913.0) (9102.3,9715.3) (7623.9,8137.3) -10.832 -6.310
E65/T8192/topk9/shared1/M7168/I2048, balanced (303.654,267.526) (241.301,206.227) (14257.4,16182.8) (4527.6,5139.0) (8970.8,10496.5) (6813.5,7972.3) -11.898 -14.536
E65/T16384/topk9/shared1/M7168/I2048, balanced (589.274,529.333) (457.322,382.259) (14693.8,16357.7) (2945.6,3279.2) (9466.7,11325.6) (6081.7,7275.9) -10.172 -16.414

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:

python3 -u run_moe_benchmark.py --dsr1 --bln --container dsr1_ep4
python3 -u run_moe_benchmark.py --dsr1 --bln --fused_sha_exp --container dsr1_ep4

Artifacts on a07-3: /data/yanguahe/code/wk_sp1/at_merge/.codex_tmp/pr7431_branch_comparison_20261116/. suite.json maps all four runs; validated_comparison.json preserves 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, from ROCm/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 16384 in 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, FlyDSL 0.4.1.dev1005, PyTorch 2.10.0+rocm7.12.0a20260308, with AITER_LOG_MORE=0 --warmup 5 --iters 101 --seed 0 --data-init uniform --scale-init auto, SiLU, no bias and the unchanged run_perftest(testGraph=False) profiler timer. APRE, tiles, clusters and WPT follow committed CSV defaults; inherited tuning overrides are cleared. AITER_MOE_NUM_EXPERT_ACTIVATED=0 leaves 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_ids collected 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_eb2355c0 completed at 2026-11-11T17:16:47.966342+00:00 UTC: 6/6 processes, 102/102 case samples, with maximum logits_diff=3.65196968e-06 (<0.01).

Workload GEMM1 μs
(A0, A1, A*)
GEMM1 TFLOPS
(A0, A1)
GEMM1 BW GB/s
(A0, A1)
GEMM2 μs
(A0, A1, A*)
GEMM2 TFLOPS
(A0, A1)
GEMM2 BW GB/s
(A0, A1)
Pin1 vs pin0 latency change %
(GEMM1, GEMM2)
E64/T1/topk8/M7168/I2048, balanced (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)
E64/T2/topk8/M7168/I2048, balanced (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)
E64/T4/topk8/M7168/I2048, balanced (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)
E64/T8/topk8/M7168/I2048, balanced (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)
E64/T16/topk8/M7168/I2048, balanced (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)
E64/T32/topk8/M7168/I2048, balanced (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)
E64/T64/topk8/M7168/I2048, balanced (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)
E64/T128/topk8/M7168/I2048, balanced (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)
E64/T256/topk8/M7168/I2048, balanced (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)
E64/T512/topk8/M7168/I2048, balanced (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)
E64/T1024/topk8/M7168/I2048, balanced (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)
E64/T1536/topk8/M7168/I2048, balanced (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)
E64/T2048/topk8/M7168/I2048, balanced (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)
E64/T4096/topk8/M7168/I2048, balanced (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)
E64/T6144/topk8/M7168/I2048, balanced (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)
E64/T8192/topk8/M7168/I2048, balanced (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)
E64/T16384/topk8/M7168/I2048, balanced (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_merge on a07-3; the archived driver executes the canonical test inside hyg_fyd1:

python3 -u run_moe_benchmark.py --dsr1 --bln

For the exact archived pin0/pin1 sweep and full environment cleanup, use this run's driver.py and *_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:

/data/yanguahe/code/wk_sp1/at_merge/my_code/e64_balanced_pin_benchmark_logs/20261111_171554_781593_eb2355c0/summary.md

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 exact driver.py and CSV snapshot, and artifact_sha256.json. The task-level sweep_status.json and idle histories are in my_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.

yadaish and others added 30 commits October 15, 2026 11:14
# 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.
@zufayu
zufayu removed the request for review from coderfeli November 11, 2026 06:56
@zufayu zufayu assigned aoli26 and unassigned coderfeli Nov 11, 2026
@zufayu
zufayu requested a review from coderfeli November 11, 2026 06:56
yanguahe added a commit that referenced this pull request Nov 15, 2026
Copy the six T>=1536 recipes verbatim from ROCm/aiter PR #7431 (eb2355c), retaining PW0 and the existing config lookup behavior.

Validation: six balanced random input token counts at pin1, three samples each. All 18 reference comparisons and all-GPU idle gates passed; git diff --check passed.
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.
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.
@github-actions github-actions Bot changed the title [FlyDSL] [gfx1250] Optimize grouped MXFP4 native prefill GEMM scheduling [FlyDSL] [JIT] [gfx1250] Optimize grouped MXFP4 native prefill GEMM scheduling Nov 17, 2026
@github-actions github-actions Bot added the JIT label Nov 17, 2026
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.
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants