[TLERaw][Mega] Add Triton TLE NVSHMEM MegaMoE correctness case - #712
[TLERaw][Mega] Add Triton TLE NVSHMEM MegaMoE correctness case#712Zhang-kg wants to merge 1 commit into
Conversation
|
|
bea0c04 to
3e95f07
Compare
3e95f07 to
5b50249
Compare
SummaryThis PR adds production-shape Triton TLE + raw NVSHMEM MegaMoE candidates under: Two validated candidates are included:
Both candidates execute dispatch, L1/L2 GEMM, combine, and writeback in one persistent Triton/TLE kernel launch per rank. The raw CUDA boundary is intentionally narrow:
Routing, TLE pipes, WGMMA, scale handling, SwiGLU, metadata, arrival signaling, and combine remain in Triton/TLE. Compiler baselineThe branch has been rebased onto the current The kernels require safe inlining of helpers containing No reverted PR #837 compiler implementation is carried by this PR. WorkloadCorrectnessv25 single-rankv33 8-rankThe current correctness harness checks the integrated dispatch, L1/L2 compute, cross-rank scatter, and final output path. This is integration evidence, not a claim of complete UserHopper stage equivalence. PerformanceTiming protocol: v25 single-rankThis value was collected with the PR837-compatible validation build after forward-porting v25. Historical measurements from a different compiler build are not mixed into this result. v33 8-rankReference CUDA event baseline: Under this timing protocol, v33 reaches approximately: Main filesDetailed commands and environment variables are documented in: |
Summary
This PR adds a Triton TLE + raw NVSHMEM MegaMoE integration case under:
The goal of this PR is to demonstrate that the current FlagTree/Triton TLE stack can run a small end-to-end MegaMoE-style operator with:
This is a correctness/capability integration case, not yet a production-performance replacement for UserHopperMegaMoE.
Environment
Validated locally on:
GPU: 8x NVIDIA H100 80GB HBM3
CUDA: 12.8
Python: 3.10
NVSHMEM: 3.4.5 (
nvidia-nvshmem-cu12==3.4.5)MPI launcher: Open MPI 4.1.2 (
mpirun)Triton: FlagTree PR682-based Triton with TLE raw NVSHMEM support
The runnable instructions are documented in:
python/test/tle/integration/megamoe/RUNBOOK_CN.md
Implementation Status
Added files include:
Current main kernel path:
_single_kernel_dispatch_receiver_l1_l2_tile_split_multi_cta_tldot_kernelThe implementation currently validates a merged dispatch/receiver/compute/combine path for small controlled shapes. The 8-rank H256 path uses a tile-split multi-CTA compute structure.
A file lock and atomic temporary output path were added around local host helper compilation to avoid concurrent mpirun ranks corrupting the generated .so.
Verified Cases
Case 1: 2-rank H128
Config:
Result:
PASS printed on both ranks
finalize still hangs; command is expected to be collected by timeout
Latest local timing from test_logs/local_2rank_h128_tokens2_repeats3.log:
rank 0 steady_avg_us = 4920.624, steady_max_us = 6031.936
rank 1 steady_avg_us = 3580.512, steady_max_us = 3926.080
Case 2: 8-rank H256 masked tile-split
Config:
Result:
PASS on all 8 ranks
process exits normally
checked = 6
counts = [3, 3]
Latest local timing from test_logs/local_8rank_h256_topk8_masked_tokens1_tile_split_repeats2.log:
steady_min_us across ranks ~= 16207.552
steady_max_us across ranks ~= 16471.872
Current Gap vs UserHopperMegaMoE
This PR does not claim production equivalence with UserHopperMegaMoE yet.
Known gaps:
Next Steps
Planned follow-up work:
Remove the 2-rank finalize hang.
Convert the current manual runner into a more standard gated integration test.
Expand supported shapes beyond the current small H128/H256 cases.
Move closer to UserHopper’s production structure:
Add comparable benchmark cases against existing MegaMoE implementations once shapes and semantics are aligned.