-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[None][feat] bring up Kimi K3 NVFP4 with CUTLASS and cuteDSL MegaMoE SiTU #17865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
longlee0622
merged 9 commits into
NVIDIA:main
from
longlee0622:agent/kimi-k3-nvfp4-megamoe-situ
Aug 21, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ce94087
[None][fix] Add SiTu to the Python gated-activation list
longlee0622 dabdb41
[None][fix] Record the checkpoint directory on lazily-loaded weights
longlee0622 57e11fc
[None][feat] Kimi K3: serve the nvidia/Kimi-K3-NVFP4 checkpoint
longlee0622 698f8fe
[None][feat] Kimi K3: MegaMoE CuteDSL SiTU support for the NVFP4 chec…
longlee0622 d622b63
[None][fix] Enable Kimi K3 SiTU on CUTLASS
longlee0622 e9d5e7c
Remove local doc reference from MegaMoE comment
longlee0622 6b09ef0
Align Kimi FP8 checkpoint stash gate
longlee0622 08abae0
Address Kimi SiTu review feedback
longlee0622 d45ca60
[None][fix] Kimi K3: size CUTLASS SiTU alpha/beta with the shared EP …
longlee0622 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Kimi K3 NVFP4 on DEP16 (4 nodes x 4 GPU). | ||
| # Derived from the DEP8 variant; kept separate from the shared MXFP4 DEP16 | ||
| # template so that one stays untouched. | ||
| # | ||
| # DEP8 does not fit. The parameters alone exceed a 288 GB GB300 at EP8: the | ||
| # per-rank footprint is NOT checkpoint_bytes / 8, because enable_attention_dp | ||
| # replicates every non-routed weight on every rank, and Kimi K3 converts the | ||
| # checkpoint's FP8 attention to BF16 online (KIMI_K3_FP8_WEIGHT_READ is off by | ||
| # default), doubling it. Halving the routed-expert share is what buys the | ||
| # headroom back. See Phase 3 for making the attention weights read as FP8. | ||
| # | ||
| # max_batch_size is 8, not the template's 32. The V2 Mamba cache reserves a | ||
| # full recurrent-state slot per resident sequence (69 KDA layers, fp32 state, | ||
| # ~0.42 GiB/slot), so the manager's minimum live quota scales with it: at 32 it | ||
| # demands 14.39 GiB. NVFP4 cannot pay that here. Its in-memory weights are | ||
| # ~4.8 GiB LARGER per rank than MXFP4's (200.36 vs 195.58 GiB) even though its | ||
| # checkpoint is smaller -- NVFP4 carries an FP8 block scale per 16 elements | ||
| # where MXFP4 carries one UE8M0 per 32, i.e. 0.5625 vs 0.53125 bytes/element -- | ||
| # and the MXFP4 DEP16 recipe only had 1.06 GiB of slack in the second KV | ||
| # sizing pass. Lowering the batch lowers the minimum instead of the headroom. | ||
| # It costs eval wall time, not accuracy. | ||
| # | ||
| # backend: CUTLASS is required, not a preference -- AUTO resolves Kimi K3 to | ||
| # TRTLLM, and trtllm-gen ships SiTu cubins for W4A8_MXFP4_MXFP8 only. | ||
| # | ||
| # moe_config.max_num_tokens stays at the inherited value: for CUTLASS it is a | ||
| # per-call chunking bound. Do NOT carry it over to MEGAMOE_* backends, where | ||
| # it is the SymmBuffer capacity and this value over-provisions it 32x. | ||
| tensor_parallel_size: 16 | ||
| enable_attention_dp: true | ||
| moe_expert_parallel_size: 16 | ||
| max_batch_size: 8 | ||
| max_num_tokens: 8192 | ||
| max_seq_len: 8192 | ||
| trust_remote_code: true | ||
| disable_overlap_scheduler: false | ||
| enable_chunked_prefill: true | ||
| cuda_graph_config: | ||
| enable_padding: true | ||
| max_batch_size: 8 | ||
| moe_config: | ||
| backend: CUTLASS | ||
| max_num_tokens: 131072 | ||
| use_low_precision_moe_combine: true | ||
| kv_cache_config: | ||
| enable_block_reuse: false | ||
| free_gpu_memory_fraction: 0.25 | ||
| tokens_per_block: 64 |
37 changes: 37 additions & 0 deletions
37
examples/kimi_k3/eval_extra_llm_options_nvfp4_dep16_gpqa.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Kimi K3 NVFP4 on DEP16 for GPQA-Diamond (4 nodes x 4 GPU). | ||
| # | ||
| # Differs from the GSM8K DEP16 config in exactly one thing that matters: | ||
| # max_seq_len. GSM8K answers are a few hundred tokens, so 8192 covered prompt | ||
| # plus generation. GPQA-Diamond is a reasoning benchmark and the published | ||
| # Kimi-K3 numbers were measured with a 65536-token generation budget, so the | ||
| # sequence budget has to hold 4096 of prompt plus all of that. | ||
| # | ||
| # max_batch_size is 8, revised up from 4 after the 8-question smoke (job | ||
| # 475469) measured what this model actually generates here: 3431 and 6000 | ||
| # tokens, not the 65536 the budget allows. The budget still has to cover the | ||
| # worst case, but sizing CONCURRENCY for it was wrong -- at ~6k tokens and | ||
| # ~63 KiB/token a sequence wants ~0.4 GiB, not ~4 GiB, so the pool funds | ||
| # several. The V2 Mamba minimum also stays comfortable: ~0.42 GiB per resident | ||
| # slot means ~4.2 GiB at batch 8, well under the ~15 GiB quota, and the GSM8K | ||
| # DEP16 run already ran at 8. If several questions do run long the scheduler | ||
| # simply admits fewer of them. | ||
| tensor_parallel_size: 16 | ||
| enable_attention_dp: true | ||
| moe_expert_parallel_size: 16 | ||
| max_batch_size: 8 | ||
| max_num_tokens: 8192 | ||
| max_seq_len: 69632 | ||
| trust_remote_code: true | ||
| disable_overlap_scheduler: false | ||
| enable_chunked_prefill: true | ||
| cuda_graph_config: | ||
| enable_padding: true | ||
| max_batch_size: 8 | ||
| moe_config: | ||
| backend: CUTLASS | ||
| max_num_tokens: 131072 | ||
| use_low_precision_moe_combine: true | ||
| kv_cache_config: | ||
| enable_block_reuse: false | ||
| free_gpu_memory_fraction: 0.35 | ||
| tokens_per_block: 64 |
37 changes: 37 additions & 0 deletions
37
examples/kimi_k3/eval_extra_llm_options_nvfp4_dep16_megamoe.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Kimi K3 NVFP4 on DEP16 with the MegaMoE CuteDSL backend (4 nodes x 4 GPU). | ||
| # | ||
| # Same topology and sequence budget as the CUTLASS DEP16 GSM8K config, so a | ||
| # score difference is attributable to the MoE backend and nothing else. The | ||
| # CUTLASS run on this config scored 96.40 (job 475308) against a 96.47 MXFP4 | ||
| # baseline, which is what this is measured against. | ||
| # | ||
| # moe_config.max_num_tokens is deliberately ABSENT. For CUTLASS it is a | ||
| # per-call chunking bound and 131072 is harmless; for MEGAMOE_* the same key is | ||
| # the SymmBuffer capacity, further divided by ep_size under attention-DP. | ||
| # Carrying 131072 over would over-provision the generation SymmBuffer ~32x and | ||
| # eat the KV cache. ModelConfig's default (max_num_tokens x dp_size) lands | ||
| # correctly, so leave it unset -- see the MegaMoE disagg run record. | ||
| # | ||
| # MegaMoE is EP-only, which DEP16 already is (moe_ep=16, moe_tp=1). It also | ||
| # uses MNNVL symmetric memory, so all 4 nodes must sit in one NVL72 domain: | ||
| # pin them with sbatch -w to a single nvl72dNNN rack or the rendezvous fails | ||
| # with "invalid resource handle". | ||
| tensor_parallel_size: 16 | ||
| enable_attention_dp: true | ||
| moe_expert_parallel_size: 16 | ||
| max_batch_size: 8 | ||
| max_num_tokens: 8192 | ||
| max_seq_len: 8192 | ||
| trust_remote_code: true | ||
| disable_overlap_scheduler: false | ||
| enable_chunked_prefill: true | ||
| cuda_graph_config: | ||
| enable_padding: true | ||
| max_batch_size: 8 | ||
| moe_config: | ||
| backend: MEGAMOE_CUTEDSL | ||
| use_low_precision_moe_combine: true | ||
| kv_cache_config: | ||
| enable_block_reuse: false | ||
| free_gpu_memory_fraction: 0.25 | ||
| tokens_per_block: 64 |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.