<?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支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s]]></title><description><![CDATA[<p dir="auto">周中被老特翻了牌子哈哈哈，所以周六早早爬起来水一篇续写<a href="https://lcz.me/topic/1532?_=1789171714063">前帖</a>：</p>
<p dir="auto">给梁圣冲了30块，狠狠地搞了一下dflash2的优化，现在基本差不多满意了，pp变化不大，但是tg比mtp提速了25%左右，还是很爽的。</p>
<p dir="auto">运行方式和之前一样, pull一下之前的代码：<a href="https://github.com/StevenChenSE/sglang/blob/gfx1100-support/README.zh-CN.md" rel="nofollow ugc">https://github.com/StevenChenSE/sglang/blob/gfx1100-support/README.zh-CN.md</a><br />
找你最爱的LLM agent harness 重新build一下SGLANG 引擎和kernel，下载对应的dflash2 drafter:</p>
<ul>
<li>推荐这个：<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显存，实测速度和精度没有损失</li>
<li>原版也可以：<a href="https://huggingface.co/incoai/Qwen3.8-27B-DFlash2" rel="nofollow ugc">https://huggingface.co/incoai/Qwen3.8-27B-DFlash2</a></li>
</ul>
<p dir="auto">Disclailmer: 标题所说速度是仅仅在极短上下文，特定workload下有效，中等长度prompt (16k-32k)的decode速度大概在90-150tok/s之间。<br />
先秀一下：</p>
<p dir="auto">做数学题：（200-220）<br />
<img src="https://upload.lcz.me/uploads/219d51af-0be1-4847-ac45-f8ff2984e29a.jpeg" alt="62afa32d-2cc4-49bd-83ba-3b59d9b58193-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">写代码：（180-250tok/s)<br />
<img src="https://upload.lcz.me/uploads/255b4407-fd60-4624-a693-c41f429a984b.jpeg" alt="8062622d-a1f0-42e6-90d8-fa9bdc5d2aba-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">普通问答(英文）：(90-120 token/s)<br />
<img src="https://upload.lcz.me/uploads/e20db4b9-ce28-40ac-914c-5f35eaf8796a.jpeg" alt="f3b296a6-9c43-4133-bc7a-8fb79610a58a-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">普通问答(中文）：(70-90 token/s)<br />
<img src="https://upload.lcz.me/uploads/4d8d6f35-cc7d-48df-bcc9-f339950453e4.jpeg" alt="e70f812a-dae0-4f2b-b81e-4e6ab3aac533-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">最后贴一下benchmark测试：</p>
<h2>实测性能基准对比</h2>
<p dir="auto">全部基准均在双卡 RX 7900 XTX (TP=2) 实机测试，运行 Qwen3.8-27B-W4A16 模型。<br />
SGLang DFlash2 列于 2026-09-11 在当前构建上刷新（<code>65b16b3df7</code>，Prefill 第 1–5 轮<br />
迭代 + 热 L2 Autotune 修复；<code>llama-benchy</code> 0.4.0，<code>--no-cache</code> 全新提示词，<br />
每个深度取 3 次运行均值）；数学与 120k 回放为单次运行。MTP-3 列与 c=4 取自<br />
2026-09-09 套件（较早构建）。<br />
vLLM 基线列为早期实测数据，如需精确对比请使用相同工具版本重新压测。<br />
上方 DFlash2 列运行 <strong>W4A16 草稿模型</strong>（自 2026-09-08 起经 <code>zz-w4a16-draft.conf</code><br />
systemd drop-in 成为生产默认；KV 容量增至 214,284 tokens）。同日同构建的 bf16<br />
草稿模型对照实测为：数学 181.0 tok/s / 120k 回放均值 119.3 tok/s / 深度均值<br />
114.3 tok/s（池容量 189,172）——全面等于或低于 W4A16 列，故维持 W4A16。<br />
第 5 节保留 2026-09-10 的 W4A16 原始验证记录及其取代的 bf16 列。</p>
<h3>1. 标准化上下文深度衰减测试 (<code>llama-benchy</code>)</h3>
<p dir="auto"><em>标准 Prompt Prefill ($PP=2048$) 与 Token Generation ($TG=128$), 并发数 = 1</em></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:center">上下文深度</th>
<th style="text-align:center">SGLang MTP-3 (本分支)</th>
<th style="text-align:center">SGLang DFlash2 (本分支)</th>
<th style="text-align:center">vLLM MTP-3 基线</th>
<th style="text-align:center">vLLM DFlash2 基线</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><strong>Depth 0</strong></td>
<td style="text-align:center"><strong>93.6 tok/s</strong></td>
<td style="text-align:center"><strong>128.3 tok/s</strong></td>
<td style="text-align:center">88.6 tok/s</td>
<td style="text-align:center">71.1 tok/s</td>
</tr>
<tr>
<td style="text-align:center"><strong>Depth 4,096</strong></td>
<td style="text-align:center"><strong>90.1 tok/s</strong></td>
<td style="text-align:center"><strong>136.7 tok/s</strong></td>
<td style="text-align:center">83.3 tok/s</td>
<td style="text-align:center">68.4 tok/s</td>
</tr>
<tr>
<td style="text-align:center"><strong>Depth 8,192</strong></td>
<td style="text-align:center"><strong>85.9 tok/s</strong></td>
<td style="text-align:center"><strong>112.8 tok/s</strong></td>
<td style="text-align:center">93.3 tok/s</td>
<td style="text-align:center">71.8 tok/s</td>
</tr>
<tr>
<td style="text-align:center"><strong>Depth 16,384</strong></td>
<td style="text-align:center"><strong>78.2 tok/s</strong></td>
<td style="text-align:center"><strong>108.8 tok/s</strong></td>
<td style="text-align:center">75.9 tok/s</td>
<td style="text-align:center">62.2 tok/s</td>
</tr>
<tr>
<td style="text-align:center"><strong>速度留存率 (16k / 0k)</strong></td>
<td style="text-align:center"><strong>83.6%</strong></td>
<td style="text-align:center"><strong>84.8%</strong></td>
<td style="text-align:center">85.7%</td>
<td style="text-align:center">87.5%</td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto">MTP-3 对比 vLLM MTP-3：+5.6 / +8.2 / −7.9 / +3.0%（2026-09-09 构建）。DFlash2 于 2026-09-11 刷新：深度 0 绝对速度较 09-09 读数 +19%（128.3 对 107.9），16k 深度 +3.5%（108.8 对 105.1）；留存率比值读数偏低仅因深度 0 基线涨幅大于深上下文点位（本机单次采样波动约 ±15 tok/s，4k 点位恰逢波峰）。DFlash2 对比 vLLM DFlash2：+80.5 / +99.9 / +57.1 / +74.9%。</p>
</blockquote>
<h3>2. 真实 120k Agent 多轮会话回放（16 轮离散交互）</h3>
<p dir="auto"><em>采样自真实 120k 长文本 Agent 对话（332 $\to$ 120,443 tokens），启用 Radix 前缀缓存</em></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>评估指标</th>
<th style="text-align:center">SGLang MTP-3 (本分支)</th>
<th style="text-align:center">SGLang DFlash2 (本分支)</th>
<th style="text-align:center">vLLM MTP-3</th>
<th style="text-align:center">vLLM DFlash2</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>平均生成速度 (Mean TG)</strong></td>
<td style="text-align:center"><strong>89.46 tok/s</strong></td>
<td style="text-align:center"><strong>118.7 tok/s</strong></td>
<td style="text-align:center">63.50 tok/s</td>
<td style="text-align:center">67.96 tok/s</td>
</tr>
<tr>
<td><strong>中位数速度 (Median TG)</strong></td>
<td style="text-align:center"><strong>88.38 tok/s</strong></td>
<td style="text-align:center"><strong>112.8 tok/s</strong></td>
<td style="text-align:center">61.52 tok/s</td>
<td style="text-align:center">67.16 tok/s</td>
</tr>
<tr>
<td><strong>抖动率 (CV Jitter %)</strong></td>
<td style="text-align:center"><strong>11.74%</strong></td>
<td style="text-align:center"><strong>23.6%</strong></td>
<td style="text-align:center">45.34%</td>
<td style="text-align:center">36.56%</td>
</tr>
<tr>
<td><strong>最差轮次保底速度</strong></td>
<td style="text-align:center"><strong>72.88 tok/s</strong></td>
<td style="text-align:center"><strong>56.9 tok/s</strong></td>
<td style="text-align:center">16.94 tok/s</td>
<td style="text-align:center">32.94 tok/s</td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto">MTP-3：较 vLLM MTP-3 平均提速 <strong>+40.9%</strong>、平稳度 <strong>3.9 倍</strong>、保底速度 <strong>4.3 倍</strong>（2026-09-09 构建）。DFlash2 于 2026-09-11 刷新：较 vLLM DFlash2 平均提速 <strong>+74.7%</strong>（118.7 对 67.96），平稳度 1.5 倍，保底速度较 09-09 读数 40.6 提升 40% 至 56.9。注意事项：最后一轮 120k 的前缀缓存命中降至 32%（09-09 启动约 93%），导致该轮 TTFT 膨胀至约 91 秒（TG 仍保持 56.9 tok/s）——当前显存池布局下 120k 前缀树驻留比例下降。</p>
</blockquote>
<h3>3. 数学思维链推理测试 (GSM8K &amp; MATH-500)</h3>
<p dir="auto"><em>Greedy 贪婪采样，temperature = 0.0，max_tokens = 1024</em></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>数据集用例</th>
<th style="text-align:center">生成 Token 数量</th>
<th style="text-align:center">首字延迟 (TTFT)</th>
<th style="text-align:center">Prefill 速度</th>
<th style="text-align:center">生成速度 (TG)</th>
<th style="text-align:center">准确率</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>GSM8K #1</strong></td>
<td style="text-align:center">48</td>
<td style="text-align:center">0.128s</td>
<td style="text-align:center">701.6 tok/s</td>
<td style="text-align:center"><strong>97.3 tok/s</strong></td>
<td style="text-align:center">100% 正确</td>
</tr>
<tr>
<td><strong>GSM8K #2</strong></td>
<td style="text-align:center">196</td>
<td style="text-align:center">0.139s</td>
<td style="text-align:center">814.8 tok/s</td>
<td style="text-align:center"><strong>115.5 tok/s</strong></td>
<td style="text-align:center">100% 正确</td>
</tr>
<tr>
<td><strong>MATH-500 #1</strong></td>
<td style="text-align:center">201</td>
<td style="text-align:center">0.137s</td>
<td style="text-align:center">605.5 tok/s</td>
<td style="text-align:center"><strong>120.8 tok/s</strong></td>
<td style="text-align:center">100% 正确</td>
</tr>
<tr>
<td><strong>MATH-500 #2</strong></td>
<td style="text-align:center">212</td>
<td style="text-align:center">0.128s</td>
<td style="text-align:center">568.2 tok/s</td>
<td style="text-align:center"><strong>110.9 tok/s</strong></td>
<td style="text-align:center">100% 正确</td>
</tr>
<tr>
<td><strong>综合平均</strong></td>
<td style="text-align:center">—</td>
<td style="text-align:center"><strong>0.133s</strong></td>
<td style="text-align:center"><strong>672.5 tok/s</strong></td>
<td style="text-align:center"><strong>113.9 tok/s</strong></td>
<td style="text-align:center"><strong>100% 正确</strong></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>SGLang DFlash2（同一测试套件，2026-09-11 刷新）：</strong></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>数据集用例</th>
<th style="text-align:center">生成 Token 数量</th>
<th style="text-align:center">首字延迟 (TTFT)</th>
<th style="text-align:center">Prefill 速度</th>
<th style="text-align:center">生成速度 (TG)</th>
<th style="text-align:center">准确率</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>GSM8K #1</strong></td>
<td style="text-align:center">63</td>
<td style="text-align:center">0.134s</td>
<td style="text-align:center">1510.5 tok/s</td>
<td style="text-align:center"><strong>144.2 tok/s</strong></td>
<td style="text-align:center">✗（答 96，正确为 72）</td>
</tr>
<tr>
<td><strong>GSM8K #2</strong></td>
<td style="text-align:center">200</td>
<td style="text-align:center">0.144s</td>
<td style="text-align:center">1567.5 tok/s</td>
<td style="text-align:center"><strong>208.9 tok/s</strong></td>
<td style="text-align:center">✓</td>
</tr>
<tr>
<td><strong>MATH-500 #1</strong></td>
<td style="text-align:center">195</td>
<td style="text-align:center">0.133s</td>
<td style="text-align:center">1475.7 tok/s</td>
<td style="text-align:center"><strong>224.0 tok/s</strong></td>
<td style="text-align:center">✓</td>
</tr>
<tr>
<td><strong>MATH-500 #2</strong></td>
<td style="text-align:center">182</td>
<td style="text-align:center">0.131s</td>
<td style="text-align:center">1414.7 tok/s</td>
<td style="text-align:center"><strong>195.6 tok/s</strong></td>
<td style="text-align:center">✓</td>
</tr>
<tr>
<td><strong>综合平均</strong></td>
<td style="text-align:center">—</td>
<td style="text-align:center"><strong>0.136s</strong></td>
<td style="text-align:center"><strong>1492.1 tok/s</strong></td>
<td style="text-align:center"><strong>193.2 tok/s</strong></td>
<td style="text-align:center"><strong>75%（3/4）</strong></td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto">DFlash2 数学生成速度较 09-09 读数快约 70%（193.2 对 166.0 tok/s；两次套件运行复现<br />
193.15 / 193.62），TTFT 在更长提示词下保持平稳，但 GSM8K #1 在贪婪采样下仍会失误<br />
（答 96，正确 72）——这是其窗口式草稿路径在量化稠密 GEMM 上的已知权衡；MTP-3 四题全对。</p>
</blockquote>
<h3>4. 多并发吞吐实测 ($c=4$)</h3>
<p dir="auto"><em>使用 <code>llama-benchy</code> 进行多并发请求压测 ($PP=2048, TG=128$, Depth 0)</em></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>推理服务引擎</th>
<th style="text-align:center">并发数</th>
<th style="text-align:center">Prefill 总吞吐 (PP)</th>
<th style="text-align:center">生成总吞吐 (TG)</th>
<th style="text-align:center">峰值生成吞吐</th>
<th>运行稳定性与说明</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>SGLang MTP-3 (本分支)</strong></td>
<td style="text-align:center"><strong>c = 4</strong></td>
<td style="text-align:center"><strong>1,357.4 tok/s</strong></td>
<td style="text-align:center"><strong>78.5 tok/s</strong></td>
<td style="text-align:center"><strong>118.0 tok/s</strong></td>
<td><strong>100% 稳定运行</strong>，Decode CUDA 图与 MTP-3 正常工作</td>
</tr>
<tr>
<td><strong>SGLang DFlash2 (本分支)</strong></td>
<td style="text-align:center"><strong>c = 4</strong></td>
<td style="text-align:center"><strong>1,275.5 tok/s</strong></td>
<td style="text-align:center"><strong>92.1 tok/s</strong></td>
<td style="text-align:center"><strong>146.0 tok/s</strong></td>
<td><strong>100% 稳定运行</strong>，单次采样</td>
</tr>
<tr>
<td><strong>vLLM Baseline (无投机)</strong></td>
<td style="text-align:center">c = 4</td>
<td style="text-align:center">1,891.1 tok/s</td>
<td style="text-align:center">83.1 tok/s</td>
<td style="text-align:center">180.0 tok/s</td>
<td>原生稳定，但解码速度较低</td>
</tr>
<tr>
<td><strong>vLLM DFlash2</strong></td>
<td style="text-align:center">c = 4</td>
<td style="text-align:center">1,693.2 tok/s</td>
<td style="text-align:center">75.9 tok/s</td>
<td style="text-align:center">188.0 tok/s</td>
<td>投机开销导致多并发总 TG 吞吐反而低于 Baseline</td>
</tr>
<tr>
<td><strong>llama.cpp (MTP)</strong></td>
<td style="text-align:center">c = 4</td>
<td style="text-align:center">636.3 tok/s</td>
<td style="text-align:center">50.1 tok/s</td>
<td style="text-align:center">—</td>
<td>受限于插槽并发队列瓶颈 (<code>-np 2</code>)</td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto"><strong>多并发核心结论</strong>：SGLang 两套推测解码在 RDNA3 上 4 并发均保持 <strong>100% 稳定</strong>——无非法显存访问、无图捕获失败（vLLM 原生 MTP-3 在 batch &gt; 1 时仍会崩溃）。DFlash2 以 <strong>92.1 tok/s</strong> 总生成吞吐领先（较 vLLM 无投机基线 +10.8%，较 vLLM DFlash2 +21.3%），峰值 <strong>146 tok/s</strong>；MTP-3 为 78.5 tok/s。vLLM 基线列为旧版 <code>llama-benchy</code> 实测，引用精确跨引擎对比前请用 0.4.0 重新压测基线。</p>
</blockquote>
<h3>5. W4A16 草稿模型（<a href="https://huggingface.co/syvai/Qwen3.8-27B-DFlash2-W4A16" rel="nofollow ugc"><code>syvai/Qwen3.8-27B-DFlash2-W4A16</code></a>，融合 KV）</h3>
<p dir="auto"><em>2026-09-10，同一硬件与 <code>llama-benchy</code> 0.4.0。深度曲线与 120k 回放在无外部流量的<br />
隔离端口实测；数学、c=4、深上下文与多模态取自 2026-09-09 套件（顺序 KV 路径——<br />
准确率与该路径无关，融合 KV 仅影响草稿上下文 KV 构建）。</em></p>
<p dir="auto"><strong>深度曲线</strong>（PP=2048/TG=128，c=1；两次运行取平均，16k 为三次采样均值）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:left">指标</th>
<th style="text-align:center">bf16 草稿模型（2026-09-09）</th>
<th style="text-align:center">W4A16 草稿模型（融合 KV）</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>Depth 0</strong></td>
<td style="text-align:center">107.9 tok/s</td>
<td style="text-align:center">118.9 tok/s</td>
</tr>
<tr>
<td style="text-align:left"><strong>Depth 4,096</strong></td>
<td style="text-align:center">96.8 tok/s</td>
<td style="text-align:center">98.9 tok/s</td>
</tr>
<tr>
<td style="text-align:left"><strong>Depth 8,192</strong></td>
<td style="text-align:center">97.7 tok/s</td>
<td style="text-align:center">95.9 tok/s</td>
</tr>
<tr>
<td style="text-align:left"><strong>Depth 16,384</strong></td>
<td style="text-align:center">105.1 tok/s</td>
<td style="text-align:center">98.0 tok/s</td>
</tr>
<tr>
<td style="text-align:left"><strong>速度留存率 (16k / 0k)</strong></td>
<td style="text-align:center">97.4%</td>
<td style="text-align:center">82.4%</td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto">本机单次采样 TG 波动约 ±15 tok/s（深度 0 的背靠背采样分别读得 101.7 与 136.1），解读单点数据时请保留该误差量级。在同一隔离端口关闭融合 KV 后，16k 均值降至 88.1 tok/s——融合 KV 在深度场景带来约 +11% 收益，并将与 bf16 草稿模型的 16k 留存率差距基本抹平。</p>
</blockquote>
<p dir="auto"><strong>120k Agentic 会话回放</strong>（两次运行，融合 KV）：平均 <strong>88.6 tok/s</strong>、中位数<br />
<strong>82.8 tok/s</strong>、CV <strong>25.3%</strong>、最差轮次 <strong>52.5 tok/s</strong>——2026-09-09 的 bf16 草稿<br />
模型为 83.8 / 79.8 / 23.0% / 40.6；2026-09-11 单次复测中 bf16 / W4A16 的均值<br />
分别为 119.3 / 125.5 tok/s。平均速度持平或略优。</p>
<p dir="auto"><strong>数学思维链</strong>（greedy，单次运行）：3/4 正确——与 bf16 草稿模型出现 <em>相同的</em><br />
GSM8K #1 失误（答 96，正确 72），量化草稿模型未带来额外精度损失。平均 TG<br />
<strong>148.9 tok/s</strong>（63 token 的 GSM8K #1 短答案拉低均值至 54.0 tok/s；其余三题<br />
为 155–200 tok/s）。</p>
<p dir="auto"><strong>深上下文扩展</strong>（单次运行，10k→160k TG）：78.4 / 117.3 / 90.4 / 86.1 / 60.1 /<br />
39.0 tok/s——约 80k 之后 TG 开始衰减，与该窗口式草稿家族的长上下文行为一致。</p>
<p dir="auto"><strong>c=4 多并发：</strong> 总 TG <strong>89.3 tok/s</strong>、峰值 <strong>121 tok/s</strong>、PP <strong>1,266 tok/s</strong>、<br />
100% 稳定（bf16 草稿模型：92.1 / 146.0 / 1,275.5）。</p>
<p dir="auto"><strong>多模态矩阵：</strong> 单图 / 多图与多轮交错工作负载均无循环 / 格式缺陷。</p>
]]></description><link>https://lcz.me/topic/1640</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 00:20:28 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1640.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 12 Sep 2026 01:00:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sat, 19 Sep 2026 02:26:52 GMT]]></title><description><![CDATA[<p dir="auto">用本地实测来膜拜致敬 <a class="plugin-mentions-user plugin-mentions-a" href="/user/flyer666" aria-label="Profile: flyer666">@<bdi>flyer666</bdi></a> 大神orz！</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/247947ef-cd2a-42a9-bac1-cf4f3be912f4.jpg" alt="7034f77d-364d-4a27-be6b-1351d2ff6afd.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><a href="https://lcz.me/topic/1814">https://lcz.me/topic/1814</a></p>
]]></description><link>https://lcz.me/post/19266</link><guid isPermaLink="true">https://lcz.me/post/19266</guid><dc:creator><![CDATA[Ben Lee]]></dc:creator><pubDate>Sat, 19 Sep 2026 02:26:52 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sun, 13 Sep 2026 14:03:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/flyer666" aria-label="Profile: flyer666">@<bdi>flyer666</bdi></a> 我发的数据就是 D4 的数据，已经把补充的信息贴上去了</p>
]]></description><link>https://lcz.me/post/17879</link><guid isPermaLink="true">https://lcz.me/post/17879</guid><dc:creator><![CDATA[farmer node]]></dc:creator><pubDate>Sun, 13 Sep 2026 14:03:16 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sun, 13 Sep 2026 07:02:33 GMT]]></title><description><![CDATA[<p dir="auto">这两个数不是同一口径，别直接下结论：</p>
<ul>
<li>vLLM 1891 是 <strong>baseline（无投机）</strong>，SGLang 1275 是 <strong>DFlash2 路径</strong>。投机解码在 prefill 阶段不省反增——要多跑一个 drafter、还要验证，收益全在 decode。所以多并发短 prompt 的纯 prefill SGLang 输是正常的，不代表引擎本身弱。</li>
<li>选型按负载：
<ul>
<li>多并发、短 prompt、TTFT/prefill 敏感，用 vLLM，或者 SGLang 关掉投机；</li>
<li>单流或少并发、长上下文、decode(TG) 敏感，用 SGLang + DFlash2（也就是 flyer666 那 220 tok/s 的场景）；</li>
<li>自己一个人用，多并发通常不是刚需，长 ctx 下的 TG 才决定体感，SGLang 更划算。</li>
</ul>
</li>
<li>想公平比，把 SGLang 的投机关掉再跑一遍同样的 PP=2048/c=4，才能把「引擎差距」和「投机开销」分开。</li>
</ul>
]]></description><link>https://lcz.me/post/17790</link><guid isPermaLink="true">https://lcz.me/post/17790</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Sun, 13 Sep 2026 07:02:33 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sun, 13 Sep 2026 06:42:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%E6%87%92%E4%BA%BA%E7%83%98%E5%9F%B9" aria-label="Profile: 懒人烘培">@<bdi>懒人烘培</bdi></a> 我的sglang dflash2 单流 pp可以到1900 tok/s，好像并发pp不太行，看你的场景</p>
]]></description><link>https://lcz.me/post/17777</link><guid isPermaLink="true">https://lcz.me/post/17777</guid><dc:creator><![CDATA[flyer666]]></dc:creator><pubDate>Sun, 13 Sep 2026 06:42:45 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sun, 13 Sep 2026 06:41:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/x%E4%B8%80%E6%A3%B5%E6%A0%91" aria-label="Profile: X一棵树">@<bdi>X一棵树</bdi></a> 我只有D5，欢迎贡献d4的数据点。</p>
<p dir="auto">D5和D4区别只在hicache上，如果不用内存kv cache 基本都一样，推理速度除了卡就是主板的pcie带宽了</p>
]]></description><link>https://lcz.me/post/17776</link><guid isPermaLink="true">https://lcz.me/post/17776</guid><dc:creator><![CDATA[flyer666]]></dc:creator><pubDate>Sun, 13 Sep 2026 06:41:12 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sun, 13 Sep 2026 04:31:05 GMT]]></title><description><![CDATA[<p dir="auto">根据楼主的文章，我也测试了SGLANG和VLLM，发现SGLANG只是纯 Prefill 吞吐、尤其是多并发短 Prompt，vLLM 更高<br />
文章的 PP=2048、并发4 测试里：<br />
vLLM baseline：1891 tok/s<br />
而：<br />
SGLang DFlash2：1275 tok/s<br />
最终还是选择SGLang是嘛</p>
]]></description><link>https://lcz.me/post/17748</link><guid isPermaLink="true">https://lcz.me/post/17748</guid><dc:creator><![CDATA[懒人烘培]]></dc:creator><pubDate>Sun, 13 Sep 2026 04:31:05 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sun, 13 Sep 2026 01:41:41 GMT]]></title><description><![CDATA[<p dir="auto">必须d5？你这个数据  内存有加分？d4不行？</p>
]]></description><link>https://lcz.me/post/17698</link><guid isPermaLink="true">https://lcz.me/post/17698</guid><dc:creator><![CDATA[X一棵树]]></dc:creator><pubDate>Sun, 13 Sep 2026 01:41:41 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sat, 12 Sep 2026 20:44:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/flyer666" aria-label="Profile: flyer666">@<bdi>flyer666</bdi></a> 你还是要多研究下，把FP8KV再往前推下，它比Hicache会更实惠一点，HiCache也很重要。还有你2张卡，如果是4比特模型，怎么占用着么大显存呢？按理说权重18G左右，框架开销和预留加起来5个G，还剩下20多G，也不至于KV缓存如此紧张啊。还得让AI帮你研究下，让DSV4.1来搞。</p>
]]></description><link>https://lcz.me/post/17660</link><guid isPermaLink="true">https://lcz.me/post/17660</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sat, 12 Sep 2026 20:44:34 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sat, 12 Sep 2026 20:41:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%E5%9D%A4%E5%9D%A4" aria-label="Profile: 坤坤">@<bdi>坤坤</bdi></a> X570就可以了PCIE4*8的口两个，他的是X670，D5平台太贵了，好处是体验好一点。</p>
]]></description><link>https://lcz.me/post/17657</link><guid isPermaLink="true">https://lcz.me/post/17657</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sat, 12 Sep 2026 20:41:51 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sat, 12 Sep 2026 14:41:01 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> 哈哈哈 这周在搞一个更好玩的project: 把qwen3.8 flash next 从我的这台机器上拉起来，等搞完再看看。</p>
<p dir="auto">fp8 kv cache估计是不太行，主要是sglang架构问题和7900xtx的硬件支持导致的，我试了几次，就算拉起来16k的prefill就会掉到200几乎不可用，vllm的page attention没这个问题，可以跑fp8 kv （参考我最早的帖子）</p>
]]></description><link>https://lcz.me/post/17594</link><guid isPermaLink="true">https://lcz.me/post/17594</guid><dc:creator><![CDATA[flyer666]]></dc:creator><pubDate>Sat, 12 Sep 2026 14:41:01 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sat, 12 Sep 2026 13:29:40 GMT]]></title><description><![CDATA[<p dir="auto">我现在用着z590 用ddr4跑着速度勉强可以</p>
]]></description><link>https://lcz.me/post/17586</link><guid isPermaLink="true">https://lcz.me/post/17586</guid><dc:creator><![CDATA[坤坤]]></dc:creator><pubDate>Sat, 12 Sep 2026 13:29:40 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sat, 12 Sep 2026 12:06:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%E5%9D%A4%E5%9D%A4" aria-label="Profile: 坤坤">@<bdi>坤坤</bdi></a> 华擎x670e tachi 还可以 两根32g ddr5超到6000没啥问题</p>
]]></description><link>https://lcz.me/post/17569</link><guid isPermaLink="true">https://lcz.me/post/17569</guid><dc:creator><![CDATA[flyer666]]></dc:creator><pubDate>Sat, 12 Sep 2026 12:06:22 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sat, 12 Sep 2026 09:16:03 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">中等长度prompt (16k-32k)的decode速度大概在90-150tok/s之间。</p>
</blockquote>
<p dir="auto">這已經具有足夠的生產力了 感謝分享！</p>
]]></description><link>https://lcz.me/post/17533</link><guid isPermaLink="true">https://lcz.me/post/17533</guid><dc:creator><![CDATA[kos or]]></dc:creator><pubDate>Sat, 12 Sep 2026 09:16:03 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sun, 13 Sep 2026 14:02:07 GMT]]></title><description><![CDATA[<p dir="auto">这个是跑的是之前的昨天的分支，尝试修复FP8 KV 的问题，但是效果不太好，就不提交了，发数据发一下，看看大家是否有参考。（补充说明： 这个就是D4 ， EPYC 7452 Z2, H12D-8D , 内存 4通道 ，128G  ）</p>
<h1>SGLang DFlash2 双卡 7900 XTX (RDNA3 / gfx1100) 深度调优与全梯度测速报告</h1>
<h2>1. 实验背景与核心结论</h2>
<p dir="auto">针对双 AMD Radeon RX 7900 XTX (各 24GB VRAM，总 48GB，TP=2) 在运行 <code>Qwen3.8-27B-W4A16-AutoRound</code> 及块扩散投机解码 <code>Qwen3.8-27B-DFlash2-W4A16</code> 时的推理吞吐、算子瓶颈及长上下文退化现象进行了系统排查、源码修改与基准实测。</p>
<h3>核心结论速览</h3>
<ol>
<li><strong>短文本极致爆发</strong>：BF16 模式下，结合 Triton 算子补丁，短文本 (~1K) 稳态 Decode 达到 <strong>104.94 tok/s</strong>（成功破百）。</li>
<li><strong>最佳速度平衡点</strong>：<strong>120K 上下文 + 并发 2</strong> 是当前双卡 7900 XTX 下的绝对物理黄金平衡位（单流 120K 稳态 Decode <strong>72.6 ~ 74.8 tok/s</strong>，作者基准均值 83.8~88.6 tok/s）。</li>
<li><strong>极限深度物理墙 (160K ~ 180K)</strong>：在 160K 与 180K 极限物理深度下，受限于双卡 ~1440 GB/s 显存带宽需在每步验证中扫描 11.5GB 历史 KV 数据，Decode 速度物理收敛于 <strong>35.4 ~ 36.5 tok/s</strong>（与作者官方记录 160K 下的 39.0 tok/s 完全吻合）。</li>
<li><strong>FP8 KV 的物理局限</strong>：因 RDNA3 (gfx1100) 缺少硬件级 FP8 WMMA 矩阵核心，FP8 模式下 Triton 需在通用寄存器内进行逐点软件反量化（Dequant），导致无论如何优化，深上下文 Decode 均被压死在 20~40 tok/s。待社区后续提供硬件对齐的高效 FP8/BF8 算子前，生产极速模式锁死 <strong>BF16 KV</strong>。</li>
</ol>
<hr />
<h2>2. 源码修改与工程修复清单</h2>
<p dir="auto">测试镜像已固化为 <code>sglang-gfx1100:pr34058</code>，启动脚本位于 <code>~/sglang-gfx1100/launch-dflash2.sh</code>。</p>
<h3>2.1 RDNA3 Custom All-Reduce JIT 修复</h3>
<ul>
<li><strong>原问题</strong>：运行时 JIT 编译 <code>rdna_custom_all_reduce.cu</code> 时硬编码了 CDNA 专用的 <code>__builtin_amdgcn_global_store_b128</code>，导致 gfx1100 报错并降级至慢速 NCCL PCIe。</li>
<li><strong>修复</strong>：替换为 RDNA3 专用的 128 位向量化 volatile store，打通双卡低延迟内存通信扩展 <code>sgl_rdna_ar_v18_83f10ec8.so</code>。</li>
</ul>
<h3>2.2 Triton 3D Verify 算子性能调优</h3>
<ul>
<li><strong><code>rdna_unified_verify.py</code></strong>：将 3D Verify 下硬编码的 <code>TILE_SIZE = 16</code> 改为 <code>32</code>，匹配 7900 XTX Wave32 并发粒度，内层循环次数直接减半。</li>
<li><strong><code>triton_backend.py</code> 与 <code>rdna_verify_adapter.py</code></strong>：将原本针对 16K 上下文硬编码的 <code>segments = 32 / 16</code> 扩充为 <code>segments = 64</code>，将双卡 192 个计算单元 (WGP) 在 Verify 阶段全部吃满。</li>
</ul>
<h3>2.3 参数虚高修正</h3>
<ul>
<li>将启动脚本中虚高的 <code>--context-length 225280</code> 正式修正为 <strong><code>196608</code> (192K)</strong>，与实际物理显存池（197,144 Tokens）精准对齐，消除单流超界导致的静默 OOM 风险。</li>
</ul>
<hr />
<h2>3. 全梯度实测数据对比表 (BF16 KV 稳态)</h2>
<p dir="auto">测试环境：<code>Qwen3.8-27B-W4A16</code> + <code>DFlash2-W4A16</code>，TP=2，BF16 KV Cache，Radix Cache 前缀命中。</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:center">上下文深度</th>
<th style="text-align:center">Cold Prefill 耗时</th>
<th style="text-align:center">Prefill 吞吐速率</th>
<th style="text-align:center">显存缓存驻留率</th>
<th style="text-align:center">稳态 Decode 耗时 (128 tok)</th>
<th style="text-align:center"><strong>稳态有效 Decode 速度</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><strong>短文本 (~1K)</strong></td>
<td style="text-align:center">0.05s</td>
<td style="text-align:center">-</td>
<td style="text-align:center">0.1%</td>
<td style="text-align:center">1.220s</td>
<td style="text-align:center"><strong><code>104.94 tok/s</code></strong> <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f525.png?v=efcae6a46b1" class="not-responsive emoji emoji-android emoji--fire" style="height:23px;width:auto;vertical-align:middle" title="🔥" alt="🔥" /></td>
</tr>
<tr>
<td style="text-align:center"><strong>8K 深度</strong></td>
<td style="text-align:center">4.82s</td>
<td style="text-align:center">1,701 tok/s</td>
<td style="text-align:center">4.1%</td>
<td style="text-align:center">1.502s</td>
<td style="text-align:center"><strong><code>85.24 tok/s</code></strong> <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f525.png?v=efcae6a46b1" class="not-responsive emoji emoji-android emoji--fire" style="height:23px;width:auto;vertical-align:middle" title="🔥" alt="🔥" /></td>
</tr>
<tr>
<td style="text-align:center"><strong>16K 深度</strong></td>
<td style="text-align:center">9.71s</td>
<td style="text-align:center">1,688 tok/s</td>
<td style="text-align:center">8.3%</td>
<td style="text-align:center">1.554s</td>
<td style="text-align:center"><strong><code>82.37 tok/s</code></strong> <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f525.png?v=efcae6a46b1" class="not-responsive emoji emoji-android emoji--fire" style="height:23px;width:auto;vertical-align:middle" title="🔥" alt="🔥" /></td>
</tr>
<tr>
<td style="text-align:center"><strong>30K 深度</strong></td>
<td style="text-align:center">13.68s</td>
<td style="text-align:center">1,727 tok/s</td>
<td style="text-align:center">15.2%</td>
<td style="text-align:center">1.965s</td>
<td style="text-align:center"><strong><code>65.14 tok/s</code></strong></td>
</tr>
<tr>
<td style="text-align:center"><strong>60K 深度</strong></td>
<td style="text-align:center">17.85s</td>
<td style="text-align:center">2,648 tok/s</td>
<td style="text-align:center">30.4%</td>
<td style="text-align:center">2.274s</td>
<td style="text-align:center"><strong><code>56.30 tok/s</code></strong></td>
</tr>
<tr>
<td style="text-align:center"><strong>120K 深度</strong></td>
<td style="text-align:center">48.66s</td>
<td style="text-align:center">1,942 tok/s</td>
<td style="text-align:center">60.9%</td>
<td style="text-align:center">1.719s</td>
<td style="text-align:center"><strong><code>74.45 tok/s</code></strong> <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f525.png?v=efcae6a46b1" class="not-responsive emoji emoji-android emoji--fire" style="height:23px;width:auto;vertical-align:middle" title="🔥" alt="🔥" /></td>
</tr>
<tr>
<td style="text-align:center"><strong>160K 极限</strong></td>
<td style="text-align:center">174.77s</td>
<td style="text-align:center">913 tok/s</td>
<td style="text-align:center">81.0%</td>
<td style="text-align:center">3.510s</td>
<td style="text-align:center"><strong><code>36.47 tok/s</code></strong></td>
</tr>
<tr>
<td style="text-align:center"><strong>180K 极限</strong></td>
<td style="text-align:center">37.21s (增量)</td>
<td style="text-align:center">4,825 tok/s</td>
<td style="text-align:center">91.1%</td>
<td style="text-align:center">3.615s</td>
<td style="text-align:center"><strong><code>35.41 tok/s</code></strong></td>
</tr>
</tbody>
</table>
]]></description><link>https://lcz.me/post/17526</link><guid isPermaLink="true">https://lcz.me/post/17526</guid><dc:creator><![CDATA[farmer node]]></dc:creator><pubDate>Sun, 13 Sep 2026 14:02:07 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sat, 12 Sep 2026 07:09:54 GMT]]></title><description><![CDATA[<p dir="auto">我弟的测试非常精髓，这是本站神卡7900XTX的封神之作，最后一块短板倍补齐，还是可以折腾下FP8 KV，社区找找方案，到时候让大家抄作业，还有你不是要测试hicache吗？失败了吗？这玩意和FP8KV必须搞定一个</p>
]]></description><link>https://lcz.me/post/17513</link><guid isPermaLink="true">https://lcz.me/post/17513</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sat, 12 Sep 2026 07:09:54 GMT</pubDate></item><item><title><![CDATA[Reply to 魔改SGLANG支持7900XTX 双卡TP V2 DFLASH2 单流220Token/s on Sat, 12 Sep 2026 03:58:14 GMT]]></title><description><![CDATA[<p dir="auto">好家伙，兄弟你是啥主板来着</p>
]]></description><link>https://lcz.me/post/17456</link><guid isPermaLink="true">https://lcz.me/post/17456</guid><dc:creator><![CDATA[坤坤]]></dc:creator><pubDate>Sat, 12 Sep 2026 03:58:14 GMT</pubDate></item></channel></rss>