Repository navigation
[FlyDSL] Add gfx1250 grouped MoE A-preshuffle and tuned CSV validation - #6709
Conversation
# Conflicts: # aiter/configs/tuned_grouped_fmoe.csv
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
Resolve grouped MoE AOT and CSV conflicts while preserving the test removals in f073496. Retain main's quant-layout checks alongside branch A-preshuffle coverage and dual-CSV sweep behavior.
#6709 added an a_preshuffle column to tuned_grouped_fmoe.csv without a blank-cell value, so retuning a row of the production table raises, and two test_tuner_infra tests fail on main. grouped_moe_gfx1250 reads a blank a_preshuffle as 0. Co-authored-by: Cursor <[email protected]>
#6709 added an a_preshuffle column to tuned_grouped_fmoe.csv without a blank-cell value, so retuning a row of the production table raises, and two test_tuner_infra tests fail on main. grouped_moe_gfx1250 reads a blank a_preshuffle as 0. Co-authored-by: Cursor <[email protected]>
#6709 added an a_preshuffle column to tuned_grouped_fmoe.csv without a blank-cell value, so retuning a row of the production table raises, and two test_tuner_infra tests fail on main. grouped_moe_gfx1250 reads a blank a_preshuffle as 0.
#6709 added an a_preshuffle column to tuned_grouped_fmoe.csv without a blank-cell value, so retuning a row of the production table raises, and two test_tuner_infra tests fail on main. grouped_moe_gfx1250 reads a blank a_preshuffle as 0.
#6709 added an a_preshuffle column to tuned_grouped_fmoe.csv without a blank-cell value, so retuning a row of the production table raises, and two test_tuner_infra tests fail on main. grouped_moe_gfx1250 reads a blank a_preshuffle as 0.
tuned_grouped_fmoe.csv: keep main's rows for the 11 7168x3072 E96 keys that #6709 re-tuned, and apply this branch's values only to the 6 7168x768 E384 keys that main left unchanged (a_preshuffle stays 0).
…to-select in --compare (#5846) * mp_tuner: report a typed status per candidate; a fault fails only that candidate With return_status=True, mp_tuner returns (info, us, err_ratio, status, detail), where status is ok, mismatch, unsupported, crash, timeout, zero_time (still 0 us after the retries), oom_runtime, oom_preflight or not_run. When a worker dies, times out or its group raises, the candidate it was running fails, what its group measured before it is kept, and the rest of the group is resubmitted to the restarted pool, for typed and untyped callers alike. A group that faults 5 times in a row without measuring anything returns its remaining candidates as not_run. A fault is an AcceleratorError or an error after which torch.cuda.synchronize() fails; the worker raises GpuContextLost so the parent restarts the pool. * run_config verifies the dispatch of the row it times; --compare can time auto-select Tuned rows may carry gpu_model (chip_info.get_gpu_model, overridable with AITER_GPU_MODEL): gfx and cu_num cannot tell MI300X from MI325X, or MI350X from MI355X. The model comes from the HIP device name or, for the gfx950 parts an older libdrm does not name, from the PCI device ID as upstream libdrm's amdgpu.ids lists it. Rows without it match as before. comm_fused_moe_host reuses chip_info's model lookup, so the PCI table exists once. dispatch_verification runs a row through the public op in a fresh process, with the family's config variable pointing at the candidate CSV, and checks the selection dispatch recorded against the one the row names. A family opts in with SELECTION_PROBE_MODULE; run_config then verifies each shape's row from the active config file and reports a stale or failed row as an error. Verification and the auto-select run see the model_configs/ merge serving sees. With COMPARE_AUTOSELECT, --compare also times auto-select (a header-only table), and --update_improved drops a row auto-select beats and writes no row for a candidate that does not beat it. stale_reason lets a family mark a row its dispatch would skip, so a plain run retunes it. * GroupedFmoeTuner: a blank a_preshuffle cell reads as 0 #6709 added an a_preshuffle column to tuned_grouped_fmoe.csv without a blank-cell value, so retuning a row of the production table raises, and two test_tuner_infra tests fail on main. grouped_moe_gfx1250 reads a blank a_preshuffle as 0. * mp_tuner: a shape without candidates no longer fails a shape-grouped batch A tuner adds an in_datas entry for every shape, with a count of 0 when no candidate supports the shape (gemm_a16w16 under --libtype flydsl for a preshuffled shape, opus_gemm for a non-bf16 one). Such a shape has no task group, so the shape-grouped path's group-count assert failed and the whole batch was lost, under --shape_grouped and in every --mp 1 run. Zero-count entries are now dropped before groups are matched to in_datas, so the shape is left untuned and reported as such, as the per-candidate path already does. * mp_tuner: a typed result carries watts, so a power tune ranks return_status callers return_status=True result was a plain 5-tuple, so under --select power its watts read as NaN and the tune wrote no rows for that caller. TuneStatusResult still unpacks as (info, us, err_ratio, status, detail). * mp_tuner: a stale PID map waits for the restart its root cause triggers, as on main A group that hits a worker missing from the PID-to-GPU map stays queued and is resubmitted in the restart the dead worker's own fault triggers. Restarting on the KeyError itself could restart before that fault was polled, so the candidate that killed the worker ran again instead of failing. * run_config: verify a user's --run_config table as given Only a table the tuner wrote and times itself (--compare) stands in for the default table and is verified with the model_configs CSVs serving merges. A --run_config file is timed as given, so its dispatch check now reads it the same way. * base_tuner: no gpu_model key in the shared tuner No table the shared tuner handles carries gpu_model, and neither serving lookup nor the duplicate-shape keys read it, so a row filtered or checked by model here could not be told apart at runtime. A family that keys its table on the model end to end adds the check itself, and brings the model detection with it. * mp_tuner: return_status returns statuses alongside plain results A return_status result was a 5-tuple, so a family whose own overrides unpack (info, us, err_ratio) would fail the moment it opted in. Results are the 3-value TuneResult again for every caller; with return_status=True, mp_tuner returns (results, statuses), one (status, detail) per result in the same order. Workers carry one private record with all fields, so the status cannot be lost between the worker and the parent. --------- Co-authored-by: yzhou103 <[email protected]>
Motivation
Add a CSV-selectable A-preshuffled activation layout to gfx1250 A4W4 grouped MoE and make the existing TP/EP test entry points validate every applicable tuned configuration. CSV sweeps now use each selected file for runtime configuration lookup, including when switching between model-specific files.
Technical Details
a_preshufflefrom the matched tuning row through activation preparation and both grouped GEMMs. Add compact MXFP4 quantization followed by routed scatter into M16 payload tiles and M16K4 scales; prequantized inputs can enter scatter directly.topk=-1tuning sentinel out of compile-time route-count arithmetic.--csv-pathselects one file. Clear configuration lookup caches between files, support SiLU/Swiglu/Situv2, fix shared-expert reference mapping, and aggregate failures across selected files. Default sweeps exclude untuned configurations; TP skips EP rows.Test Plan
Validated on gfx1250 using the existing test entry points without
--csv-path:op_tests/flydsl_tests/test_flydsl_grouped_gemm.py --scenario csv --no-bias --iters 16 --no-check-aot-cache, with grouped GEMM enabled, CK disabled, and balanced routing. Run constant/constant and uniform/auto data/scale initialization with CUDA graphs and JIT allowed.op_tests/test_moe_ep.py -t ep_csv --ep-mode real, with four simulated ranks, top-k 8, and balanced routing. Validate local outputs only; distributed EP scatter-combine is outside this validation.ruff check .; whitespace:git diff --check.Test Result
All 200 applicable CSV rows passed, totaling 331 correctness checks. Both CSV processes exited successfully. The two
ep_fused=1rows were tested as local EP shapes; their fused scatter behavior was not validated. Ruff and whitespace checks passed.Performance comparison remains pending: existing priority-script measurements had concurrent GPU activity or substantial timing variation and do not support a stable speedup/regression claim.
Submission Checklist