Repository navigation
[#19900][feat] DSpark: load speculators-format drafter checkpoints - #19903
Merged
juney-nvidia merged 1 commit intoOct 6, 2026
Merged
juney-nvidia merged 1 commit into
juney-nvidia merged 1 commit into
Conversation
A DSpark drafter saved in the vLLM speculators format, such as RedHatAI/Kimi-K3-speculator.dspark as downloaded, now loads as speculative_model without a converted copy. Its config.json has no top-level model_type, so it could not be read before. The config is detected by speculators_model_type == "dspark" with a nested transformer_layer_config, and translated the way the hand conversion (make_redhat_dspark_adapter.py) did: - the qwen3 backbone is flattened from transformer_layer_config; - target_layer_ids = aux_hidden_state_layer_ids - 1, since vLLM-style aux ids name the layer whose input is captured; - the sliding window is dropped. The drafter attention backends reject non-causal windows, and this is exact while the context fits in the trained window (2048 tokens for the Kimi K3 drafter); - mask_token_id and the markov / confidence-head fields are carried over; block_size is not. Every reader of the drafter's config.json uses the same translation: the model config (load_pretrained_config), the DFlash / DSpark spec-config resolution, and the context-buffer budget. Other drafter configs are unchanged. Signed-off-by: Vasanth Sabavat <[email protected]>
vsabavat
added a commit
to vsabavat/TensorRT-LLM
that referenced
this pull request
Oct 7, 2026
Remakes 5fbf086203, the same merge onto 4c9e23d, on top of e253695 (P15, NVIDIA#19903). The tree is 5fbf086203's plus P15's three files, which P12 does not touch. Conflicts resolved for U2's per-token KDA states: shutdown keeps kda_state_tok = None; the test file keeps U2's import, builds the suspend/resume runtime test's manager without per-token states, and skips the absent kda_state_tok buffer when it overwrites a slot. # Conflicts: # tensorrt_llm/_torch/pyexecutor/kv_cache/mamba_cache_manager.py # tests/unittest/_torch/executor/kv_cache/test_mamba_cache_manager.py
1 task done
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
Fixes #19900.
RedHatAI/Kimi-K3-speculator.dsparkships in the vLLMspeculatorsconfig format. TRT-LLM could not read it, so DSpark with this drafter needed a hand-converted copy of the checkpoint. With this PR,speculative_model: RedHatAI/Kimi-K3-speculator.dsparkloads the checkpoint as downloaded.The config is detected by
speculators_model_type == "dspark"with a nestedtransformer_layer_config. It is translated the same way the hand conversion did:transformer_layer_config.target_layer_ids = aux_hidden_state_layer_ids - 1. vLLM-style aux ids name the layer whose input is captured.mask_token_idand the markov / confidence-head fields are carried over.Every reader of the drafter's
config.jsonuses this translation. Other drafter configs are unchanged, so no-spec and existing DFlash / DSpark checkpoints are unaffected.This PR is based on
feat/kimi-k3-low-latency(4c9e23db1c) and fast-forwards it.Test Coverage
test_dspark_speculators_checkpoint.py: the translation matches the converted config, and non-speculators configs are left as they are.PR Checklist