<?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[# SGLang 投机解码在 32GB 卡上的选型指南：DFlash2 / MTP / 无投机实测]]></title><description><![CDATA[<p dir="auto">之前发的关于SGLang调试经历的帖子，大家翻阅参考：<br />
<a href="https://lcz.me/topic/1621">https://lcz.me/topic/1621</a><br />
<a href="https://lcz.me/topic/1620">https://lcz.me/topic/1620</a><br />
上一篇把 Qwen3.8-27B 在 RTX 4080 SUPER 32G 上用 SGLang 跑通并修好了 MTP 的 KV 池崩塌问题。这一篇回答一个更实际的问题：<strong>同样是投机解码，MTP 和 DFlash2 到底选哪个？</strong></p>
<p dir="auto">整机配置<br />
CPU：AMD Ryzen 7 9700X（8核16线程）<br />
内存：64GB DDR5<br />
显卡：NVIDIA RTX 4080 SUPER 32GB（32760 MiB）<br />
系统：Ubuntu（SGLang 这套）／Windows 11（上一篇 llama.cpp 那套）</p>
<p dir="auto">结论先行：<strong>短上下文和长上下文，DFlash2 全面胜出（短上下文快 1.5~1.8 倍，128K 长上下文快 1.67 倍）；代价是显存——DFlash2 的草稿模型要占 3.69GB 显存，KV 池从 33 万 token 掉到 11~14 万，双路 128K 从此不可能。</strong></p>
<p dir="auto">三条路全部实测，同一台机器、同一个目标模型、同一批提示词。</p>
<h2>一、结论表（同版本 0.5.19，RedHatAI INT4 目标模型）</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>场景</th>
<th>无投机</th>
<th>NEXTN (MTP)</th>
<th><strong>DFlash2</strong></th>
<th>DFlash2 vs MTP</th>
</tr>
</thead>
<tbody>
<tr>
<td>短上下文 代码 解码</td>
<td>41.8 t/s</td>
<td>89.3 t/s</td>
<td><strong>130.5 t/s</strong></td>
<td><strong>+46%</strong></td>
</tr>
<tr>
<td>短上下文 抽取原文 解码</td>
<td>40.6 t/s</td>
<td>86.5 t/s</td>
<td><strong>143.0 t/s</strong></td>
<td><strong>+65%</strong></td>
</tr>
<tr>
<td>短上下文 中文创作 解码</td>
<td>42.0 t/s</td>
<td>66.2 t/s</td>
<td><strong>75.2 t/s</strong></td>
<td>+14%</td>
</tr>
<tr>
<td>双流并发 聚合解码</td>
<td>76.9 t/s</td>
<td>166.7 t/s</td>
<td><strong>293.4 t/s</strong></td>
<td><strong>+76%</strong></td>
</tr>
<tr>
<td><strong>128K 长上下文 解码</strong></td>
<td>33.8 t/s</td>
<td>39.0 t/s</td>
<td><strong>65.3 t/s</strong></td>
<td><strong>+67%</strong></td>
</tr>
<tr>
<td>预填充 @119K</td>
<td>1207 tok/s</td>
<td>1166 tok/s</td>
<td>1203 tok/s</td>
<td>持平</td>
</tr>
<tr>
<td>接受长度（短/128K）</td>
<td>—</td>
<td>3.76 / 2.13</td>
<td><strong>4.74 / 2.91</strong></td>
<td>—</td>
</tr>
<tr>
<td>KV 池 token</td>
<td>331173</td>
<td>280537</td>
<td>137709（单路）&lt;br&gt;113997（双路）</td>
<td><strong>0.4×</strong></td>
</tr>
<tr>
<td>草稿显存</td>
<td>—</td>
<td>0.79 GB</td>
<td>3.69 GB</td>
<td>—</td>
</tr>
</tbody>
</table>
<p dir="auto">一句话：<strong>DFlash2 用 2.9GB 额外显存 + KV 池缩到 40%，换来 1.5~1.8 倍速度。</strong> 值不值，取决于你要的是吞吐还是长上下文。</p>
<h2>二、为什么 128K 场景差距反而更大</h2>
<p dir="auto">这是这次实测最有价值的发现。投机解码的收益 = 接受长度。而 <strong>MTP 的接受长度会随上下文长度剧烈衰减，DFlash2 基本不衰减</strong>：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>上下文</th>
<th>MTP 接受长度</th>
<th>DFlash2 接受长度</th>
</tr>
</thead>
<tbody>
<tr>
<td>短（1.6K~13K）</td>
<td>3.76</td>
<td>4.74~5.33</td>
</tr>
<tr>
<td>中（32K）</td>
<td>—</td>
<td>4.92</td>
</tr>
<tr>
<td><strong>128K</strong></td>
<td><strong>1.68 ~ 2.13</strong></td>
<td><strong>2.91</strong></td>
</tr>
</tbody>
</table>
<p dir="auto">短上下文 MTP 还能靠 3.76 的接受长度拿到 89 t/s；到了 128K 接受长度掉到 2 附近，投机验证的开销就快把收益吃光了，只剩 39 t/s（比无投机的 33.8 只快 15%）。<strong>DFlash2 在 128K 仍有 2.91 的接受长度，于是拿到 65.3 t/s。</strong></p>
<p dir="auto">原理上说得通：MTP 是"目标模型自带的单层草稿头"，它只见过目标模型的最后一层隐状态，长上下文里隐状态的分布漂移会直接削弱它的预测；DFlash2 是<strong>独立的 1.92B 草稿模型</strong>，用块扩散（block diffusion）一次并行预测一整块 8 个位置的 token 并保留每位的候选，再用一个轻量 selector 串成一条连贯路径，还从目标模型的第 5/19/33/47/61 层抽取隐状态做条件——信息量大得多，所以长上下文下更稳。</p>
<h2>三、环境：0.5.17 → 0.5.19 的隔离升级</h2>
<p dir="auto">DFlash2 在 <strong>SGLang 0.5.17 里根本不存在</strong>（<code>grep -i dflash2</code> 在整个 <code>srt/</code> 零命中，只有 DFLASH v1 的 worker）。0.5.19（2026-09-04 发布）包含了官方两个关键 PR：</p>
<ul>
<li><strong>#35371</strong> <code>[Spec] DFlash2: local convolution + candidate selector</code>（2026-08-19 合并）</li>
<li><strong>#35496</strong> <code>Support quantized target lm_head in the DFlash2 selector</code>（2026-08-20 合并）</li>
</ul>
<p dir="auto">第二个 PR 值得单独说一句：DFlash2 的 selector 要拿草稿隐状态<strong>直接和目标模型的 <code>lm_head.weight</code> 做 matmul</strong>，量化目标模型会报 <code>DFlash2 selector requires a dense FP16/BF16/FP32 target lm_head</code>。32G 卡上跑 27B 只能用量化模型，所以这个 PR 是刚需。</p>
<p dir="auto">不过实测发现<strong>我们的目标模型不需要它</strong>：RedHatAI INT4 的 <code>lm_head.weight</code> 是稠密 BF16（只有 Linear 层走 compressed-tensors pack-quantized，<code>lm_head</code> 在 ignore 列表里）。也就是说 0.5.18/0.5.19 都能用。</p>
<p dir="auto">升级做法是<strong>克隆 venv，不动原来那套</strong>，0.5.17 的双路 128K 配置完整保留当退路：</p>
<pre><code class="language-bash">rsync -a /home/shenzq/sglang-env/ /home/shenzq/sglang019-env/
sed -i 's#/home/shenzq/sglang-env#/home/shenzq/sglang019-env#g' /home/shenzq/sglang019-env/bin/*
/home/shenzq/sglang019-env/bin/python -m pip install -U "sglang==0.5.19" -i https://pypi.tuna.tsinghua.edu.cn/simple
</code></pre>
<p dir="auto">升级幅度不小：<strong>torch 2.11.0 → 2.13.0+cu130、flashinfer 0.6.15 → 0.6.18、sglang-kernel 0.4.5 → 0.4.6.post1、triton 3.7.1</strong>。</p>
<p dir="auto">启动（草稿模型 3.85GB，走 hf-mirror 下载）：</p>
<pre><code class="language-bash">export HF_ENDPOINT=https://hf-mirror.com
export HF_HUB_DISABLE_XET=1
python -m sglang.launch_server \
  --model-path /mnt/sda6/download/qwen38-redhat-int4 \
  --speculative-algorithm DFLASH \
  --speculative-draft-model-path incoai/Qwen3.8-27B-DFlash2 \
  --speculative-num-draft-tokens 8 \
  --context-length 131072 --mem-fraction-static 0.92 \
  --max-mamba-cache-size 5 --mamba-ssm-dtype bfloat16 \
  --cuda-graph-backend-prefill=disabled \
  --kv-cache-dtype fp8_e4m3 --page-size 1 --language-only
</code></pre>
<h2>四、显存账：为什么 DFlash2 吃掉了长上下文</h2>
<p dir="auto">32G 卡上的固定开销（实测，<code>--language-only</code>）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项目</th>
<th>大小</th>
</tr>
</thead>
<tbody>
<tr>
<td>目标模型 INT4 权重</td>
<td>17.65 GB</td>
</tr>
<tr>
<td>DFlash2 草稿模型（1.92B bf16）</td>
<td>3.69 GB</td>
</tr>
<tr>
<td>mamba 状态（8 槽 fp32）</td>
<td>3.54 GB</td>
</tr>
<tr>
<td><strong>融合 KV cell</strong></td>
<td><strong>42 KiB/token</strong>（目标 32 + 草稿 10）</td>
</tr>
</tbody>
</table>
<p dir="auto">关键在那个 <strong>42 KiB/token</strong>：DFlash2 的草稿 KV 是"融合"进同一个池子的（日志 <code>DFLASH fused KV materialization enabled</code>），所以每 token 的池子开销比无投机多 31%。草稿 KV 本身已经是 fp8（10 KiB/token，改不了），省不下来。</p>
<p dir="auto">于是 128K 单路要 131072 × 42 KiB = <strong>5.5GB KV</strong>，只能靠三件事挤出来：</p>
<ol>
<li><code>--mem-fraction-static 0.88 → 0.92</code>（+1.3GB）</li>
<li><code>--mamba-ssm-dtype bfloat16</code>（ssm 状态减半，省 1.75GB）</li>
<li><code>--max-mamba-cache-size 8 → 5</code>（再省 0.67GB）</li>
</ol>
<p dir="auto">挤完的结果：<strong>池 137709 token（单路）/ 113997（双路）</strong>。对比无投机的 331173、MTP 的 280537。</p>
<p dir="auto"><strong>所以双路 128K 在 DFlash2 下是不可能的</strong>：那需要 262144 × 42 KiB = 11GB KV，而 32G 卡上扣掉权重和 mamba 只剩 6GB 左右。要双路 128K，只能用 0.5.17 + 无投机（池 279214）那条路。</p>
<h2>五、无损性验证：7/8 逐字一致</h2>
<p dir="auto">DFlash2 官方声称"解码无损，greedy 输出与目标模型完全一致"。实测 8 个提示词（贪心解码，<code>temperature=0</code>），与同版本无投机输出逐字比对：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>提示词</th>
<th>结果</th>
</tr>
</thead>
<tbody>
<tr>
<td>常识 / 数学 / 中文创作 / 列表 / 逻辑 / 摘要 / 中文知识问答</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=ffa14597167" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> 7 项逐字相同</td>
</tr>
<tr>
<td>代码生成</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=ffa14597167" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 语义相同，单点 token 不同（280 vs 282 字符）</td>
</tr>
</tbody>
</table>
<p dir="auto">唯一差异出现在代码提示的这里：</p>
<pre><code>DFlash2：This will output: 55
无投机：This will output `55`.
</code></pre>
<p dir="auto">两句话语义等价，后续文本重新汇合——这是 <strong>fp8 KV cache + 投机验证改变了浮点运算顺序</strong>导致的近等分 token 翻转，不是模型能力差异。所以准确说法是**"近似无损"**：达不到位级完全一致，但语义一致。</p>
<h2>六、踩过的四个坑</h2>
<p dir="auto"><strong>坑 1：0.5.17 没有 DFlash2。</strong> 别指望加个参数就能用，必须升级（且 0.5.18 起才是 torch 2.13 那套依赖）。</p>
<p dir="auto"><strong>坑 2：<code>--mem-fraction-static</code> 太激进会在图捕获时崩，而且报错极具误导性。</strong> mf 0.93 时 KV 池能给到 145490 token，但捕获 prefill 图前只剩 1.74GB，捕获中途 OOM，报的是：</p>
<pre><code>RuntimeError: num_active_captures_ &gt; 0 INTERNAL ASSERT FAILED at CUDACachingAllocator.cpp:3211
markCaptureEnd called with no captures in progress
</code></pre>
<p dir="auto">看起来像 PyTorch bug，其实是显存不够。解法是 <code>--cuda-graph-backend-prefill=disabled</code> 把显存全让给 KV 池——<strong>副作用很小</strong>：prefill 用 eager 跑，实测预填充速度和开图时几乎一致（1203 vs 无投机的 1207 tok/s），而且启动时间从 354s 降到 <strong>22s</strong>（省掉了 170s 的 prefill 图捕获 + 96s 的草稿 verify 图捕获）。</p>
<p dir="auto"><strong>坑 3：0.5.19 里 mamba 槽位耗尽的断言还在，而且代码重构了。</strong> 0.5.17 那个补丁（槽位耗尽时优雅跳过前缀捐赠而不是崩服务）不能直接搬：0.5.19 里 <code>self.cache.evict()</code> 改名成 <code>evict_for_alloc()</code>，<code>prepare_for_caching_req()</code> 新增了 int8 checkpoint 分支，捐赠调用点从 2 处变成 3 处，每处都要挡 <code>None</code>。改完确认 0.5.19 里 <code>effective_cache_len &lt;= 0</code> 的清理分支仍在，语义与 0.5.17 一致。</p>
<p dir="auto"><strong>坑 4：mamba 槽位会把并发数压回 1。</strong> 日志直说了：</p>
<pre><code>max_running_requests is capped to 1 by the mamba state cache
(max_mamba_cache_size=8, 5 state slots per request)
</code></pre>
<p dir="auto">投机下每个请求要 5 个 mamba 状态槽，8 槽只能跑 1 个请求。要双路就必须 <code>--max-mamba-cache-size 10</code>（但又要多吃 0.7GB 显存，池子进一步缩水）——<strong>投机、并发、上下文长度，在 32G 卡上三者只能取其二。</strong></p>
<h2>七、五方总表（含 llama.cpp）</h2>
<p dir="auto">把之前 llama.cpp 两档和 SGLang 三档放在一起（SGLang 数据为本次 0.5.19 同版本实测）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项目</th>
<th>llama.cpp&lt;br&gt;Q6_K+MTP</th>
<th>llama.cpp&lt;br&gt;unsloth Q4_K_M+MTP</th>
<th>SGLang INT4&lt;br&gt;无投机</th>
<th>SGLang INT4&lt;br&gt;+NEXTN(MTP)</th>
<th><strong>SGLang INT4&lt;br&gt;+DFlash2</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>权重</td>
<td>20.89 GB</td>
<td><strong>15.33 GB</strong></td>
<td>17.7 GB</td>
<td>17.7 GB</td>
<td>17.7 GB + 3.7 GB 草稿</td>
</tr>
<tr>
<td>代码 解码</td>
<td>80.9 t/s</td>
<td><strong>101.2 t/s</strong></td>
<td>41.8 t/s</td>
<td>89.3 t/s</td>
<td><strong>130.5 t/s</strong></td>
</tr>
<tr>
<td>抽取 解码</td>
<td>81.8 t/s</td>
<td><strong>91.1 t/s</strong></td>
<td>40.6 t/s</td>
<td>86.5 t/s</td>
<td><strong>143.0 t/s</strong></td>
</tr>
<tr>
<td>创作 解码</td>
<td>52.9 t/s</td>
<td>59.7 t/s</td>
<td>42.0 t/s</td>
<td>66.2 t/s</td>
<td><strong>75.2 t/s</strong></td>
</tr>
<tr>
<td>双路聚合</td>
<td>95-160 t/s</td>
<td>161.4 t/s</td>
<td>76.9 t/s</td>
<td>166.7 t/s</td>
<td><strong>293.4 t/s</strong></td>
</tr>
<tr>
<td><strong>128K 长上下文解码</strong></td>
<td>未测</td>
<td>未测</td>
<td>33.8 t/s</td>
<td>39.0 t/s</td>
<td><strong>65.3 t/s</strong></td>
</tr>
<tr>
<td>可用上下文</td>
<td>128K × 2</td>
<td><strong>256K × 2</strong></td>
<td><strong>128K × 2</strong></td>
<td>128K 单路</td>
<td>128K 单路</td>
</tr>
<tr>
<td>KV 池 token</td>
<td>—</td>
<td>—</td>
<td>331173</td>
<td>280537</td>
<td>137709</td>
</tr>
<tr>
<td>显存</td>
<td>28.4 GB 含视觉</td>
<td>27.6 GB</td>
<td>30.1 GB</td>
<td>30.2 GB</td>
<td>30.2 GB</td>
</tr>
<tr>
<td>预填充</td>
<td>未测</td>
<td>未测</td>
<td><strong>1207 tok/s</strong></td>
<td>1166 tok/s</td>
<td>1203 tok/s</td>
</tr>
</tbody>
</table>
<h2>八、怎么选</h2>
<ul>
<li><strong>要长上下文 + 并发</strong>（双路 128K、Agent 长文档）→ <strong>SGLang 无投机</strong>，池 279214/331173，唯一能做到双路 128K 的方案。</li>
<li><strong>要单路极致速度</strong>（编码、批量生成、短上下文对话）→ <strong>DFlash2</strong>，比 MTP 快 46~76%，128K 长上下文快 67%。</li>
<li><strong>要长上下文 + 一点加速</strong>（单路 128K 但想省点时间）→ <strong>MTP</strong>，池 280537 是 DFlash2 的 2 倍，128K 解码 39 t/s。</li>
<li><strong>要超长上下文 × 并发</strong>（256K × 2）→ 只有 llama.cpp unsloth Q4_K_M 那条路，代价是速度从 130 t/s 掉到 101 t/s。</li>
<li><strong>显存最省</strong> → llama.cpp Q4_K_M（15.33GB 权重）。</li>
</ul>
<p dir="auto">最后提醒一句：<strong>DFlash2 的价值集中在长上下文</strong>。如果你的用法全是短提示（&lt;8K），MTP 的 89 t/s 和 DFlash2 的 130 t/s 是一倍多的差距，但两者的显存代价差别（0.79GB vs 3.69GB）会决定你能不能同时留下双路和 128K。</p>
<h2>九、复现清单</h2>
<pre><code class="language-bash"># 1) 隔离升级到 0.5.19（保留 0.5.17 环境）
rsync -a /home/shenzq/sglang-env/ /home/shenzq/sglang019-env/
/home/shenzq/sglang019-env/bin/python -m pip install -U "sglang==0.5.19" -i https://pypi.tuna.tsinghua.edu.cn/simple

# 2) 打 mamba 槽位优雅降级补丁（0.5.19 代码重构过，需专用版）
/home/shenzq/sglang019-env/bin/python fix_mamba_graceful_019.py

# 3) 下载草稿模型（镜像站）
export HF_ENDPOINT=https://hf-mirror.com HF_HUB_DISABLE_XET=1
huggingface-cli download incoai/Qwen3.8-27B-DFlash2 --local-dir /mnt/sda6/download/qwen38-dflash2

# 4) 启动（见第二节命令）
bash start_dflash2.sh dflash-128k        # ctx 131072 单路，池 137709
bash start_dflash2.sh dflash-128k-dual   # ctx 131072 双路，池 113997
bash start_dflash2.sh nospec-128k        # 无投机对照，池 331173
</code></pre>
<p dir="auto">测试脚本：<code>bench_sglang.py</code>（短上下文/双流）、<code>bench_dflash_long.py</code>（预填充曲线 + 128K 解码 + 双路长上下文）、<code>lossless_check.py</code> + <code>compare_lossless.py</code>（无损性比对）。</p>
<p dir="auto">硬件：RTX 4080 SUPER 32G（32760 MiB）、驱动 595.84、CUDA 13.0、Ubuntu。目标模型 RedHatAI Qwen3.8-27B INT4（compressed-tensors W4A16 group128，Marlin 核），KV cache fp8_e4m3，<code>--page-size 1</code>。</p>
]]></description><link>https://lcz.me/topic/1654</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 22:34:00 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1654.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 12 Sep 2026 12:28:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to # SGLang 投机解码在 32GB 卡上的选型指南：DFlash2 / MTP / 无投机实测 on Sun, 13 Sep 2026 02:47:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry" aria-label="Profile: terry">@<bdi>terry</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/enigma" aria-label="Profile: enigma">@<bdi>enigma</bdi></a></p>
<p dir="auto">找到原因了, 测试方法不一样, 下面是我让AI给我的一个简要总结:</p>
<h2>一句话结论</h2>
<blockquote>
<p dir="auto"><strong>不是环境差异，是测的任务类型不同。</strong></p>
</blockquote>
<p dir="auto">接受长度几乎完全由<strong>任务类型</strong>决定。</p>
<p dir="auto">同一台机器、同一个目标模型、同一个 DFlash2 草稿，只换 prompt 类型：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>任务类型</th>
<th style="text-align:right">我们的 accept</th>
<th style="text-align:right">速度</th>
</tr>
</thead>
<tbody>
<tr>
<td>强制续写散文（我们最初一直用的）</td>
<td style="text-align:right">2.4</td>
<td style="text-align:right">45–93 t/s</td>
</tr>
<tr>
<td>摘要</td>
<td style="text-align:right">2.86</td>
<td style="text-align:right">92.5 t/s</td>
</tr>
<tr>
<td>中文创作</td>
<td style="text-align:right">3.05</td>
<td style="text-align:right">66.5 t/s</td>
</tr>
<tr>
<td>代码</td>
<td style="text-align:right">4.99</td>
<td style="text-align:right">164.6 t/s</td>
</tr>
<tr>
<td>抽取原文（照抄）</td>
<td style="text-align:right">5.94</td>
<td style="text-align:right">211.4 t/s</td>
</tr>
</tbody>
</table>
<h2>为什么会产生“他高我们低”的错觉</h2>
<p dir="auto">他的 <strong>4.74～5.33</strong> 是把整组任务合成的单一数字，而组里包含**“抽取原文”<strong>和</strong>“代码”**这两类近乎照抄的任务——它们天然把接受度拉到 <strong>5～6</strong>。</p>
<p dir="auto">他表里三个场景的速度是分开报的，接受长度却只给一个合计值。这个合计值被高接受类主导了。</p>
<p dir="auto">我们最初使用的：</p>
<blockquote>
<p dir="auto"><strong>散文续写 + <code>ignore_eos</code> 强制截断 256 token</strong></p>
</blockquote>
<p dir="auto">是最难的一类——模型被逼着无目标地续写，接受的 token 最少。</p>
<p dir="auto">因此，我们实际上是<strong>拿最难的类别去比较他的合计值</strong>，自然会出现接受长度相差接近一倍的现象。</p>
<p dir="auto">换成他的任务类型后，我们反而比他快：</p>
<ul>
<li><strong>抽取原文：211 vs 143 t/s</strong></li>
<li><strong>代码：165 vs 130 t/s</strong></li>
</ul>
<h2>顺带被否证的三个猜想</h2>
<ol>
<li>
<p dir="auto"><strong>量化头（NVFP4 打包头）</strong></p>
<ul>
<li>单变量换 BF16 稠密头</li>
<li>accept：<strong>2.50 → 2.56（+2%）</strong></li>
<li>但速度反而<strong>慢 10%～18%</strong></li>
</ul>
</li>
<li>
<p dir="auto"><strong>INT4 vs NVFP4</strong></p>
<ul>
<li>下载同名 INT4 checkpoint 实测</li>
<li>accept：<strong>2.51 vs 2.50</strong></li>
<li><strong>几乎零影响</strong></li>
<li>而且 TTFT <strong>翻倍</strong></li>
</ul>
</li>
<li>
<p dir="auto"><strong>草稿选型（DFlash2 / DSpark / NEXTN）</strong></p>
<ul>
<li>同一任务类型下差距仅约 <strong>±7%</strong></li>
</ul>
</li>
</ol>
]]></description><link>https://lcz.me/post/17718</link><guid isPermaLink="true">https://lcz.me/post/17718</guid><dc:creator><![CDATA[Tony Wang]]></dc:creator><pubDate>Sun, 13 Sep 2026 02:47:36 GMT</pubDate></item><item><title><![CDATA[Reply to # SGLang 投机解码在 32GB 卡上的选型指南：DFlash2 / MTP / 无投机实测 on Sun, 13 Sep 2026 02:14:27 GMT]]></title><description><![CDATA[<p dir="auto">就是让 flash帮我在调. 模型都换好几个了, 刚刚把这篇帖子喂给它. 又下载了一个 带BF16头的nvfp4, 效果还是一样 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=ffa14597167" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":(" alt="😞" /></p>
<p dir="auto">现在让它下 帖子中的int4, 最后再看看.</p>
]]></description><link>https://lcz.me/post/17705</link><guid isPermaLink="true">https://lcz.me/post/17705</guid><dc:creator><![CDATA[Tony Wang]]></dc:creator><pubDate>Sun, 13 Sep 2026 02:14:27 GMT</pubDate></item><item><title><![CDATA[Reply to # SGLang 投机解码在 32GB 卡上的选型指南：DFlash2 / MTP / 无投机实测 on Sun, 13 Sep 2026 01:54:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tony-wang" aria-label="Profile: Tony-Wang">@<bdi>Tony-Wang</bdi></a> 我哥说了很多次，你不要自己去调整，你接入DSH，让V4.1 Flash帮你调</p>
]]></description><link>https://lcz.me/post/17701</link><guid isPermaLink="true">https://lcz.me/post/17701</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sun, 13 Sep 2026 01:54:32 GMT</pubDate></item><item><title><![CDATA[Reply to # SGLang 投机解码在 32GB 卡上的选型指南：DFlash2 / MTP / 无投机实测 on Sun, 13 Sep 2026 01:24:42 GMT]]></title><description><![CDATA[<p dir="auto">没有非常低, 但是全面落后 NEXTN:</p>
<h2>A/B 结果</h2>
<blockquote>
<p dir="auto">同一份 sglang bench 脚本，唯一变量 = 投机方案</p>
</blockquote>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:right">输入 tok</th>
<th style="text-align:right">decode NEXTN</th>
<th style="text-align:right">decode DFlash2</th>
<th style="text-align:right">变化</th>
<th style="text-align:right">prefill NEXTN</th>
<th style="text-align:right">prefill DFlash2</th>
<th style="text-align:right">变化</th>
<th style="text-align:right">accept NEXTN</th>
<th style="text-align:right">accept DFlash2</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:right">333</td>
<td style="text-align:right">111.0</td>
<td style="text-align:right">100.7</td>
<td style="text-align:right">−9.3%</td>
<td style="text-align:right">5,017</td>
<td style="text-align:right">6,800*</td>
<td style="text-align:right">+36%*</td>
<td style="text-align:right">2.60</td>
<td style="text-align:right">2.38</td>
</tr>
<tr>
<td style="text-align:right">2,268</td>
<td style="text-align:right">94.1</td>
<td style="text-align:right">90.5</td>
<td style="text-align:right">−3.8%</td>
<td style="text-align:right">8,583</td>
<td style="text-align:right">8,600</td>
<td style="text-align:right">+0.2%</td>
<td style="text-align:right">2.60</td>
<td style="text-align:right">2.46</td>
</tr>
<tr>
<td style="text-align:right">8,827</td>
<td style="text-align:right">63.9</td>
<td style="text-align:right">67.8</td>
<td style="text-align:right">+6.0%</td>
<td style="text-align:right">8,216</td>
<td style="text-align:right">8,397</td>
<td style="text-align:right">+2.2%</td>
<td style="text-align:right">2.59</td>
<td style="text-align:right">2.44</td>
</tr>
<tr>
<td style="text-align:right">17,583</td>
<td style="text-align:right">45.6</td>
<td style="text-align:right">43.4</td>
<td style="text-align:right">−4.6%</td>
<td style="text-align:right">7,083</td>
<td style="text-align:right">7,286</td>
<td style="text-align:right">+2.9%</td>
<td style="text-align:right">2.59</td>
<td style="text-align:right">2.38</td>
</tr>
<tr>
<td style="text-align:right"><strong>均值</strong></td>
<td style="text-align:right"><strong>78.6</strong></td>
<td style="text-align:right"><strong>75.2</strong></td>
<td style="text-align:right"><strong>−4.4%</strong></td>
<td style="text-align:right">—</td>
<td style="text-align:right">—</td>
<td style="text-align:right">—</td>
<td style="text-align:right"><strong>2.59</strong></td>
<td style="text-align:right"><strong>2.42</strong></td>
</tr>
</tbody>
</table>
]]></description><link>https://lcz.me/post/17696</link><guid isPermaLink="true">https://lcz.me/post/17696</guid><dc:creator><![CDATA[Tony Wang]]></dc:creator><pubDate>Sun, 13 Sep 2026 01:24:42 GMT</pubDate></item><item><title><![CDATA[Reply to # SGLang 投机解码在 32GB 卡上的选型指南：DFlash2 / MTP / 无投机实测 on Sun, 13 Sep 2026 01:03:05 GMT]]></title><description><![CDATA[<p dir="auto">接受率崩到很低，一般不是量化误差本身——nvfp4 的 logits 误差只会让接受率小幅下滑。更像 draft 与 target 的接线或结构没对齐，按这个顺序查：</p>
<ol>
<li>draft 的 vocab、hidden、RoPE 是否和 nvfp4 checkpoint 完全一致；有些 nvfp4 版本会动 MLP 结构，draft 按原结构训的就会错位。</li>
<li>lm_head 有没有被接到量化后的头上，draft 应该对 target 的原始 logits 做验证。</li>
<li>别看 t/s，直接看日志里的 acceptance length，先用 BF16 target 做基准 A/B，再换 flyer666 那版 W4A16 drafter 对比。</li>
</ol>
<p dir="auto">BF16 能跑通就先拿它当对照组，nvfp4 掉多少一目了然，也方便判断是量化还是接线。</p>
]]></description><link>https://lcz.me/post/17693</link><guid isPermaLink="true">https://lcz.me/post/17693</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Sun, 13 Sep 2026 01:03:05 GMT</pubDate></item><item><title><![CDATA[Reply to # SGLang 投机解码在 32GB 卡上的选型指南：DFlash2 / MTP / 无投机实测 on Sun, 13 Sep 2026 00:50:29 GMT]]></title><description><![CDATA[<p dir="auto">我的 qwen3.8 nvfp4 版本, 用Dflash的接受率非常低. 可能有目标头的兼容性问题. 我稍后再测试下, 看看能否修复.</p>
]]></description><link>https://lcz.me/post/17689</link><guid isPermaLink="true">https://lcz.me/post/17689</guid><dc:creator><![CDATA[Tony Wang]]></dc:creator><pubDate>Sun, 13 Sep 2026 00:50:29 GMT</pubDate></item><item><title><![CDATA[Reply to # SGLang 投机解码在 32GB 卡上的选型指南：DFlash2 / MTP / 无投机实测 on Sun, 13 Sep 2026 00:37:45 GMT]]></title><description><![CDATA[<p dir="auto">qwen3.8 27b 有w4a16的drafter (<a href="https://huggingface.co/syvai/Qwen3.8-27B-DFlash2-W4A16" rel="nofollow ugc">https://huggingface.co/syvai/Qwen3.8-27B-DFlash2-W4A16</a>)，节省2GB VRAM，你可以参考一下。我双卡tp可以飙到220tok/s以上。</p>
]]></description><link>https://lcz.me/post/17687</link><guid isPermaLink="true">https://lcz.me/post/17687</guid><dc:creator><![CDATA[flyer666]]></dc:creator><pubDate>Sun, 13 Sep 2026 00:37:45 GMT</pubDate></item><item><title><![CDATA[Reply to # SGLang 投机解码在 32GB 卡上的选型指南：DFlash2 / MTP / 无投机实测 on Sat, 12 Sep 2026 21:33:57 GMT]]></title><description><![CDATA[<p dir="auto">非常好的数据，大显存选Dflash，不仅是接受率的问题，单独小草稿虽然是固定开销，但是能大幅降低主模型计算，负载也会降低。</p>
]]></description><link>https://lcz.me/post/17668</link><guid isPermaLink="true">https://lcz.me/post/17668</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sat, 12 Sep 2026 21:33:57 GMT</pubDate></item><item><title><![CDATA[Reply to # SGLang 投机解码在 32GB 卡上的选型指南：DFlash2 / MTP / 无投机实测 on Sat, 12 Sep 2026 13:02:13 GMT]]></title><description><![CDATA[<p dir="auto">数据很完整，补两点工程上的取舍。</p>
<p dir="auto">1）DFlash2 的收益本质是拿显存换 acceptance。draft 模型 3.69GB 是固定成本，在 32G 卡上直接吃掉 KV 池的一半多，这比"快 46%"更致命——它把并发和长上下文两条路都收窄了。表格里双流聚合 293 t/s 看着漂亮，但如果负载真需要双路 128K，DFlash2 直接不可用，只能回 MTP 或不开投机。选型顺序应该是先定"要几条并发、多长上下文"，再决定 draft。</p>
<p dir="auto">2）中文创作那档 DFlash2 只比 MTP 快 14%，明显低于代码/抽取的 46–65%。这通常指向采样温度一高、draft 命中率就掉，创作类 prompt 的接受长度吃亏。可以补一条 acceptance length vs temperature 的曲线，比单点 t/s 更能说明 DFlash2 的适用边界。</p>
<p dir="auto">另外问一句：你这套有没有开 FP8 KV（或 KV 量化）？如果开，KV 池能补回来多少、对 DFlash2 的显存占用有没有影响？</p>
]]></description><link>https://lcz.me/post/17578</link><guid isPermaLink="true">https://lcz.me/post/17578</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Sat, 12 Sep 2026 13:02:13 GMT</pubDate></item></channel></rss>