Skip to content

feat(issue8): MoE combine three-mode precision/traffic trade-off analysis - #16

Open
xyaohubery wants to merge 1 commit into
Tencent:mainfrom
xyaohubery:feat/issue8-combine-mode-analysis
Open

feat(issue8): MoE combine three-mode precision/traffic trade-off analysis#16
xyaohubery wants to merge 1 commit into
Tencent:mainfrom
xyaohubery:feat/issue8-combine-mode-analysis

Conversation

@xyaohubery

Copy link
Copy Markdown

Summary

Analytical model and benchmark framework for DeepEP V2's three combine reduction modes, addressing Issue #8.

Three Modes Analyzed

Mode Template Config Trade-off
A (No-Expand) kUseExpandedLayout=false, kAllowMultipleReduction=false Minimal SM, best precision, 1:1 token mapping
B (Local Reduce) kUseExpandedLayout=true, kAllowMultipleReduction=true Reduced network traffic via shared-memory BF16 reduction
C (Expanded Send) kUseExpandedLayout=true, kAllowMultipleReduction=false Highest traffic, FP32 epilogue accuracy

What's Included

  • combine_mode_analysis.py: Analytical model with configurable hardware/workload parameters, based on the actual DeepEP kernel implementations
  • test_compare_modes.py: Benchmark runner supporting both simulation mode and real GPU hardware
  • combine_decision_table.json: Pre-computed decision table across 231 configurations (repetition rate × tokens × hidden dim)
  • README.md: Documentation and quick start guide

Verification

MoE Combine Mode Analysis — DeepEP V2
========================================================================
             Mode A               Mode B               Mode C
             (No Expand)          (Local Reduce)       (Expanded Send)
------------------------------------------------------------------------
Net Traffic    0.0587 GB           0.0433 GB           0.4698 GB
Net Latency       65.2 μs             48.1 μs            522.0 μs
Precision         7.0 bits             6.2 bits            23.0 bits

Key Finding

For typical MoE workloads (repetition_rate ~0.3), Mode B is recommended:

  • 26% less network traffic than Mode A
  • 26% lower latency than Mode A
  • Acceptable precision loss (< 2 ULP in BF16)

🤖 Generated with Claude Code

Analytical model comparing DeepEP V2's three combine reduction modes:
- Mode A (no-expand): direct load/store, best precision, minimal SM
- Mode B (expand + local reduce): BF16 reduction in shared memory, balanced
- Mode C (expanded send): FP32 epilogue reduction, highest traffic, best accuracy

Includes:
- combine_mode_analysis.py: full analytical model with configurable HW params
- test_compare_modes.py: benchmark runner (simulation + real GPU modes)
- combine_decision_table.json: pre-computed decision table (231 configs)
- README.md: documentation and quick start

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant