Skip to content

[EP] Optimize MUSA legacy EP dispatch and combine - #4125

Merged
stmatengss merged 8 commits into
feature/maca-ep-functional-cleanfrom
feature/musa-ep-optimization
Oct 10, 2026
Merged

stmatengss merged 8 commits into
feature/maca-ep-functional-cleanfrom
feature/musa-ep-optimization

Conversation

@UNIDY2002

@UNIDY2002 UNIDY2002 commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Optimize the MUSA legacy EP dispatch and combine kernels on top of the MACA/CUDA-compatible EP device path introduced by #4091. This draft is the second stage of the EP portability work and is intentionally based on feature/maca-ep-functional-clean.

The changes reduce MUSA dispatch/combine overhead and refine the MUSA device operations used by the legacy EP path.

Depends on #4091.

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Mooncake Conductor (mooncake-conductor)
  • Reshard (mooncake-reshard)
  • Mooncake EP (mooncake-ep)
  • Mooncake PG (mooncake-pg)
  • Integration (mooncake-integration)
  • P2P Store (mooncake-p2p-store)
  • Python Wheel (mooncake-wheel)
  • Common (mooncake-common)
  • Mooncake RL (mooncake-rl)
  • CI/CD
  • Docs
  • Other

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Performance improvement
  • Other

How Has This Been Tested?

MUSA validation and benchmark results:

  • P2P, 8 ranks, BF16, 128 tokens, hidden size 7168, 288 experts, top-k 8: correctness checks passed. Dispatch reached 12.7--13.0 GB/s at 586 us; combine reached 14.9--15.4 GB/s at 0.96 ms; combined dispatch+combine reached 19.7 GB/s at 1.12 ms.

  • No-P2P / IBGDA, same workload: correctness checks passed. Dispatch reached 2.11--2.12 GB/s at 3.54 ms; combine reached 3.59--3.93 GB/s at 3.9 ms; combined dispatch+combine reached 3.02 GB/s at 7.30 ms.

  • Official MUSA DeepEP reference: the official MUSA DeepEP low-latency path reported 72.3--75.5 GB/s dispatch on the same intranode 8-GPU class of workload. This is a platform reference; the implementations and measured paths are different.

  • Unit tests pass

  • Integration tests pass (if applicable)

  • Manual testing done (MUSA 8-rank correctness and benchmark validation)

Checklist

  • I have performed a self-review of my own code
  • I have formatted my code using ./scripts/code_format.sh
  • I have run pre-commit on the files changed in this PR and all hooks pass
  • I have updated the documentation (if applicable)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (Codex)

@UNIDY2002
UNIDY2002 force-pushed the feature/musa-ep-optimization branch 3 times, most recently from 3e53fd5 to 8f854de Compare September 15, 2026 04:45
@UNIDY2002
UNIDY2002 force-pushed the feature/musa-ep-optimization branch from 8f854de to 5d508b8 Compare September 15, 2026 04:56
@UNIDY2002
UNIDY2002 force-pushed the feature/musa-ep-optimization branch from 2051d17 to ea65651 Compare September 15, 2026 07:26
@UNIDY2002
UNIDY2002 marked this pull request as ready for review September 15, 2026 07:32
Copilot AI lite review requested due to automatic review settings September 15, 2026 07:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@alogfans alogfans left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yuechen-sys yuechen-sys left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

I found a critical issue need to be resolved.

Comment thread mooncake-ep/src/mooncake_ep_kernel.cu Resolved
@UNIDY2002
UNIDY2002 requested a review from yuechen-sys October 10, 2026 06:57

@yuechen-sys yuechen-sys left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stmatengss
stmatengss merged commit abef787 into main Oct 10, 2026
31 checks passed
@UNIDY2002
UNIDY2002 deleted the feature/musa-ep-optimization branch October 10, 2026 10:39
UNIDY2002 pushed a commit that referenced this pull request Oct 12, 2026
…sh (#4579)

mooncake_ep_kernel.cu imports every mooncake::device::mc_* helper it calls
into namespace mooncake with an explicit using-declaration. #4125 added
mc_fence_noflush() to the MUSA ops header and called it from the dispatch
kernel under #ifdef MOONCAKE_EP_USE_MUSA, but only added the
using-declaration for its sibling mc_atomic_add_relaxed.

The call site is a no-argument unqualified call, so argument-dependent
lookup cannot find the name, and because mc_fence_noflush is defined only in
the MUSA backend header (device_ops.cuh selects musa/maca/cuda ops), only the
MUSA build breaks:

  mooncake_ep_kernel.cu:227:17: error: use of undeclared identifier
  'mc_fence_noflush'; did you mean 'device::mc_fence_noflush'?

Add the missing using-declaration in the existing MUSA-only block.

Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants