-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[TRTLLM-15465][feat] Support SA speculative decoding under disaggregated serving for Kimi K3 #17939
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
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Kimi K3 disaggregated serving - GENERATION (decode) server extra LLM-API | ||
| # options WITH suffix-automaton (SA) speculative decoding | ||
| # (`trtllm-serve <model> --config gen_config.yaml`). | ||
| # | ||
| # DEP16 deployment (attention data-parallel + MoE EP dispatch/combine), | ||
| # mirroring examples/kimi_k3/eval_extra_llm_options_sa.yaml: SA runs | ||
| # eager (no CUDA graphs, no overlap scheduler) and needs | ||
| # max_batch_size <= 8 (SpeculativeState buffers). For the SA-off variant | ||
| # (validate KV/KDA transfer before enabling SA), use gen_config_no_sa.yaml. | ||
| tensor_parallel_size: 16 | ||
| moe_expert_parallel_size: 16 | ||
| enable_attention_dp: true | ||
| pipeline_parallel_size: 1 | ||
| disable_overlap_scheduler: true | ||
| enable_chunked_prefill: false | ||
| cuda_graph_config: null | ||
| max_batch_size: 8 | ||
| # Decode-shaped: per scheduled request 1 + max_draft_len tokens; 256 | ||
| # leaves generous headroom for warmup/dummy batches. | ||
| max_num_tokens: 256 | ||
| # Target ISL 8192 + OSL 1024 (+ margin). | ||
| max_seq_len: 9236 | ||
| kv_cache_config: | ||
| enable_block_reuse: false # mandatory for K3 (KDA state) | ||
| tokens_per_block: 64 # mandatory for K3 MLA kernels | ||
| # Proven by the aggregated DEP16 SA evals on GB300; bounds decode | ||
| # concurrency x seq-len. Tune upward once the deployment is stable. | ||
| free_gpu_memory_fraction: 0.25 | ||
| cache_transceiver_config: | ||
| backend: NIXL | ||
| # Mandatory for K3: `auto` resolves to the C++ transceiver, which | ||
| # throws for K3's MixedMambaHybridCacheManager. | ||
| transceiver_runtime: PYTHON | ||
| # Must be >= the target max ISL and match the ctx side. | ||
| max_tokens_in_buffer: 8448 | ||
| # Fabric-VMM bounce buffer (recv side); must match the ctx server. | ||
| # Without it, cross-node V2 pool-to-pool transfers fall back to | ||
| # ~0.4 GB/s host-staged tcp; 512 MiB measured at ~455 GB/s/GPU. | ||
| # Bounce engages automatically above TRTLLM_KV_CACHE_BOUNCE_MIN_BYTES | ||
| # (default 2 MiB) — always true for K3 payloads. | ||
| # Sized to fit one full request payload (fixed 433 MiB KDA state + | ||
| # ~27 KB/token MLA latent; 649 MiB at 8k ISL) -- see ctx_config.yaml; | ||
| # at 512 every 8k transfer falls back to the per-fragment tcp path. | ||
| kv_cache_bounce_size_mb: 1024 | ||
| speculative_config: | ||
| decoding_type: SA | ||
| max_draft_len: 2 | ||
| max_matching_ngram_size: -1 # longest match via suffix automaton |
21 changes: 21 additions & 0 deletions
21
tests/integration/defs/disaggregated/test_configs/disagg_config_sa.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,21 @@ | ||
| hostname: localhost | ||
| model: TinyLlama/TinyLlama-1.1B-Chat-v1.0 | ||
| free_gpu_memory_fraction: 0.1 | ||
| backend: pytorch | ||
| disable_overlap_scheduler: true | ||
| context_servers: | ||
| num_instances: 1 | ||
| tensor_parallel_size: 1 | ||
| pipeline_parallel_size: 1 | ||
| cache_transceiver_config: | ||
| backend: DEFAULT | ||
| generation_servers: | ||
| num_instances: 1 | ||
| tensor_parallel_size: 1 | ||
| pipeline_parallel_size: 1 | ||
| cache_transceiver_config: | ||
| backend: DEFAULT | ||
| speculative_config: | ||
| decoding_type: SA | ||
| max_draft_len: 4 | ||
| max_matching_ngram_size: 4 | ||
29 changes: 29 additions & 0 deletions
29
tests/integration/defs/disaggregated/test_configs/disagg_config_sa_python.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,29 @@ | ||
| # Spec-split SA regression on the V2 PYTHON transceiver path: | ||
| # identical to disagg_config_sa.yaml (ctx: no speculative_config, | ||
| # gen: SA) but with backend NIXL + transceiver_runtime PYTHON on both | ||
| # servers -- the runtime combination Kimi K3 disagg is required to use. | ||
| # The existing test_disaggregated_sa covers the spec split only on the | ||
| # C++ DEFAULT backend. | ||
| hostname: localhost | ||
| model: TinyLlama/TinyLlama-1.1B-Chat-v1.0 | ||
| free_gpu_memory_fraction: 0.1 | ||
| backend: pytorch | ||
| disable_overlap_scheduler: true | ||
| context_servers: | ||
| num_instances: 1 | ||
| tensor_parallel_size: 1 | ||
| pipeline_parallel_size: 1 | ||
| cache_transceiver_config: | ||
| backend: NIXL | ||
| transceiver_runtime: PYTHON | ||
| generation_servers: | ||
| num_instances: 1 | ||
| tensor_parallel_size: 1 | ||
| pipeline_parallel_size: 1 | ||
| cache_transceiver_config: | ||
| backend: NIXL | ||
| transceiver_runtime: PYTHON | ||
| speculative_config: | ||
| decoding_type: SA | ||
| max_draft_len: 4 | ||
| max_matching_ngram_size: 4 |
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
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.