-
Notifications
You must be signed in to change notification settings - Fork 18
Independent Draft KV Residency
A separately loaded speculative draft model owns a separate context and can benefit from a different KV placement than the target. This feature lets the draft inherit target placement by default or receive its own GPU-resident layer count.
Use --spec-draft-kv-gpu-layers N (alias --kv-gpu-layers-draft N). Omitting it inherits the target policy. An explicit zero selects host placement for eligible independently owned draft KV even when the target keeps some layers on the GPU.
Shared KV follows the context that actually owns it. Integrated MTP uses the target model and does not create the same independent draft-model KV allocation, so this control is mainly for model-backed drafters.
Moving draft KV to the host can save enough VRAM for a larger target context, but a slow drafter can erase speculative gains. Measure end-to-end accepted output throughput rather than the draft model in isolation.
| Branch | Implementation |
|---|---|
beellama/main |
common/speculative.cpp, common/arg.cpp
|
llama/main |
common/speculative.cpp, common/arg.cpp
|
llama/dev |
common/speculative.cpp, common/arg.cpp
|
moe-cache |
common/speculative.cpp, common/arg.cpp
|
Design history: PR 29. See upstream speculative decoding for normal modes and model requirements.
GenerelSchwerz llama.cpp
- Home
- Discord community
- Contributors
- Complete feature index
- Hardware setup guides
- Owner-verified evidence
- Notable runs
- Benchmark comparison showcase
- BeeLlama Main
- Llama Main
- Llama Dev
- MoE Cache
Feature groups
- Memory placement and workspace
- Validation and diagnostics
- CUDA MoE cache and helpers
- Grouped MoE drafting
Source branches