Conversation
DeepEP-side changes for TeraMoE intra-node compute compensation and run_overlap robustness under load skew: Kernel/host: - internode.cu: fix CUDA719 GPU-wedge under high skew — chunk-completion counter now uses atom.acq_rel.gpu (atomic_add_acqrel_gpu in utils.cuh) so the writer that publishes `ready` inherits all peer writers' token/ mapping-table releases; consumer acquiring `ready` always sees complete data. One acquire per chunk, zero serialization, bitwise-identical on the normal path. Also adds fail-safe bounds guards on the fused-unzip writes. - Dispatch peer-multicast plumbing (UnzipPeerBufs in configs.cuh; new default-nullptr params in api.cuh/internode.cu/deep_ep.cpp/deep_ep.hpp) to direct-write migrated chunks into peer expert buffers. Default OFF — existing call paths byte-for-byte unchanged. - buffer.py: expose the new dispatch parameters. Python (tests_overlap): - test_internode_forward_backward.py: adaptive COMBINE_OVERLAP_RATIO = f(imbalance) (env ADAPTIVE_OVERLAP, default on) + baseline floor guard overlap_is_beneficial (env OVERLAP_BASELINE_FLOOR, default off) so overlap is never worse than baseline in losing regimes. - compensation_planner.py: water-filling chunk-migration planner with expert-affinity batching, makespan guard, cost-aware no-op, and a 128-aligned fine-balance pass (~99% of ideal). - moe_compensated_node.py / moe_e2e_compensated.py: intra-node compute compensation reference impl + end-to-end demo, bitwise-verified. - test_dist_compensation.py: real distributed (per-rank GPU) compensation via NCCL NVLink migration, bitwise-identical fwd/dgrad. - bench_three_configs.py: baseline vs overlap vs overlap+compensation bench. - adaptive_controller_v3.py: unified adaptive scheduling / regime map. Verified: EP16 BF16/FP8 correctness bitwise diff=0; skew0.6 end-to-end Exit 0 (previously CUDA719); compensation makespan speedup grows with imbalance and EP scale. Co-Authored-By: Claude Code <noreply@anthropic.com>
# Conflicts: # tests_overlap/test_internode_forward_backward.py
…moe-compensation # Conflicts: # tests_overlap/test_internode_forward_backward.py
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
DeepEP-side changes for TeraMoE intra-node compute compensation plus
run_overlaprobustness under load skew.Kernel / host
atom.acq_rel.gpu(atomic_add_acqrel_gpuinutils.cuh). The writer that publishesreadynow inherits every peer writer's token / mapping-table release, so a consumer that acquiresreadyalways observes complete data. One acquire per chunk — zero serialization, bitwise-identical on the normal path. Also adds fail-safe bounds guards on the fused-unzip writes.UnzipPeerBufsinconfigs.cuh; new default-nullptrparams threaded throughapi.cuh/internode.cu/deep_ep.cpp/deep_ep.hpp) so migrated chunks can be direct-written into peer expert buffers. Default OFF — existing call paths are byte-for-byte unchanged.buffer.py: expose the new dispatch parameters.Python (
tests_overlap)test_internode_forward_backward.py: adaptiveCOMBINE_OVERLAP_RATIO = f(imbalance)(envADAPTIVE_OVERLAP, default on) + a baseline-floor guardoverlap_is_beneficial(envOVERLAP_BASELINE_FLOOR, default off) so overlap is never worse than baseline in losing regimes.compensation_planner.py: water-filling chunk-migration planner (expert-affinity batching, makespan guard, cost-aware no-op, 128-aligned fine-balance pass — reaches ~99% of the ideal upper bound).moe_compensated_node.py/moe_e2e_compensated.py: intra-node compute-compensation reference impl + end-to-end demo, bitwise-verified.test_dist_compensation.py: real distributed (per-rank GPU) compensation via NCCL NVLink migration; bitwise-identical fwd/dgrad.bench_three_configs.py: baseline vs overlap vs overlap+compensation benchmark.adaptive_controller_v3.py: unified adaptive scheduling / regime map.Testing
diff=0(FP8 wgrad cos ≈ 0.9993, expected requant).skew0.6end-to-end: Exit 0 (previously reproduced CUDA 719).Notes
🤖 Generated with Claude Code