-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[TRTLLM-15177][chore] Kimi K3 post-merge cleanup: config/import/test hygiene + L0 wiring #17413
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
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9ec5f78
[TRTLLM-15177][chore] use immutable tuple for KimiLinearConfig.keys_t…
brnguyen2 258ef87
[TRTLLM-15177][chore] modeling_kimi_linear.py import + validation hyg…
brnguyen2 06dc2e1
[TRTLLM-15177][chore] tidy KDA fused-verify parity test
brnguyen2 22d9dee
[TRTLLM-15177][test] wire Kimi K3 unit tests into l0_b200
brnguyen2 8f0086b
[TRTLLM-15177][chore] apply ruff-format to KDA parity test
brnguyen2 b7da478
[TRTLLM-15177][chore] split Kimi K3 load_weights and extract the FP8 …
brnguyen2 559bef5
[TRTLLM-15177][chore] move the test-only Kimi K3 reference MoE block …
brnguyen2 0e128b7
[TRTLLM-15177][chore] address review: config ValueError, loader annot…
brnguyen2 ae0a542
[TRTLLM-15177][test] Unwire KDA prefill-op suite from l0_b200 pending…
brnguyen2 a8f650d
[TRTLLM-15204][test] Cite the B200 KDA prefill NaN ticket in the l0_b…
brnguyen2 fcc4a8b
Address trivial review comments
brnguyen2 8d4bebe
Address trivial review comments
brnguyen2 d97a73b
Return an int from _swap_linear_to_fp8_weight_read
brnguyen2 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,18 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2022-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| """Kimi K3 sparse MoE in-tree module. | ||
| """Kimi K3 sparse MoE runtime pieces. | ||
|
|
||
| Ships the promoted ``KimiK3SparseMoeBlock`` and its supporting pieces | ||
| (``KimiK3MoEGate``, latent projections, shared experts, MXFP4-packed | ||
| routed expert bank, native TRTLLM-Gen SiTU dispatch). Structurally | ||
| mirrors HF ``KimiSparseMoeBlock`` at ``modeling_kimi.py:806-918``. | ||
|
|
||
| Two kernel paths coexist under one module class: | ||
|
|
||
| * ``use_fused_cubin=False`` — Python fallback with MXFP4 group-32 | ||
| routed expert weights, dequantized to canonical fp32 on demand. | ||
| Byte-exact HF parity under random weights. | ||
| * ``use_fused_cubin=True`` — native in-tree | ||
| ``torch.ops.trtllm.mxe4m3_mxe2m1_block_scale_moe_runner`` invocation | ||
| (``act_type=SiTu``) on checkpoint-derived MXFP4 weights shared with | ||
| the fallback bank. Routing goes through the op's | ||
| ``topk_weights``/``topk_ids`` bypass fed by the real K3 gate. | ||
| Ships the routing gate (``KimiK3MoEGate``) and the shared MLP / | ||
| RMSNorm building blocks (``_mlp``) used by the serving runtime | ||
| (``KimiK3MoERuntime`` in ``modeling_kimi_linear.py``). The test-only | ||
| HF-parity reference block (``KimiK3SparseMoeBlock`` and its MXFP4 / | ||
| kernel helpers) lives with its test at | ||
| ``tests/unittest/_torch/modules/moe/kimi_k3_ref_moe/``. | ||
| """ | ||
|
|
||
| from .kimi_k3_moe_block import ( | ||
| KimiK3RoutedExpertBank, | ||
| KimiK3SparseMoeBlock, | ||
| MoEBlockProvenance, | ||
| copy_hf_moe_block_weights, | ||
| ) | ||
| from .kimi_k3_moe_gate import KimiK3MoEGate, copy_hf_moe_gate_weights | ||
|
|
||
| __all__ = [ | ||
| "KimiK3MoEGate", | ||
| "KimiK3RoutedExpertBank", | ||
| "KimiK3SparseMoeBlock", | ||
| "MoEBlockProvenance", | ||
| "copy_hf_moe_gate_weights", | ||
| "copy_hf_moe_block_weights", | ||
| ] |
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
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.