mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #2607] [RFC]: Comprehensive MoE / EP Kernel Benchmark Under Incast Traffic #683
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#683
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Srinivasoo7 on GitHub (Jun 24, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2607
Changes proposed
Summary
This RFC proposes adding a dedicated benchmark suite for Mooncake EP dispatch/combine kernels under both uniform and incast traffic patterns from Issue #1883 Milestone 15
Mooncake EP already has correctness coverage through existing tests that exercise dispatch/combine behavior, expert routing, data types, zero-copy paths, async finish behavior, and receive hooks. However, the project does not yet have a standardized performance benchmark that measures throughput and tail latency under realistic expert-parallel MoE serving traffic.
The main target workload for this RFC is incast traffic, where many ranks simultaneously route tokens into a small set of hot experts. This traffic pattern stresses the all-to-all dispatch path much more aggressively than uniform random routing and is important for detecting regressions in EP kernel and transport behavior.
The proposed benchmark will live separately from correctness tests, likely under:
The benchmark should be CLI-driven, support JSON output, and allow repeatable comparison across CUDA and other supported backends when hardware is available.
Motivation
Mooncake EP is responsible for high-performance expert-parallel communication patterns used by MoE workloads. Correctness tests are necessary but not sufficient for kernel and transport development because they do not answer questions such as:
Current correctness tests are valuable because they validate functional behavior, but they are not designed to provide repeatable performance statistics over warmup and measured iterations.
A dedicated EP benchmark would make M15 optimization work easier to evaluate and would give maintainers and contributors a common tool for validating EP performance changes.
Goals
mooncake.mooncake_ep_buffer.Buffermooncake.pgNon-Goals
Current State
Mooncake EP currently has correctness-oriented tests that exercise dispatch and combine behavior. These tests are useful for checking that output tensors match expected values and that different API modes behave correctly.
However, correctness tests are not ideal for repeated performance measurement because they usually:
This RFC proposes adding a benchmark harness rather than extending the correctness test directly.
Proposed Design
Directory Layout
Proposed initial structure:
Possible future structure if the benchmark grows:
CLI Interface
Example command:
Routing Modes
1. Uniform Routing
Uniform routing should approximate the current correctness-test routing pattern and serve as a baseline.
Example behavior:
2. K-Hot-Expert Incast
K-hot routing models many ranks sending tokens to a small hot expert set.
Example behavior:
Suggested knobs:
This allows both extreme incast and mixed traffic.
3. Zipfian Routing
Zipfian routing models skewed real-world load where a small number of experts receive a disproportionate share of tokens.
Suggested knobs:
Metrics
The benchmark should report:
Actual metric values should be populated by the benchmark.
Timing Method
The benchmark should separate:
For CUDA, timing should use appropriate synchronization around measured regions so that async GPU work is accounted for correctly. If backend-specific timing APIs differ, the benchmark should isolate backend timing behavior behind helper functions.
Backend Support
Initial implementation should target CUDA first because it is the most common validation environment.
MUSA or other backend support can be added after confirming:
The benchmark should not assume all contributors have access to every backend.
CI Strategy
The benchmark should not become a hard performance gate initially.
Suggested CI behavior for the first version:
Future CI options:
Implementation Plan
Phase 1 : Minimal Benchmark Harness
benchmarks/ep_benchmark/.Phase 2 : Incast Routing
Phase 3 : Zipfian Routing and Sweep Support
Phase 4 : Backend Parity
Phase 5 : Optional CI / Nightly Integration
Validation Plan
The benchmark should be validated in three ways:
Alternatives Considered
Extend Existing Correctness Test
Rejected for initial implementation.
Correctness tests and performance benchmarks have different goals. Mixing repeated-trial statistics, warmup, JSON output, and sweep logic into a correctness test would make both harder to maintain.
Rely Only on External MoE Benchmarks
External benchmarks may be useful for comparison, but Mooncake EP should have a benchmark that exercises its own public API and backend paths directly.
Add CI Perf Gate Immediately
Rejected for the first version.
Kernel performance benchmarking requires stable hardware, stable drivers, and controlled environments. A hard CI gate should only be added after the benchmark is stable and the project has appropriate runners.
Risks
Open Questions
Expected Outcome
This RFC should produce a repeatable Mooncake EP benchmark that helps contributors measure dispatch/combine performance under both normal and incast traffic. The first implementation should be useful as a manual benchmark tool, with CI integration kept lightweight until stable multi-GPU runners are available.
Before submitting a new issue...
@github-actions[bot] commented on GitHub (Jun 24, 2026):
Thanks for opening this issue, @Srinivasoo7!
194645829A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
@PACTHEMAN123 commented on GitHub (Jul 30, 2026):
Hi, I'd like to take this up. I have access to a single node with 8× NVIDIA H20 GPUs and can implement and validate the CUDA incast benchmark. Is anyone already working on it? @Srinivasoo7
@Srinivasoo7 commented on GitHub (Jul 30, 2026):
Hi @PACTHEMAN123
Thanks for stepping up. Let's collaborate and work on this!
@PACTHEMAN123 commented on GitHub (Jul 31, 2026):
Opened #3213 for Phases 1–3 (uniform, k-hot, zipfian routing + metrics). Phases 4–5 to follow. @Srinivasoo7 would appreciate a review when you have time.
@UNIDY2002 commented on GitHub (Aug 4, 2026):
Thanks for putting together this RFC, and for driving the initial implementation in #3213. A standalone benchmark for routing skew and incast traffic would be a useful addition to Mooncake EP.
One organizational question: since this benchmark directly exercises the Mooncake EP runtime, I think
mooncake-ep/benchmarks/would be a better home for the initial implementation. It would sit alongside the existingelastic_buffer_perf.pybenchmark and follow the repository's component-local benchmark layout.A top-level
benchmarks/location would become more natural if this grows into a cross-implementation benchmark that compares Mooncake EP with external backends or serving frameworks. Would you be open to moving the initial suite undermooncake-ep/benchmarks/as part of #3213?@PACTHEMAN123 commented on GitHub (Aug 5, 2026):
Thanks for your advise, I have moved the suite to
mooncake-ep/benchmarks/ep_benchmark/in the new commit6478ba2e, alongsideelastic_buffer_perf.py. We can revisit a top-level location if it later grows into a cross-backend comparison.@Srinivasoo7 commented on GitHub (Aug 23, 2026):
Thanks @PACTHEMAN123 for taking over the implementation, @UNIDY2002 for guiding us on the same!