Repository navigation
[EP] Add JIT compilation support to Mooncake EP CUDA backend - #4581
Merged
Merged
Conversation
Bonjourz
force-pushed
the
bojunz/ep_jit_pr
branch
from
October 12, 2026 07:29
cca8b26 to
4966a07
Compare
Bonjourz
marked this pull request as ready for review
October 16, 2026 14:41
Bonjourz
requested review from
UNIDY2002,
ympcMark and
yuechen-sys
as code owners
October 16, 2026 14:41
UNIDY2002
reviewed
Oct 22, 2026
Collaborator
|
Hi @Bonjourz! Could you help merge Mooncake's latest main into this branch? Thanks! |
Bonjourz
force-pushed
the
bojunz/ep_jit_pr
branch
8 times, most recently
from
October 26, 2026 13:36
b962126 to
92f43a8
Compare
Bonjourz
force-pushed
the
bojunz/ep_jit_pr
branch
from
October 27, 2026 02:14
b28dd12 to
d6578b7
Compare
Bonjourz
requested review from
ShangmingCai,
alogfans,
staryxchen,
stmatengss and
ykwd
as code owners
October 27, 2026 02:14
The framework is ported from nccl_ep JIT module (https://github.com/NVIDIA/nccl-extensions/tree/nccl-extensions-v0.1.0/nccl_ep/device/jit) Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
Same approach as nccl-ep, with one change: jit_runtime.cpp includes jit_config.h directly, instead of the compiler adding it to every file, so readers can see where the path macros come from. Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
The CUDA EP JIT runs nvcc on the user's machine, so the kernel headers staged under 'build/mooncake_ep_jit/' must be shipped with the wheel, and the runtime must find them next to the installed library. Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
The 'sm_min' in mooncake-ep is sm 80. Make the 'sm_min' explicitly configured by upper level. Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
All the kernels in mooncake-ep are launched with cooperative launch. Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
mooncake-ep only uses int64_t for top-k indices, but NVCC_EXTRA_FLAGS can make 'topk_idx_t' a different type in the JIT compile. Add a static assertion so that fails at compile time. Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
Bonjourz
force-pushed
the
bojunz/ep_jit_pr
branch
from
October 27, 2026 02:15
d6578b7 to
0a02492
Compare
Contributor
Author
Hi @UNIDY2002 . I have updated update branch based on the latest main. By the way, I also added docs for JIT deployment ( |
Collaborator
Collaborator
|
@Bonjourz Please fix the CI error: Build & Test (Linux) / Check Sphinx docs build (pull_request) |
Signed-off-by: Bojun Zhu <bojunz@nvidia.com>
Bonjourz
force-pushed
the
bojunz/ep_jit_pr
branch
from
October 27, 2026 08:25
0a02492 to
8a81251
Compare
Collaborator
|
LGTM. Let's wait for the Mooncake CI results. |
7 of 23 tasks
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.
Description
Port the JIT framework from NCCL-EP to Mooncake-EP, enabling on demand compiling CUDA kernels:
Module
mooncake-transfer-engine)mooncake-store)mooncake-conductor)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test tracking items:
Build
Build command:
Functionality Test
Performance Test
Configuration: BF16, 32 tokens per rank, hidden size 4096, top-k 8, 256 experts, 24 communication SMs, 20 warm-up iterations, 200 measured iterations and 5 repetitions. The value is the mean of 5 runs.
GB300 platform, NCCL 2.31.2-1, CUDA 13.0, Python 3.12.3, torch 2.14.1
Compilation Test
Without JIT support, a fixed set of instantiations combination of template parameter need to be compiled. That bloat the binary size. With JIT, the combination is determined based the user's need.
Without JIT support, the size of
libmooncake_ep_device.sois 33M:with JIT support, the size is reduced to 6M:
Checklist
./scripts/code_format.shThe deployment guide for JIT support
docs/source/deployment/mooncake-ep-jit.mdis updated.AI Assistance Disclosure
The code changes were made with the help of AI. The author reviewed the implementation and test results.