Repository navigation
[OMNIML-6079] [2/2] Add the Kimi-K3 expert-parallel adapter #2749
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
base: shengliangx/hfep-11b-kimi-k25-vl
Are you sure you want to change the base?
Changes from all commits
4c767ec
efa079b
ef46e57
f5ea167
2c46728
506ccf6
2b241b1
524087b
4195023
c544e2d
c6c6f1c
a1a9d04
f77b913
71a59e4
2bddffc
55d7613
4f33712
152e437
337e72b
3ed290a
0a2865a
d6b16c8
5303a46
a2d4c2d
ebb96a0
0022fc3
07438e3
76fcf09
1d549fc
c395615
fdb723f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,7 @@ | |
| nemotron, | ||
| nemotron_h, | ||
| minimax_m3_vl, | ||
| kimi_k3, | ||
| llama4_text, | ||
| kimi_vl, | ||
| kimi_k25, | ||
|
|
||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """kimi_k3 specs (HF model type ``kimi_k3``). | ||
|
|
||
| Kimi-K3: a remote-code VLM on the kimi_linear backbone, with packed mxfp4 experts that are | ||
| decompressed at load. | ||
| """ | ||
|
|
||
| from ..specs import EPSpec, ModelSpec, register | ||
| from .ep import BASE_MODEL_EP_PLAN, MODEL_TYPE, PATCHED_EVERY_LOAD, make_buildable, prepare | ||
|
|
||
| __all__: list[str] = [] | ||
|
|
||
| register( | ||
| ModelSpec( | ||
| model_type=MODEL_TYPE, | ||
| modeling_source="remote_code", | ||
| ep_spec=EPSpec( | ||
| prepare=prepare, | ||
| prepared_ep_plan=BASE_MODEL_EP_PLAN, | ||
| plan_config_attr="text_config", | ||
| make_buildable=make_buildable, | ||
| prepare_patches_every_load=PATCHED_EVERY_LOAD, | ||
| decompressed_formats=("compressed-tensors",), | ||
| # prepare's patches to the checkpoint's remote code were validated on this release. | ||
| requires_transformers="5.13", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The declared floor is 5.13, whereas the generated compatibility summary says 5.8. Please update that summary and the readiness checklist's 'runs only on the expert-parallel path':
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in the description:
|
||
| ), | ||
| ) | ||
| ) | ||
|
shengliangxu marked this conversation as resolved.
Resolved
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] This build-only hook is still skipped when the caller explicitly disables EP.
resolve_distribution_plan()gates the entireapply_distributed_support(..., prepare=False)call on_ep_degree(...) != 1. In a fresh process withMODELOPT_EP_DEGREE=1(orep_size=1),_decide_distribution()nevertheless builds the remote VLM on meta. Its original no-kwargstie_weightsthen receives the kwargs from Transformerspost_init—the compatibility problem this hook fixes on 5.18—and planning raises its wrapped constructionRuntimeErrorbefore reaching the intended whole-model refusal or returning the FSDP2 plan.The new degree-1 refusal test monkeypatches
build_meta_causal_lmto return a dummy withtie_weights = lambda: None, so it hides this path. Could the decision runmake_buildableindependently of whether EP is enabled, while continuing to skipprepareand structural/converter patches? Add a degree-1 regression through the real meta-build path using a local remote fixture with the shipped no-kwargs override; cover both the replicated decision anddense='fsdp'.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #2748 797f2d1, where the plan decision's build step lives, since Kimi-VL and Kimi-K2.5 met the same failure: at an EP degree of 1 every rank now runs the spec's
make_buildablealone in the "model spec" step, because the decision still builds the model. No floor check, no plan and nopreparerun at that degree. Regressions through the real meta build of the checkpoint's own remote code atep_size=1, covering both the left-whole refusal anddense='fsdp':test_an_ep_degree_of_1_builds_kimi_k3s_own_code_to_decide(85e7c50); the tiny Kimi-K3 remote modeling now has the no-keywordtie_weightsthe checkpoint ships;test_an_ep_degree_of_1_builds_the_checkpoint_s_own_vlm_to_decide, on a tiny Kimi-VL checkpoint.Without the change, both fail in the meta build with
tie_weights() got an unexpected keyword argument 'recompute_mapping'.