<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[双 3090 NVLink 跑 Qwen3.8-27B：vLLM + AWQ-INT4 + MTP，工具调用 130 t/s、262K 上下文全开（附完整配置与 8 个踩坑）]]></title><description><![CDATA[<blockquote>
<p dir="auto">之前发过 Qwen3.6-27B 的实测（<a href="https://lcz.me/topic/322">双 3090 NVLink，128K 上下文</a>），这次模型换代到 3.8，同时把整套部署重新调了一遍。楼上那篇 <a href="https://lcz.me/topic/1164">7900XTX + llama.cpp Vulkan</a> 写得很好，这篇是它的 NVIDIA 对照版：两条路线都跑到 130 t/s 上下，但方法完全不同。</p>
</blockquote>
<p dir="auto">先讲结论，再讲一个我们绕最久的坑。</p>
<h2>1. 先给结论</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>工作负载</th>
<th>decode 速度（本文实测）</th>
</tr>
</thead>
<tbody>
<tr>
<td>工具调用（JSON 输出）</td>
<td><strong>129.0 – 132.8 t/s</strong></td>
</tr>
<tr>
<td>Python 代码生成</td>
<td><strong>126.2 – 127.0 t/s</strong></td>
</tr>
<tr>
<td>短 prompt（计数类）</td>
<td><strong>130.3 – 134.7 t/s</strong></td>
</tr>
<tr>
<td>中文散文创作</td>
<td><strong>69.5 – 77.3 t/s</strong></td>
</tr>
<tr>
<td>prefill（39K token 非重复）</td>
<td><strong>≈1,423 t/s</strong>（TTFT 27.4s）</td>
</tr>
<tr>
<td>prefill（32K token 重复、cache 命中）</td>
<td><strong>TTFT 1.38s</strong></td>
</tr>
</tbody>
</table>
<ul>
<li>硬件：<strong>2× RTX 3090 24GB + NVLink 桥接</strong>（拓扑 NV4）</li>
<li>软件：<strong>vLLM 0.27.1</strong>（CUDA 路线）</li>
<li>模型：<code>shawnw3i-Huihui-Qwen3.8-27B-abliterated-AWQ-MTP</code>（AWQ-INT4，社群量化版）</li>
<li>上下文：<strong>262,144 全开</strong>，每卡显存占用约 22.7GB</li>
</ul>
<p dir="auto">白话：t/s = 每秒吐几个字；MTP = 用便宜「草稿头」先猜下一步再验证的加速技术，猜得准就快。本文的数字都附测法。</p>
<p dir="auto">一句话：<strong>MTP 方法名用对，速度从 65 直接翻到 130</strong>；这篇主要就是讲这件事。</p>
<h2>2. 硬件与软件环境</h2>
<h3>硬件</h3>
<ul>
<li>2× NVIDIA RTX 3090 24GB，NVLink 桥接（<code>nvidia-smi topo -m</code> 显示 NV4，双卡真并行）</li>
<li>P2P 状态 <strong>OK</strong>（<code>nvidia-smi topo -p2p r</code>）——双卡直连通讯无阻，TP=2 才值得玩</li>
<li>CPU：decode 是 GPU 显存频宽瓶颈、CPU 影响小，但别太老（prefill 和调度会吃到 CPU）</li>
</ul>
<h3>软件</h3>
<ul>
<li>vLLM <strong>0.27.1</strong>（pip 安装，独立 venv）</li>
<li>flashinfer（<code>VLLM_USE_FLASHINFER_SAMPLER=1</code> 走 flashinfer 取样器）</li>
<li>CUDA 12.x / PyTorch 对应版本</li>
</ul>
<h3>模型</h3>
<ul>
<li><code>shawnw3i-Huihui-Qwen3.8-27B-abliterated-AWQ-MTP</code>：社群 AWQ-INT4 量化版，内含 MTP head</li>
<li>同型公开版：<code>shawnw3i/Qwen3.8-27B-AWQ-MTP</code>；基底：<code>huihui-ai/Huihui-Qwen3.8-27B-abliterated</code></li>
<li>挑它：INT4 ≈ 每卡 18GB 级显存，262K 塞得下，MTP head 完整保留</li>
</ul>
<h2>3. 完整配置（可直接复制）</h2>
<pre><code class="language-bash">export VLLM_USE_FLASHINFER_SAMPLER=1
export FLASHINFER_DISABLE_VERSION_CHECK=1
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True

python -m vllm.entrypoints.openai.api_server \
  --model /path/to/shawnw3i-Huihui-Qwen3.8-27B-abliterated-AWQ-MTP \
  --served-model-name shawnw3i \
  --host 0.0.0.0 --port 8000 \
  --dtype bfloat16 \
  --quantization awq_marlin \
  --kv-cache-dtype fp8_e4m3 \
  --tensor-parallel-size 2 \
  --max-model-len 262144 \
  --max-num-seqs 1 \
  --max-num-batched-tokens 4096 \
  --gpu-memory-utilization 0.95 \
  --enable-chunked-prefill \
  --block-size 16 \
  --enable-prefix-caching \
  --disable-custom-all-reduce \
  --scheduling-policy priority \
  --speculative-config '{"method":"qwen3_5_mtp","num_speculative_tokens":3}' \
  --reasoning-parser qwen3 \
  --tool-call-parser qwen3_xml \
  --default-chat-template-kwargs '{"enable_thinking": true, "preserve_thinking": true}'
</code></pre>
<h3>逐行解释关键参数</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>参数</th>
<th>为什么是这个值</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--quantization awq_marlin</code></td>
<td>Ampere（30 系）跑 Marlin kernel 比原生 AWQ 快；INT4 让 262K 塞得进 24GB×2</td>
</tr>
<tr>
<td><code>--kv-cache-dtype fp8_e4m3</code></td>
<td>KV cache 量化，省下的显存全拿去开上下文</td>
</tr>
<tr>
<td><code>--max-model-len 262144</code></td>
<td>模型原生上限全开。开太大启动时直接 OOM 或 silent 降级</td>
</tr>
<tr>
<td><code>--max-num-seqs 1</code></td>
<td>单请求独占双卡——agent 场景（一次一使用者）最佳解</td>
</tr>
<tr>
<td><code>--max-num-batched-tokens 4096</code></td>
<td>chunked prefill 块大小，太大 TTFT 升、太小吞吐降</td>
</tr>
<tr>
<td><code>--enable-prefix-caching</code></td>
<td>agent 神技：每轮 system prompt + 工具 schema 完全相同，radix cache 直接命中。对齐实测：相同 16K prompt 连发，TTFT 7.24s → 0.87s（8.3×，见第 6 节）</td>
</tr>
<tr>
<td><code>--disable-custom-all-reduce</code></td>
<td><strong>这行不能拔</strong>。我们 A/B 实测：拔掉（改用 vLLM 自订 allreduce，<code>nvidia-smi topo -p2p r</code> 显示 P2P OK）→ CUDA graph capture 阶段 worker 无声崩溃，systemd 重启循环连崩 3 次；加回 → 稳定 130 t/s。GeForce 的 NVLink P2P 对 vLLM CUSTOM AR 不稳，NCCL 才是稳路。细节见踩坑 #8</td>
</tr>
<tr>
<td><code>--speculative-config '{"method":"qwen3_5_mtp","num_speculative_tokens":3}'</code></td>
<td><strong>全文最重要的参数</strong>，见第 4 节</td>
</tr>
<tr>
<td><code>--reasoning-parser qwen3</code> + enable_thinking</td>
<td>保留思考模式（agent 场景值回票价）</td>
</tr>
<tr>
<td><code>--tool-call-parser qwen3_xml</code></td>
<td>工具呼叫解析，vLLM 原生 structured output</td>
</tr>
<tr>
<td><code>--default-chat-template-kwargs '{"enable_thinking": true, "preserve_thinking": true}'</code></td>
<td>开思考链＋保留思考 token。注意：这是 chat template 的 kwargs，不是独立旗标</td>
</tr>
<tr>
<td><code>VLLM_USE_FLASHINFER_SAMPLER=1</code></td>
<td>flashinfer 取样比默认快</td>
</tr>
<tr>
<td><code>FLASHINFER_DISABLE_VERSION_CHECK=1</code></td>
<td>flashinfer-cubin 与 python 打包版本号不一致的官方认可绕行</td>
</tr>
</tbody>
</table>
<h2>4. <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f534.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--red_circle" style="height:23px;width:auto;vertical-align:middle" title="🔴" alt="🔴" /> 全文核心：MTP 方法名用错 = MTP 从头到尾没启动</h2>
<p dir="auto">这是我们绕最久、也最想救人的坑。</p>
<p dir="auto">vLLM 的 MTP 方法名是<strong>按模型架构世代</strong>分的：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>方法名</th>
<th>适用架构</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>qwen3_5_mtp</code></td>
<td><strong>Qwen3.5 / Qwen3.6 / Qwen3.8 共用</strong>（vLLM Recipes 官网明载）</td>
</tr>
<tr>
<td><code>qwen3_next_mtp</code></td>
<td><strong>Qwen3-Next 专用</strong>，别的型号用了直接无效</td>
</tr>
</tbody>
</table>
<p dir="auto">我们一开始写成 <code>qwen3_next_mtp</code>，vLLM <strong>不报错、不警告</strong>，静默当成普通推理跑——速度一直卡在 65 t/s 上下，还以为「这模型就这样」。<strong>这比报错更危险</strong>：报错你会去查，静默你会以为这就是天花板。</p>
<p dir="auto"><strong>三种方式确认 MTP 有没有真的启动：</strong></p>
<ol>
<li>启动日志找 <code>speculative</code> 相关行（有没有载入 MTP head）</li>
<li>看 <code>index.json</code> 的 weight_map 里有没有 <code>mtp</code> tensors</li>
<li><strong>终极判据：速度</strong>——有 MTP 130 t/s vs 无 MTP ~65 t/s，差一倍，不可能认错</li>
</ol>
<p dir="auto">官方参考：<a href="https://recipes.vllm.ai/Qwen/Qwen3.8-27B" rel="nofollow ugc">vLLM Recipes — Qwen3.8-27B</a>（明文：MTP head 拼法 <code>qwen3_5_mtp</code>）</p>
<h2>5. 为什么论坛的数字差两倍</h2>
<p dir="auto">同一台机器、同一组参数，只换测试题目：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>题目</th>
<th>decode</th>
</tr>
</thead>
<tbody>
<tr>
<td>中文散文创作（600 tok）</td>
<td><strong>69.5 – 77.3 t/s</strong></td>
</tr>
<tr>
<td>Python 代码生成</td>
<td><strong>126.2 – 127.0 t/s</strong></td>
</tr>
<tr>
<td>工具调用 JSON</td>
<td><strong>129.0 – 132.8 t/s</strong></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>差距接近一倍，参数一个字没改。</strong> 原因和 7900XTX 那篇说的一样：MTP 的速度取决于草稿猜得准不准。创作类文本下一步几乎不可预测，接受率砍半，速度腰斩。</p>
<p dir="auto"><strong>所以「双 3090 跑 Qwen3.8 有几 t/s」没有标准答案——先问「跑什么题目」。</strong> 我们日常是 Hermes agent（工具调用＋长 system prompt），130 t/s 就是真实体感；写小说的人体感会是 70。</p>
<p dir="auto"><strong>测法（照抄可复现）</strong>：<code>/v1/chat/completions</code>，<code>max_tokens=600</code>，每型跑 3 次、<strong>3 次全报</strong>，decode = completion_tokens / 耗时。工具调用三次原始值：<strong>129.0 / 130.1 / 132.8（中位数 130.1）</strong>——标题的 130 取中位数，不是单次峰值。题目原文：</p>
<ul>
<li>计数：「Count from 1 to 100, one number per line.」</li>
<li>代码：「Write a Python function that implements quicksort with comments. Code only, no explanation.」</li>
<li>中文散文：「写一篇关于东京夏天的游记，连续写不要停」（temperature 0.7）</li>
<li>工具调用：「Output only a JSON object describing an API call to get weather for Tokyo」</li>
</ul>
<h2>6. prefill 实测 + prefix caching 的 8.3 倍</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>测试</th>
<th>TTFT</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>39K 非重复文本（cache 不命中）</td>
<td>27.4s → prefill ≈ 1,423 t/s</td>
<td>冷启动基准</td>
</tr>
<tr>
<td>16K 非重复文本，第一次（对照组）</td>
<td>7.24s</td>
<td>对齐对照</td>
</tr>
<tr>
<td><strong>16K 完全相同 prompt，第二次（cache 命中）</strong></td>
<td><strong>0.87s</strong></td>
<td><strong>加速 8.3×</strong></td>
</tr>
</tbody>
</table>
<p dir="auto">注：早期试过「同一行重复 4000 次」的病态 prompt，TTFT 1.38s ≈ 20×——但那是 cache 的极端上限、不是真实场景，本文只采用上表 token 数对齐的 8.3×。</p>
<p dir="auto">两点心得：</p>
<ol>
<li><strong>prefill 别用短 prompt 测</strong>——固定开销会量出荒谬数字，用 ≥2K token。</li>
<li><strong>agent 场景 prefix caching 是白送的性能</strong>：agent 每一轮的 system prompt + 工具 schema + 对话历史都是<strong>逐字相同的前缀</strong>，radix cache 全中，第二轮起 TTFT 压到 1 秒内（上表 0.87s 就是真实模式）。vLLM 官方对「低并发延迟敏感」建议关它配 MTP-1，但那是「每次 prompt 都不一样」的批次服务；agent 对话反而 cache 全中，实测保留才快。</li>
</ol>
<h2>6.5 MTP 接受率衰减 + 功耗实测</h2>
<p dir="auto">有人问「MTP 在长上下文会不会失效」——我们直接量了三点（测法：/metrics 的 <code>spec_decode_num_accepted_tokens_total</code> ÷ <code>spec_decode_num_draft_tokens_total</code> 前后差）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>上下文长度</th>
<th>MTP 接受率</th>
<th>decode（同题目）</th>
<th>TTFT</th>
</tr>
</thead>
<tbody>
<tr>
<td>~2K token</td>
<td><strong>51.9%</strong></td>
<td>99.5 t/s</td>
<td>1.0s</td>
</tr>
<tr>
<td>~36K token</td>
<td><strong>48.4%</strong></td>
<td>90.0 t/s</td>
<td>17.6s</td>
</tr>
<tr>
<td>~139K token</td>
<td><strong>47.4%</strong></td>
<td>75.7 t/s</td>
<td>99.1s</td>
</tr>
</tbody>
</table>
<ul>
<li><strong>接受率衰减非常平缓</strong>（51.9→47.4%），MTP 到 139K 上下文还稳得住，这是我们敢把 262K 全开的信心来源</li>
<li>decode 速度随上下文下降（99.5→75.7）主要是 KV cache 读取变大，属正常物理</li>
<li>三个草稿位置的累计接受率：第 1 个 71%、第 2 个 49%、第 3 个 37%——想调 <code>num_speculative_tokens</code> 的可以先看这组：猜 2 个性价比最高（71%+49% 都会用到）</li>
</ul>
<p dir="auto">功耗（nvidia-smi 实测，双卡 350W 上限）：</p>
<ul>
<li>空载：每卡 ~17-19W</li>
<li>满载（prefill 与 decode 阶段皆是）：每卡 ~347W，<strong>双卡峰值 ~695W</strong></li>
<li>换算：116-130 t/s ÷ 695W ≈ <strong>0.18 t/s/W</strong>（写作任务约 0.11）——想算电费的楼友自己乘电价</li>
</ul>
<h2>7. 踩坑记录（8 个，vLLM/CUDA 专属）</h2>
<ol>
<li><strong>MTP 方法名</strong>：<code>qwen3_5_mtp</code> ≠ <code>qwen3_next_mtp</code>，用错静默失效（第 4 节）。第一大坑</li>
<li><strong>torch_compile_cache 污染</strong>：换过模型后残留 compile cache 会让新模型 segfault，换模型必清</li>
<li><strong>alias 名称匹配</strong>：<code>--served-model-name</code> 要和呼叫端 100% 一致，否则 404 → fallback 跑去别的模型</li>
<li><strong>同时只跑一个 instance</strong>：双卡 48GB，两个 27B instance 直接 OOM。单 instance 铁律</li>
<li><strong>AWQ + torch compile 会死 worker</strong>：AWQ 别开 compile（<code>VLLM_TORCH_COMPILE_LEVEL=0</code>）</li>
<li><strong>thinking 吃 decode 预算</strong>：本表所有数字都<strong>含</strong> thinking token。关掉会更高，但 agent 场景思考品质重要</li>
<li><strong>262K 不是免费的</strong>：context 全开代表长对话 prefill 线性上升（27.4s），日常无感因为 prefix caching 挡前面</li>
<li><strong><code>--disable-custom-all-reduce</code> 不能拔（本周 A/B 实测）</strong>：想说 <code>nvidia-smi topo -p2p r</code> 都 OK 了，不如拔了让 vLLM 用 CUSTOM allreduce——结果 <strong>CUDA graph capture 阶段 worker 无声崩溃</strong>（log 停在 warmup、无错误输出），systemd 重启循环连崩 3 次；加回 flag 走 NCCL → 稳定。<strong>教训：GeForce 的 NVLink P2P ≠ vLLM CUSTOM AR 可用</strong>；「拔掉理论上更快」实测是「拔掉直接死」</li>
</ol>
<h2>8. 和旧贴文（Qwen3.6 时期）的对比</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th></th>
<th>之前（Qwen3.6-27B）</th>
<th>现在（Qwen3.8-27B）</th>
</tr>
</thead>
<tbody>
<tr>
<td>量化</td>
<td>GPTQ Marlin INT4</td>
<td>AWQ Marlin INT4</td>
</tr>
<tr>
<td>加速</td>
<td>无 MTP</td>
<td>MTP ×3 正确启用</td>
</tr>
<tr>
<td>工具调用</td>
<td>~67 t/s</td>
<td><strong>129-132.8 t/s</strong></td>
</tr>
<tr>
<td>上下文</td>
<td>262K（已全开）</td>
<td>262K（维持）</td>
</tr>
</tbody>
</table>
<p dir="auto">说明：67 是「上一代 GPTQ 的基准」，65 是「这一代 MTP 踩坑时的速度」，两者接近纯属巧合；130 才是修正后的真实水准。<strong>从 67/65 到 130，几乎全部来自 MTP 修正</strong>——这也再次证明第 4 节那个坑有多贵。（7 t/s 与 67 t/s 数字出自旧贴 <a href="https://lcz.me/topic/322">topic/322</a> 实测原文）</p>
<h2>9. 社群对照（同双 3090 硬件的公开数据）</h2>
<p dir="auto">Reddit r/LocalLLaMA 有一串「Optimized Dual 3090 Qwen3.8 Quant」，同款硬件跑同一模型的公开结果，把我们摆进去是这样：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>来源</th>
<th>配置</th>
<th>decode @8K/1 stream</th>
</tr>
</thead>
<tbody>
<tr>
<td>jbro1985</td>
<td>INT8-W8A16、<strong>无 NVLink</strong>（Oculink x4）、TP2</td>
<td><strong>59.7 t/s</strong>（接受率 53-57%）</td>
</tr>
<tr>
<td>Schlopper</td>
<td>INT8-W8A16、max-num-seqs 6</td>
<td>87 t/s（2 streams 平均，接受率 77%）</td>
</tr>
<tr>
<td><strong>本文</strong></td>
<td><strong>AWQ-INT4、NVLink NV4、max-num-seqs 1</strong></td>
<td><strong>129-134 t/s</strong></td>
</tr>
</tbody>
</table>
<p dir="auto">社群当时的判断（jbro1985 原话大意）：「3.8 比 3.6 慢主要是权重读取频宽（14.7 vs 9.4 GiB/卡），<strong>等 3.8-INT4 出来就会追回来</strong>」——本文 129-134 正是这个预言的实证：<strong>INT4 不只省显存，权重频宽砍半直接反映在 decode 速度</strong>。</p>
<h2>10. 诚实揭露：未测项目</h2>
<ul>
<li>并发多请求（我们是 max-num-seqs=1 单使用者）</li>
<li>其他量化格式（GPTQ/FBGEMM 没在同模型重测）</li>
<li>长上下文「大海捞针」品质（262K 极限注意力品质）</li>
<li>num_speculative_tokens（1/2/3/4）完整扫描（沿用 3 就没再扫）</li>
<li><s><code>--disable-custom-all-reduce</code> 的 A/B</s> <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> <strong>已测</strong>：见踩坑 #8（拔掉=崩溃循环，保留=稳定）</li>
<li>接受率衰减已测三点（§6.5），但 139K→262K 尾段还没量</li>
</ul>
<h2>11. 下一步想做</h2>
<ul>
<li>MTP num_speculative_tokens 完整扫描</li>
<li>开 thinking vs 关 thinking 的速度/品质对照</li>
<li>长上下文针测</li>
</ul>
<hr />
<p dir="auto">有问题直接在楼里问，参数哪一行看不懂、或想照抄但显存对不上，都可以聊。第 10 节未测清单还有很多可以挖——有更优的配置直接打脸我们也没关系，那就是发这篇文的目的。</p>
]]></description><link>https://lcz.me/topic/1245</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 22:53:24 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1245.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 21 Aug 2026 07:17:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 双 3090 NVLink 跑 Qwen3.8-27B：vLLM + AWQ-INT4 + MTP，工具调用 130 t/s、262K 上下文全开（附完整配置与 8 个踩坑） on Sun, 23 Aug 2026 03:46:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stxpnet" aria-label="Profile: stxpnet">@<bdi>stxpnet</bdi></a> 欢迎前辈一起讨论 我觉得一起讨论优化 才会越来越好</p>
]]></description><link>https://lcz.me/post/13529</link><guid isPermaLink="true">https://lcz.me/post/13529</guid><dc:creator><![CDATA[starryskyknight]]></dc:creator><pubDate>Sun, 23 Aug 2026 03:46:54 GMT</pubDate></item><item><title><![CDATA[Reply to 双 3090 NVLink 跑 Qwen3.8-27B：vLLM + AWQ-INT4 + MTP，工具调用 130 t/s、262K 上下文全开（附完整配置与 8 个踩坑） on Sun, 23 Aug 2026 02:49:06 GMT]]></title><description><![CDATA[<p dir="auto">大赞，我的模型不是这个，但我让GLM抄作业，吸取你的亮点，晚点实测一下</p>
]]></description><link>https://lcz.me/post/13522</link><guid isPermaLink="true">https://lcz.me/post/13522</guid><dc:creator><![CDATA[stxpnet]]></dc:creator><pubDate>Sun, 23 Aug 2026 02:49:06 GMT</pubDate></item><item><title><![CDATA[Reply to 双 3090 NVLink 跑 Qwen3.8-27B：vLLM + AWQ-INT4 + MTP，工具调用 130 t/s、262K 上下文全开（附完整配置与 8 个踩坑） on Fri, 21 Aug 2026 07:22:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/starryskyknight" aria-label="Profile: starryskyknight">@<bdi>starryskyknight</bdi></a> 先赞一个，这组数据把 MTP 的脾气测得很清楚。你 65→130 的翻倍和散文档 69-77 的「不翻倍」，是同一个机制的两面：MTP 吃的是草稿头猜得准不准，跟任务难易无关，跟输出 token 的熵有关。</p>
<ul>
<li>工具调用/JSON 输出是低熵文本：键名、schema、括号引号全是模板化的，草稿头一猜一个准，验证批量通过。130/65 = 2.0×，等效每步多接受约 1 个草稿 token（MTP-3 下平均接受数 ≈ 1）。</li>
<li>中文散文是高熵自由文本：下一个 token 可能性极多，草稿头命中率趋近 0，验证几乎全废 → 69-77 基本贴着无 MTP 基线（65），只剩 1.06-1.19× 的残值。</li>
<li>你开了 enable_thinking，思考链部分同样基本吃不到 MTP 红利（推理 token 也是高熵），真正翻倍的是结构化输出段。所以 agent 场景（工具调用 + 前缀缓存）正好是 MTP 的主场——你的 262K + radix 命中 TTFT 27.4s→1.38s 就是完整闭环。</li>
</ul>
<p dir="auto">另外 --disable-custom-all-reduce 那条很值钱：GeForce NVLink 上 vLLM 的 CUSTOM AR 在 CUDA graph 捕获阶段崩是已知坑，NCCL 路线稳。你 A/B 实测出来的「拔掉就崩、加回就 130」比任何 issue 帖都有说服力，值得去 vLLM repo 提一个带 nvidia-smi topo -p2p r 输出的 issue。</p>
<p dir="auto">想验证接受率的话，跑一组 num_speculative_tokens=1 的工具调用对照就行：草稿链短时每步命中率会明显更高（长链后面几步的命中率是递减的），接受率曲线一下子就出来了。</p>
]]></description><link>https://lcz.me/post/13263</link><guid isPermaLink="true">https://lcz.me/post/13263</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Fri, 21 Aug 2026 07:22:59 GMT</pubDate></item></channel></rss>