Repository navigation
Conversation
Wait for all VMEM operations before exposing the next LDS tile, and keep scale loads after the DMA group. Remove the unused partial-wait estimate. Add async-versus-sync, repeatability, and graph replay coverage on gfx950. Signed-off-by: Kevin Mi <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
|
Advisory review (static + hand-run; not a merge gate). Validation/Perf ran no GPU stage — reasons are on their lines below. Findings tagged Replaces the tile-derived partial VMEM wait before the MoE stage-1 K-loop barrier with a full s_waitcnt(0) drain and adds a scheduling fence after the LDS-DMA prefetch group, so a consumer wave can no longer read an incompletely populated LDS tile. Review (advisory): 📝 [inferred] The async-vs-sync oracle in op_tests/test_flydsl_moe_lds_dma.py carries rtol=atol=0.02, but both paths load identical quantized values through the same MFMA sequence, so bitwise equality is the expected result and the 2% slack could mask a small systematic async-path discrepancy (the repeat checks are already exact, rtol=0/atol=0). Reviewer should ask whether the async-vs-sync comparison also passes at rtol=0/atol=0, and if not, why. |
Measured on MI355X (DeepSeek-V4.1-Flash TP4, DSpark EP4) with AITER_BF16_FP8_MOE_BOUND=0, as the AMD DeepSeek-V4 tests and cookbook set it: - the stage-1 LDS-DMA drain: GSM8K 0.885 unpatched vs 0.905 patched (200 questions), throughput within noise, and its race test passes unpatched; it stays upstream as ROCm/aiter#5561; - the bf16 SiLU route is never taken at bound 0; the fix is ROCm/aiter#5802; - the tuned FMoE CSV shows no end-to-end gain; it stays upstream as ROCm/aiter#5562. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* DSV4.1 ATOM-port local fixes (flydsl MoE LDS-DMA wait, fp4 prefill cache, MoE tuner GPU datagen, torch.Stream, tuned FMoE CSV) - flydsl mixed MoE stage1: full vmcnt drain + sched_barrier before the LDS-DMA barrier (partial waits let LDS-DMA loads cross it; #5561) - fp4 prefill mqa logits: unbounded kernel cache (lru_cache(32) evicted and recompiled per shape) - MoE tuner: generate the E x 2I x H test weights on the GPU (CPU fp4 packing took tens of minutes per shape at E=385) - cpp_itfs torch_utils: accept any torch.Stream (derive the HIP handle when cuda_stream is missing) - add DSV4.1 TP2 shared-experts-fusion fp8/fp4 tuned FMoE config * Merge DSV4.1 TP2 fp8/fp4 FMoE tuning into dsv41_fp4_{tuned,untuned}_fmoe.csv - move the 23 shared-experts-fusion rows (E385 topk7, E129 topk4, fp8 activation x fp4 weight) into dsv41_fp4_tuned_fmoe.csv and their shapes into dsv41_fp4_untuned_fmoe.csv instead of a separate file - drop the torch_utils, fp4 prefill cache and flydsl stage1 wait changes --------- Co-authored-by: wunhuang <[email protected]>
|
Rebased the work onto current main via a normal merge in 1351b12 and tightened the async-vs-sync assertion to exact equality ( Fresh validation on gfx950, ROCm 10 / PyTorch 2.11 / FlyDSL 0.4, with separate fresh FlyDSL caches:
Keeping this PR in draft. The remaining requirements from the review still stand: a failing baseline or an assembly-level ordering check, a justified audit of sibling partial-wait pipelines (including |
|
Follow-up on whether an existing flag or current main supersedes this PR:
So I could not confirm a flag or compiler change that makes this patch redundant. Both sides still pass the exact-equality stress/replay tests. That establishes neither a current bug nor its absence. Keeping this draft pending a discriminating reproduction/ordering justification and a controlled performance comparison; the description now reflects the current base and validation. |
Motivation
Investigate the gfx950 FlyDSL MoE stage-1 LDS-DMA ordering concern originally carried by sgl-project/sglang#39186. This remains a draft: the current tests do not reproduce a failure on unpatched main, so the necessity and performance tradeoff of the stronger synchronization are not established.
Change
s_waitcnt(0)before the tile barrier. The heterogeneous async path already drains VMEM.Updated onto main
1dd826c42b38aa71adf058053b9c512a9b47d20fwith a normal merge; current head1351b12745203860de6cba4c37f04430137cd102.Validation
On MI355X gfx950, ROCm 10, PyTorch 2.11, FlyDSL 0.4:
rtol=atol=0and a fresh FlyDSL cache.vmcnt(6)for t64x128,vmcnt(10)for t64x256, andvmcnt(8)for t128x128. The corresponding patched body barriers followvmcnt(0). The compiler has not made the patch a no-op; this difference alone does not prove a correctness bug.The earlier ROCm 7.2.4 / MI350X test also passed on both patched and unpatched code.
Flags and remaining work
TRITON_HIP_USE_ASYNC_COPY=0, used in the original test command, works around a separate Triton supporting-kernel failure. The FlyDSL test explicitly requests async copying. Current AITER's production stage-1 wrapper also passesuse_async_copy=True.AITER_FLYDSL_MOE_EXPERT_SCHEDULING_MODEis currently consumed by the gfx1250 TDM kernel, not this gfx950 mixed-MoE builder.AITER_FLYDSL_FORCE=0is a backend-selection knob, not a synchronization fix or a guaranteed override of tuned CSV choices.Before requesting undraft/review: establish an affected failing configuration or a sufficiently justified ordering test, address the sibling pipeline audit from the advisory review, and measure the synchronization cost on the same GPU and relevant production shapes.