feat(k3): Kimi-K3 vLLM plugin vision + DSpark draft support - #1910
feat(k3): Kimi-K3 vLLM plugin vision + DSpark draft support#1910sajandhy wants to merge 5 commits into
Conversation
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
|
574f4ed to
0cc72e5
Compare
6742a7c to
b3ffe3e
Compare
| straight into the KV projection, while ``input_layernorm`` applies only | ||
| to the residual stream carrying the draft block. | ||
|
|
||
| ``slot_mapping`` is optional: the native path reads it from |
There was a problem hiding this comment.
why can't plugin follow the same way?
There was a problem hiding this comment.
Native ATOM can use the default path because DSparkProposer calls write_context_kv immediately after the target forward, while forward_context().attn_metadata still describes the target step — so slot_mapping[:N] is the verified-token slots we need.
In the vLLM plugin, context KV is written from the speculator via precompute_and_store_context_kv(..., slot_mappings=...), not from ATOM's proposer/forward context. vLLM builds those slots from block tables, and they can differ per layer when the draft spans multiple KV cache groups — so the plugin passes slot_mappings explicitly rather than reading a single global attn_metadata.slot_mapping.
Both paths end up in the same write_context_kv → write_context_kv_latent store; only the source of the slot indices differs. During the later draft backbone pass, attn_metadata.slot_mapping would describe the draft block, not the context rows — so we can't rely on forward context for this write in either design.
|
@valarLip, @whx-sjtu, @zejunchen-zejun, |
|
@zejunchen-zejun, |
Keep main's later K3/DSpark/core fixes; overlay only the still-unique plugin vision, DSpark draft, MLA/metadata, and recipe changes. Co-authored-by: Cursor <cursoragent@cursor.com>
The multimodal plugin classes in kimi_k3.py referenced symbols without importing them, which made Ruff fail in pre-checks CI. Co-authored-by: Cursor <cursoragent@cursor.com>
58445f2 to
1b937ea
Compare
Motivation
Land the remaining Kimi-K3 vLLM OOT work from
hexwang/k3_dspark_026_visiononto currentmainas a clean, single-commit PR:Earlier pieces of that branch already merged via squash PRs (#1752, #1782, #1806, #1876, #1820, etc.). This PR keeps
main's later versions of those shared files and overlays only the still-unique delta.Technical Details
K3DSparkModel→atom.plugin.vllm.models.kimi_k3_dspark:KimiK3DSparkVllmkimi_k3.pywith segmented KDA forward, aux hidden-state collection, and multimodal outer/inner classes; addkimi_k3to_PLUGIN_SUPPORTED_MULTIMODAL_MODELSrecipes/atom_vllm/Kimi-K3.md(prefix caching + DSpark speculative launch) and addrecipes/atom_vllm/KVV.mdplus vision design/plan docstests/plugin/test_vllm_kimi_k3.pySource branch (dirty history, 75 behind / 37 ahead):
hexwang/k3_dspark_026_vision. This PR is a rebased extraction of the remaining tip delta.Test Plan
black .andruff check .python -m pytest tests/(non-GPU unit tests, includingtests/plugin/test_vllm_kimi_k3.py)@support_torch_compiledecorated model files were modified (nativekimi_k3.pyuntouched)recipes/atom_vllm/Kimi-K3.mdInferact/Kimi-K3-DSparkandnum_speculative_tokens=7Test Result
Pending — draft PR for review of the extracted delta. Draft PRs do not trigger heavy CI.
Submission Checklist