jetson-speculative-decoding
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseJetson Speculative Decoding (vLLM)
Jetson 推测解码(vLLM)
Speculative decoding lets a small "draft" model propose tokens that the target model verifies in a single forward pass, reducing per-token latency. On Jetson, the win/loss is dominated by VRAM headroom, not by the draft quality. This skill encodes the parts an LLM won't already know.
推测解码让一个小型"草稿"模型先预测token,再由目标模型在单次前向传播中验证,从而降低每个token的延迟。在Jetson平台上,效果好坏主要取决于显存余量,而非草稿模型的质量。本技能涵盖了大语言模型本身不会知晓的细节部分。
Purpose
目的
Tune an existing Jetson vLLM deployment for faster token generation by appending the right and validating whether it improves single-stream decode speed.
--speculative-config通过添加正确的参数并验证是否提升了单流解码速度,优化现有的Jetson vLLM部署,加快token生成速度。
--speculative-configWhen to use
适用场景
- TPOT/ITL is the bottleneck (TTFT is fine, output is just slow).
- Workload is single-stream or low-concurrency (≤2). Speculation usually loses at high concurrency.
- Jetson family is Thor or AGX Orin. Do not suggest EAGLE-3 on Orin Nano/NX — there is rarely enough VRAM headroom to host both target and draft, and you'll OOM at startup.
- TPOT/ITL是瓶颈(TTFT表现良好,但输出速度较慢)。
- 工作负载为单流或低并发(≤2)。推测解码在高并发场景下通常效果不佳。
- Jetson系列为Thor或AGX Orin。请勿在Orin Nano/NX上使用EAGLE-3——这类设备几乎没有足够的显存同时容纳目标模型和草稿模型,启动时会出现内存不足(OOM)问题。
When NOT to use
不适用场景
- High-concurrency serving (≥8): batched decode usually beats speculation; the draft model just steals VRAM.
- Models without a published EAGLE-3 head — do not train one ad-hoc as a "fix".
- After applying flags that already pushed
jetson-inference-mem-tunenear the ceiling. Free at least ~2 GB first.--gpu-memory-utilization
- 高并发服务(≥8):批量解码通常优于推测解码;草稿模型只会占用显存资源。
- 没有已发布的EAGLE-3头部的模型——不要临时训练一个来"修复"问题。
- 已应用参数,且
jetson-inference-mem-tune已接近上限的情况。请先释放至少约2GB的显存。--gpu-memory-utilization
Prerequisites
前置条件
- A working vLLM server recipe from .
jetson-llm-serve - Enough memory headroom for the draft model or EAGLE-3 head in addition to the target model.
- A benchmark baseline from before enabling speculation.
jetson-llm-benchmark - A target model with a compatible EAGLE-3 head, or a small same-family draft model for the fallback path.
- 拥有来自的可用vLLM服务器配置方案。
jetson-llm-serve - 除目标模型外,有足够的显存余量容纳草稿模型或EAGLE-3头部。
- 在启用推测解码前,通过获取基准测试数据。
jetson-llm-benchmark - 目标模型需具备兼容的EAGLE-3头部,或者有同系列的小型草稿模型作为备选方案。
Instructions
操作步骤
Append to the command shown in .
--speculative-configvllm servejetson-llm-serveEAGLE-3 (preferred when a head is published for the target model):
bash
--speculative-config '{
"method": "eagle3",
"model": "<eagle3-head-repo-id>",
"num_speculative_tokens": 5,
"draft_tensor_parallel_size": 1
}'Draft-model (fallback — pair a small same-family model):
bash
--speculative-config '{
"method": "draft_model",
"model": "<small-draft-model-repo-id>",
"num_speculative_tokens": 4,
"draft_tensor_parallel_size": 1
}'在提供的命令后添加参数。
jetson-llm-servevllm serve--speculative-configEAGLE-3(当目标模型有已发布的头部时优先使用):
bash
--speculative-config '{
"method": "eagle3",
"model": "<eagle3-head-repo-id>",
"num_speculative_tokens": 5,
"draft_tensor_parallel_size": 1
}'草稿模型(备选方案——搭配同系列的小型模型):
bash
--speculative-config '{
"method": "draft_model",
"model": "<small-draft-model-repo-id>",
"num_speculative_tokens": 4,
"draft_tensor_parallel_size": 1
}'Jetson-specific tuning rules
Jetson专属调优规则
- : start at 5 on Thor, 3 on AGX Orin. Higher values pay off only if the draft acceptance rate is >0.6.
num_speculative_tokens - Always pair with the same vLLM runtime path used by : upstream vLLM 0.20+ (
jetson-llm-serve) or validated native vLLM 0.20+ on Thor, upstream vLLM 0.20+ on Orin JetPack 7.2 / L4T r39+, or the NVIDIA-AI-IOT vLLM image on older Orin. Do not use an Orin NVIDIA-AI-IOT vLLM image on Thor. Older runtimes may lack EAGLE-3 or the currentvllm/vllm-openai:latestshape.--speculative-config - Drop by ~0.05 vs the non-speculative baseline to give the draft model headroom.
--gpu-memory-utilization
- : start at 5 on Thor, 3 on AGX Orin. Higher values pay off only if the draft acceptance rate is >0.6.
num_speculative_tokens - Always pair with the same vLLM runtime path used by : upstream vLLM 0.20+ (
jetson-llm-serve) or validated native vLLM 0.20+ on Thor, upstream vLLM 0.20+ on Orin JetPack 7.2 / L4T r39+, or the NVIDIA-AI-IOT vLLM image on older Orin. Do not use an Orin NVIDIA-AI-IOT vLLM image on Thor. Older runtimes may lack EAGLE-3 or the currentvllm/vllm-openai:latestshape.--speculative-config - Drop by ~0.05 vs the non-speculative baseline to give the draft model headroom.
--gpu-memory-utilization
How to verify it actually helped
如何验证效果提升
- Run (vLLM path) at
jetson-llm-benchmarkbefore and after enabling speculation.--concurrency 1 - Acceptance: target ≥30% improvement in and ≥20% drop in
throughput_tok_sat concurrency 1.tpot_ms_p50 - If improvement is <10%, or regresses at concurrency 8, disable speculation. The draft model is costing more than it returns.
throughput_tok_s
- Run (vLLM path) at
jetson-llm-benchmarkbefore and after enabling speculation.--concurrency 1 - Acceptance: target ≥30% improvement in and ≥20% drop in
throughput_tok_sat concurrency 1.tpot_ms_p50 - If improvement is <10%, or regresses at concurrency 8, disable speculation. The draft model is costing more than it returns.
throughput_tok_s
Limitations
Limitations
- Speculative decoding improves decode-heavy workloads; it does not reduce TTFT-dominated latency.
- High concurrency can erase the benefit because continuous batching already keeps the GPU busy.
- Orin Nano/NX usually lack enough memory headroom for both target and draft models.
- Acceptance rate and draft overhead are model-specific, so benchmark before and after instead of assuming a speedup.
- Speculative decoding improves decode-heavy workloads; it does not reduce TTFT-dominated latency.
- High concurrency can erase the benefit because continuous batching already keeps the GPU busy.
- Orin Nano/NX usually lack enough memory headroom for both target and draft models.
- Acceptance rate and draft overhead are model-specific, so benchmark before and after instead of assuming a speedup.
Error handling
Error handling
- If vLLM rejects , verify that Thor and Orin JetPack 7.2 / L4T r39+ are using vLLM 0.20+ and that older Orin is using a JetPack-matched NVIDIA-AI-IOT vLLM image; then switch back to the non-speculative serving command if the runtime still rejects it.
--speculative-config - If startup OOMs, lower , use a smaller draft, or disable speculation and hand off to
--gpu-memory-utilization.jetson-inference-mem-tune - If benchmark throughput regresses, remove ; a bad draft path is worse than no speculation.
--speculative-config
- If vLLM rejects , verify that Thor and Orin JetPack 7.2 / L4T r39+ are using vLLM 0.20+ and that older Orin is using a JetPack-matched NVIDIA-AI-IOT vLLM image; then switch back to the non-speculative serving command if the runtime still rejects it.
--speculative-config - If startup OOMs, lower , use a smaller draft, or disable speculation and hand off to
--gpu-memory-utilization.jetson-inference-mem-tune - If benchmark throughput regresses, remove ; a bad draft path is worse than no speculation.
--speculative-config
Hand off to
Hand off to
- to quantify the change.
jetson-llm-benchmark - if startup OOMs after enabling speculation.
jetson-inference-mem-tune
- to quantify the change.
jetson-llm-benchmark - if startup OOMs after enabling speculation.
jetson-inference-mem-tune
Source
Source
vLLM speculative decoding docs and the Jetson AI Lab GenAI tutorial.
vLLM speculative decoding docs and the Jetson AI Lab GenAI tutorial.