<?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[（2026/9/8 更新）SGLang 投產實測：W7800 48GB 上嘅 gfx1100 fork + MTP-3 + DFlash 無人區]]></title><description><![CDATA[<h1>SGLang 投產實測：W7800 48GB 上嘅 gfx1100 fork + MTP-3 + DFlash 無人區（9/8 更新）</h1>
<p dir="auto">(以下全是AI Report，Terry哥一句，夠我折騰一日，生產部署最終定型，我已經很滿意現在的體驗了)<br />
(注：我完全不知道報告中的名詞是什麼意思，我也不知道Deepseek V4 Flash調試了什麼，反正我就不斷追問，要他成功在SGLang部署後加速)</p>
<blockquote>
<p dir="auto">呢篇係我 W7800 報告（<a href="http://lcz.me/topic/1538%EF%BC%89%E5%98%85" rel="nofollow ugc">lcz.me/topic/1538）嘅</a> SGLang 部份。<br />
9/5 我試咗 SGLang 官方版本，當時結論係「列咗名但未 ready」（FP8 0.62 t/s、INT4 全失敗）。但 Terry 喺我報告下面提示「你可以嘗試下 SGLang，論壇有帖子，體驗會好很多」，加上論壇 #1252 / #1532 / #1340 / #30599 前人嘅經驗，我決定深入一層：用社區嘅 gfx1100-support fork，做完整嘅三引擎對比 + 投產評估。<br />
以下全部係 2026-09-07 23:35 → 09-08 15:36（HKT，+08:00）實測，數據全部有 log 溯源（私有雲 <code>Share/w7800-abc-sglang-20260908/</code> 00–05 六份文件）。</p>
</blockquote>
<hr />
<h2>先講結論（TL;DR，有興趣再睇下面技術棧）</h2>
<h3>最終 DSH 實測（production 真實 agent workload，最有用嘅數字）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Segment</th>
<th>時段</th>
<th>gen mean</th>
<th>median</th>
<th>max</th>
</tr>
</thead>
<tbody>
<tr>
<td>單發（1 stream）</td>
<td>15:34:56–15:36:14</td>
<td><strong>50.9 t/s</strong></td>
<td>53.9</td>
<td>79.5</td>
</tr>
<tr>
<td>雙發（2 streams aggregate）</td>
<td>15:31:31–15:34:52</td>
<td><strong>83.4 t/s</strong></td>
<td>84.9</td>
<td>92.5</td>
</tr>
</tbody>
</table>
<p dir="auto">雙發 per-stream ≈ 41-42 t/s（83.4÷2）→ 單→雙每條跌 ~17%（細 context 並發代價細，scaling ~1.6×）。</p>
<h3>全部主要結論（快速了解）</h3>
<ol>
<li><strong>gfx1100 單卡最佳 spec = MTP-3</strong>（EAGLE steps=3, topk=1）：+27-39%、16k 深度唔崩，冇嘢贏到佢。</li>
<li><strong>KV dtype 定案：bf16（唯一可行）</strong>。fp8 <strong>走不通</strong>——受控 bench 行到（conc8 132 t/s、KV 減半），但映射 <strong>384K CTX pool</strong> 嘅 VRAM 分配可能超過 48GB → production <strong>兩次永久 wedge</strong>（原因可能 VRAM 唔夠）→ 實證不可行，唔上 production。</li>
<li><strong>DFlash 喺 ROCm/gfx1100 單卡 = 死症</strong>（今早無人區測試：5 個組合全部 ≈ 無 spec）—— 同 draft model / attention 無關。</li>
<li><strong>三引擎 ABC</strong>：單流同級（llama.cpp kernel 效率最高）；並發 SGLang 贏（89.7 vs 66.8 vs 42.2 t/s）；深度 SGLang ≈ llama.cpp、vLLM 明顯衰減。</li>
<li><strong>投產定案</strong>：SGLang fork + MTP-3 + bf16 KV + HiCache size 12 + caps(4/6) + cache-report；cache hit 65-77%、decode 中位 57-60 t/s、應付到 11-subagent 並行審計。</li>
<li><strong>並發守則</strong>：≤4 REQ 同時 + 每 turn ≤60-80K tokens + retry 設上限；單卡深 context 並發 = 2 條舒服、4 條極限。</li>
<li><strong>前人貢獻</strong>：fork / model / draft / vLLM wheel 全部前人做好，我哋只實測 + 開 DFlash 無人區 + 投產（詳見 §2）。</li>
</ol>
<hr />
<h2>一、背景：點解要試 SGLang</h2>
<p dir="auto">9/5 我試咗 SGLang 官方版本（AMD 官方話支援 Radeon），結果：</p>
<ul>
<li>官方 FP8 量化：server 起得到，但 decode 只有 <strong>0.62 t/s</strong>（比 llama.cpp 慢 ~100 倍）</li>
<li>三條 INT4 路線：全部失敗</li>
<li>最新 python-native 版本：decode 只有 <strong>4.9 t/s</strong></li>
<li>對照組 Qwen3-8B dense：30.2 t/s 完全正常</li>
</ul>
<p dir="auto">當時我嘅結論係「SGLang 官方喺 W7800 用唔到，正路係 Instinct」。但 Terry 喺我報告下面話「你可以嘗試下 SGLang，論壇有帖子，體驗會好很多」，我查咗論壇，發現前人已經行過好多路：</p>
<ul>
<li><strong>#1252</strong>：vLLM on RDNA3 實測（Triton attention 長 context 慢、vLLM MTP 16k 崩到 13.8 t/s）</li>
<li><strong>#1532（flyer666）</strong>：SGLang + HiCache 三級架構 + 為 HiCache 加 RAM（32→64GB）</li>
<li><strong>#1340</strong>：4090 48GB + SGLang DFLASH2，DSH 寫碼均速 110 t/s</li>
<li><strong>#30599 系列</strong>：vLLM/SGLang 喺 RDNA3 可作 production</li>
</ul>
<p dir="auto">呢啲前人嘅經驗俾咗我信心：SGLang 唔係「用唔到」，係「官方版本未 ready，但社區 fork 行到」。所以我決定用 <strong>StevenChenSE 嘅 gfx1100-support fork</strong> 做完整測試。</p>
<hr />
<h2>二、前人嘅貢獻（我哋依靠佢哋省咗唔少時間）</h2>
<p dir="auto">呢個係我特別想標注嘅部份。我哋成個 SGLang 研究，唔係由零開始，係站喺前人嘅肩膀上面。以下係我哋參考過嘅前人，同佢哋幫我哋避咗咩坑、省咗咩時間：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>前人</th>
<th>佢哋俾咗咩</th>
<th>我哋靠佢哋避咗咩坑 / 省咗咩時間</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>terry</strong>（<a href="http://lcz.me" rel="nofollow ugc">lcz.me</a>）</td>
<td>喺我 W7800 報告下面提示「你可以嘗試下 SGLang，論壇有帖子」</td>
<td>直接觸發咗成個 SGLang 研究。唔係佢提示，我可能仲喺 llama.cpp 度兜圈</td>
</tr>
<tr>
<td><strong><a href="http://lcz.me" rel="nofollow ugc">lcz.me</a> #1252</strong></td>
<td>vLLM on RDNA3 實測：Triton attention 長 context 慢、vLLM MTP 16k 崩到 13.8 t/s</td>
<td>我哋唔使自己再花幾日去驗證「vLLM 係咪答案」。直接知道 vLLM 長 context 唔掂，將精力集中喺 SGLang fork</td>
</tr>
<tr>
<td><strong><a href="http://lcz.me" rel="nofollow ugc">lcz.me</a> #1532（flyer666）</strong></td>
<td>SGLang + HiCache 三級架構 + 為 HiCache 加 RAM（32→64GB）</td>
<td>我哋 HiCache size 12 天花板嘅結論同佢一致（30Gi RAM 唔夠 full-L2）。唔使自己再撞牆，直接知道要加 RAM 先做到 full-L2</td>
</tr>
<tr>
<td><strong><a href="http://lcz.me" rel="nofollow ugc">lcz.me</a> #1340</strong></td>
<td>4090 48GB + SGLang DFLASH2，DSH 寫碼均速 110 t/s</td>
<td>俾咗我哋 DFlash 嘅開法同信心去試。正正因為有呢個「110 t/s」嘅參考，我哋先會去開 DFlash 無人區（雖然我哋單卡 W7800 上 DFlash 無加速，但開路本身就有價值）</td>
</tr>
<tr>
<td><strong><a href="http://lcz.me" rel="nofollow ugc">lcz.me</a> #30599 系列</strong></td>
<td>建議 vLLM/SGLang 喺 RDNA3 可作 production</td>
<td>俾咗「SGLang 可以投產」嘅方向性信心，唔使自己盲猜</td>
</tr>
<tr>
<td><strong>StevenChenSE</strong>（SGLang gfx1100-support fork）</td>
<td>成個 fork：wave32 對齊 decode graph、rdna_unified_verify、SSM state buffer、triton attention</td>
<td>呢個係我哋嘅地基。冇呢個 fork，SGLang 喺 gfx1100 根本行唔到。MTP-3 深度唔崩都係靠佢嘅 unified verify + SSM buffer</td>
</tr>
<tr>
<td><strong>Vishva007</strong></td>
<td>Qwen3.8-27B-W4A16-AutoRound-GPTQ model（13.5GB）</td>
<td>俾咗一個 48GB 放得落、SGLang 行到嘅量化版本。我哋只需 patch MTP config 就 load 到，唔使自己量化</td>
</tr>
<tr>
<td><strong>z-lab</strong></td>
<td>Qwen3.8-27B-DFlash2 draft model（3.8GB，public）</td>
<td>俾咗 DFlash 無人區測試嘅 draft。唔使自己訓練 draft model</td>
</tr>
<tr>
<td><strong>incoai / syvai</strong></td>
<td>其他 DFlash draft 變體</td>
<td>俾咗我哋做「換 draft 有冇用」嘅對照組。結論：無用，DFlash 死症同 draft 無關</td>
</tr>
<tr>
<td><strong>vLLM 官方</strong></td>
<td>官方 ROCm wheel（<a href="http://wheels.vllm.ai/rocm%EF%BC%89+" rel="nofollow ugc">wheels.vllm.ai/rocm）+</a> #41394 原生 RDNA3 kernel</td>
<td>俾咗 B leg 嘅對照組。W4A16 行原生 RDNA3 kernel，唔使自己編</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>一句講晒</strong>：我哋成個研究，最貴嘅嘢（fork、model、draft、vLLM wheel）全部係前人做好嘅。我哋只做咗「喺自己部機上面實測 + 開 DFlash 無人區 + 投產」呢幾步。呢個就係開源社區嘅力量。</p>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 一個重要提醒：fork README 嘅數據係<strong>雙卡 ROCm 7.14</strong> 環境、且論壇帖註明「以下數據為 LLM 生成」——單卡唔好直接套用。我哋全部數據係<strong>單卡 W7800 + ROCm 7.2.4</strong> 實測。</p>
</blockquote>
<hr />
<h2>三、三引擎 ABC 對比（llama.cpp vs vLLM vs SGLang）</h2>
<p dir="auto">三 engine 同一張卡、同一個 Qwen3.8-27B base，全部 text-only chat（thinking off）、temp 0、相同 prompts（p0=204 tok、p2=1364 tok、deep=16,300 tok）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>leg</th>
<th>engine</th>
<th>版本</th>
<th>量化/model</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>A</strong></td>
<td>llama.cpp（production config）</td>
<td>master 8b4b355（2026-09-04）</td>
<td>Q6_K GGUF（~21GB）+ MTP n=2</td>
</tr>
<tr>
<td><strong>B</strong></td>
<td>vLLM（<strong>官方 ROCm wheel</strong>）</td>
<td>vllm 0.28.0+rocm723 + torch 2.12.0</td>
<td>W4A16 GPTQ（~13.5GB）</td>
</tr>
<tr>
<td><strong>C</strong></td>
<td>SGLang（community gfx1100 fork）</td>
<td>StevenChenSE/sglang @1442c18 + sgl_kernel AOT 自編</td>
<td>同上 W4A16 model</td>
</tr>
</tbody>
</table>
<h3>1) 單流 decode（wall-rate，含 prefill）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>場景</th>
<th>A llama.cpp (Q6_K+MTP)</th>
<th>B vLLM (W4A16)</th>
<th>C SGLang (W4A16)</th>
</tr>
</thead>
<tbody>
<tr>
<td>p0 204tok gen256</td>
<td><strong>31.0</strong> t/s</td>
<td><strong>36.0</strong> t/s</td>
<td><strong>33.5</strong> t/s</td>
</tr>
<tr>
<td>p2 1364tok gen256</td>
<td><strong>34.4</strong> t/s</td>
<td><strong>29.8</strong> t/s</td>
<td><strong>32.7</strong> t/s</td>
</tr>
</tbody>
</table>
<p dir="auto">（decode-only 估算：A ~33 / B ~37 / C ~35 t/s —— 三 engine 單流<strong>同級</strong>，B 喺短 prompt 微贏、A 喺長 prompt 反超。考慮 A 每步要讀 21GB、B/C 只讀 13.5GB：llama.cpp kernel 效率最高、vLLM/SGLang 喺 ROCm 有 overhead。）</p>
<h3>2) 並發（12 reqs，conc=4）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指標</th>
<th>A llama.cpp (2 slots)</th>
<th>B vLLM</th>
<th>C SGLang</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>aggregate gen</strong></td>
<td>42.2 t/s</td>
<td>66.8 t/s</td>
<td><strong>89.7 t/s</strong></td>
</tr>
<tr>
<td>per-req median wall</td>
<td>23.4s</td>
<td>15.3s</td>
<td><strong>10.0s</strong></td>
</tr>
</tbody>
</table>
<p dir="auto">→ C（Radix 前綴樹 + continuous batching）並發最好；B 次之（prefix caching）；<strong>A 受 production <code>-parallel 2</code> 限制</strong>，並發係 llama.cpp 最弱項。</p>
<h3>3) 深度行為（16.3k context）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指標</th>
<th>A</th>
<th>B</th>
<th>C</th>
</tr>
</thead>
<tbody>
<tr>
<td>cold prefill 16k</td>
<td>494 t/s</td>
<td>424 t/s</td>
<td><strong>659 t/s</strong></td>
</tr>
<tr>
<td>decode @16k（cache warm, gen128）</td>
<td><strong>30.9 t/s</strong></td>
<td>20.8 t/s</td>
<td><strong>29.5 t/s</strong></td>
</tr>
<tr>
<td>短→16k decode 留存率</td>
<td>~90%</td>
<td>~57%</td>
<td>~85%</td>
</tr>
</tbody>
</table>
<p dir="auto">→ B（vLLM）長 context decode 衰減明顯（Triton attention 喺 ROCm 深度慢，同 lcz #1252 觀察一致）；A（llama.cpp MTP）同 C（SGLang）深度表現接近、都遠好過 B。</p>
<h3>4) Prefill（mtok=1）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th></th>
<th>A</th>
<th>B</th>
<th>C</th>
</tr>
</thead>
<tbody>
<tr>
<td>p0 204tok</td>
<td>359</td>
<td><strong>685</strong></td>
<td>603</td>
</tr>
<tr>
<td>p2 1364tok</td>
<td>534</td>
<td><strong>846</strong></td>
<td>796</td>
</tr>
<tr>
<td>deep 16k</td>
<td>494</td>
<td>424</td>
<td><strong>659</strong></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>ABC 一句講晒</strong>：單流三 engine 同級（llama.cpp kernel 效率最高）；並發 SGLang 贏（89.7 vs 66.8 vs 42.2）；深度 SGLang 同 llama.cpp 接近、vLLM 明顯衰減。SGLang 嘅優勢喺<strong>並發 + 深度</strong>，正正係 agent workload 最需要嘅。</p>
<hr />
<h2>四、MTP-3 加速奧義（gfx1100 單卡最強 spec）</h2>
<p dir="auto">SGLang fork 支援 EAGLE spec decode。我哋用<strong>同一個 model 做 draft</strong>（MTP 模式，唔使另外 draft model），實測：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>場景</th>
<th>無 spec</th>
<th>MTP-3（EAGLE steps=3, topk=1）</th>
<th>提升</th>
</tr>
</thead>
<tbody>
<tr>
<td>p0 204tok gen256</td>
<td>33.5 t/s</td>
<td><strong>42.7 t/s</strong></td>
<td>+27%</td>
</tr>
<tr>
<td>p2 1364tok gen256</td>
<td>32.7 t/s</td>
<td><strong>45.6 t/s</strong></td>
<td>+39%</td>
</tr>
<tr>
<td>conc4 agg</td>
<td>89.7 t/s</td>
<td><strong>100.1 t/s</strong></td>
<td>+12%</td>
</tr>
<tr>
<td>16k deep decode</td>
<td>29.5 t/s</td>
<td><strong>40.9 t/s</strong></td>
<td>+39%</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>MTP-3 係 gfx1100 單卡最強 spec</strong>：+27-39%、16k 深度唔崩（vLLM MTP 喺 16k 會崩到 13.8 t/s，SGLang fork 嘅 unified verify + SSM buffer 解決咗呢個問題）。</p>
<p dir="auto"><strong>點解 steps=3 最優</strong>（我哋窮舉咗 steps=4）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>實驗</th>
<th>Config</th>
<th>結果</th>
<th>判定</th>
</tr>
</thead>
<tbody>
<tr>
<td>MTP steps=3</td>
<td>EAGLE steps=3</td>
<td>42.7 / 100.1</td>
<td><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></td>
</tr>
<tr>
<td>MTP steps=4</td>
<td>EAGLE steps=4</td>
<td>29.4 / 66.8</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 更差（draft 接受率/verify 開銷抵銷）</td>
</tr>
</tbody>
</table>
<hr />
<h2>五、DFlash 無人區測試（今早 07:05–09:00，幫其他人免去無謂想像）</h2>
<p dir="auto">呢個係我特別想寫嘅部份。DFlash 喺 ROCm/gfx1100 係<strong>無人區</strong>——冇人寫過、冇人實測過。我哋今早花咗兩個鐘，把成個無人區開路、畫晒地圖，希望其他人唔使再無謂想像「DFlash 喺 AMD 上面會唔會快」。</p>
<h3>5.1 DFlash2 leg：3 個 blocker，全部開路</h3>
<p dir="auto">參考 <a href="http://lcz.me" rel="nofollow ugc">lcz.me</a> #1340（4090 48GB + SGLang DFLASH2，DSH 寫碼均速 110 t/s）。Draft 用 z-lab/Qwen3.8-27B-DFlash2（3.8GB，public）。Config：<code>--speculative-algorithm DFLASH --speculative-draft-model-path &lt;draft&gt; --speculative-dflash-block-size 8 --speculative-draft-model-quantization unquant</code>。</p>
<p dir="auto">行到嘅過程，3 個 blocker 全部實測開路：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>#</th>
<th>Blocker</th>
<th>症狀</th>
<th>解法</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>冇 aiter</td>
<td>draft RMSNorm 6-arg 同 4-arg fallback 撞</td>
<td>裝 amd-aiter + <code>SGLANG_USE_AITER=1</code> <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="✅" /></td>
</tr>
<tr>
<td>2</td>
<td>fork 嘅 <code>layernorm.py forward_aiter</code> record 順序 bug</td>
<td>UnboundLocalError</td>
<td>本地 patch（reorder）<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="✅" /></td>
</tr>
<tr>
<td>3</td>
<td><strong>真兇</strong>：aiter 嘅 <code>tuned_gemm.py</code> <code>skinny_gemm solidx==2</code> → <code>wv_splitk_small_fp16_bf16</code> 喺 gfx1100 M=1（decode）crash</td>
<td>incompatible args</td>
<td><strong>本地 patch：soliidx==2 改用 <code>torch.matmul</code></strong> <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="✅" /></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>第 3 個 patch 係真突破</strong>：<code>tuned_gemm.py</code> solidx==2 → torch.matmul，解鎖咗 gfx1100 上面所有用 aiter tuned-gemm 嘅 decode 路徑（唔止 DFlash）。呢個 + <a href="http://layernorm.py" rel="nofollow ugc">layernorm.py</a> reorder fix 都係值得 upstream 嘅。</p>
<h3>5.2 DFlash 行到，但無加速</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>場景</th>
<th>無 spec</th>
<th>DFlash2</th>
<th>MTP-3</th>
</tr>
</thead>
<tbody>
<tr>
<td>p0 204tok gen256</td>
<td>33.5</td>
<td>33.3</td>
<td><strong>42.7</strong></td>
</tr>
<tr>
<td>p2 1364tok gen256</td>
<td>32.7</td>
<td>34.2</td>
<td><strong>45.6</strong></td>
</tr>
<tr>
<td>conc4 agg</td>
<td>89.7</td>
<td>69.1</td>
<td><strong>100.1</strong></td>
</tr>
<tr>
<td>16k decode</td>
<td>29.5</td>
<td>30.2</td>
<td><strong>40.9</strong></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>結論</strong>：DFlash 喺 ROCm（無 flashinfer、aiter 要 patch）—— draft 接受率/verify 開銷抵銷，<strong>≈ 無 spec</strong>；<strong>MTP-3 先係 gfx1100 嘅 spec decode 之王</strong>（+27-39%、深度唔崩）。</p>
<h3>5.3 flashinfer / aiter attention 探索（兩層都撞牆，全部有記錄）</h3>
<p dir="auto">我哋試過用 aiter 做 attention backend（代替 triton）：</p>
<ol>
<li><code>--attention-backend aiter</code> + EAGLE draft → draft graph capture 撞 <code>aiter_meta</code> arch assert（gfx1100 唔喺 whitelist）→ 加咗 gfx1100 入 whitelist → <strong>真 kernel <code>hipErrorLaunchFailure</code></strong>（aiter_meta PA kernel 唔支援 gfx1100 launch）</li>
<li>強行 draft attention 用 triton → 主 model prefill 用 aiter 嘅 <code>mha_batch_prefill_bf16</code> → <strong>JIT build 失敗</strong>（aiter batch-prefill FA 唔支援 gfx1100）</li>
</ol>
<p dir="auto"><strong>結論</strong>：aiter 嘅 attention kernel 係 <strong>Instinct-first</strong>（gfx942/950/1151），gfx1100 兩層都唔行。<strong>fork 揀 triton attention（wave-aware split-K）做 RDNA3 主線係正確決定</strong>。aiter 喺 gfx1100 可用範圍 = 我哋已經 patch 咗嘅 tuned_gemm（soliidx==2→torch）+ norm kernel；attention 層唔值得再深入。</p>
<h3>5.4 創意 sweep：DFlash/attention 全部組合窮舉（08:05–08:35）</h3>
<p dir="auto">目標：搵到 spec decode 加速（組合 grid × 轉換 grid）。全部 quick protocol（warmup + p0×3 + p2×3 + c4）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>實驗</th>
<th>Config</th>
<th>p0 (204)</th>
<th>p2 (1364)</th>
<th>conc4 agg</th>
<th>判定</th>
</tr>
</thead>
<tbody>
<tr>
<td>baseline 無 spec</td>
<td>triton attn</td>
<td>33.5</td>
<td>32.7</td>
<td>89.7</td>
<td>—</td>
</tr>
<tr>
<td>MTP-3（贏）</td>
<td>EAGLE+同 model</td>
<td>42.7</td>
<td>45.6</td>
<td>100.1</td>
<td><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="✅" /> 贏</td>
</tr>
<tr>
<td>C1</td>
<td>DFlash(z-lab) blk8 + triton draft</td>
<td>33.2</td>
<td>33.2</td>
<td>69.2</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 無增益</td>
</tr>
<tr>
<td>C4</td>
<td>DFlash blk12</td>
<td>20.5</td>
<td>20.5</td>
<td>—</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 更差</td>
</tr>
<tr>
<td>C2a</td>
<td>DFlash(incoai draft)</td>
<td>31.4</td>
<td>31.4</td>
<td>67.9</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 無增益</td>
</tr>
<tr>
<td>C2b</td>
<td>DFlash(syvai W4A16 draft)</td>
<td>—</td>
<td>—</td>
<td>—</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f512.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--lock" style="height:23px;width:auto;vertical-align:middle" title="🔒" alt="🔒" /> marlin repack ROCm compile fail</td>
</tr>
<tr>
<td>T2</td>
<td>DFlash + aiter wvSpltK (torch fallback)</td>
<td>32.6</td>
<td>32.0</td>
<td>68.1</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 無增益</td>
</tr>
<tr>
<td>T1</td>
<td>NGRAM spec</td>
<td>—</td>
<td>—</td>
<td>—</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f512.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--lock" style="height:23px;width:auto;vertical-align:middle" title="🔒" alt="🔒" /> 缺 sgl_kernel op</td>
</tr>
<tr>
<td>T3</td>
<td>MTP-3 + fp8_e4m3 KV</td>
<td>41.0</td>
<td>40.3</td>
<td>103.4</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 受控 bench 行到（production 384K CTX 映射 VRAM 唔夠 → wedge）</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>DFlash 無人區地圖（畫晒）</strong>：</p>
<ol>
<li><strong>DFlash 喺 ROCm 單卡 = 死症</strong>（5 個組合全部 ≈ 無 spec，draft 接受率/verify 開銷抵銷；block 越大越蝕）—— 同 draft model / attention 無關</li>
<li><strong>NGRAM blocked</strong>：fork 嘅 ROCm sgl_kernel 缺 <code>reconstruct_indices_from_tree_mask</code>（upstream 未 port 到 ROCm build）</li>
<li><strong>syvai W4A16 DFlash draft</strong>（<code>DFlash2DraftModel</code> arch + compressed-tensors）要 marlin repack，ROCm 7.2.4 clang compile fail</li>
<li><strong><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ fp8_e4m3 KV：受控 bench 行到但 production 走不通</strong>—— MTP-3+fp8 受控 bench：p0 41.0 / p2 40.3 / conc4 103.4 ≈ bf16 同速、KV 慳一半；但映射 <strong>384K CTX pool</strong> 嘅 VRAM 分配可能超過 48GB → production <strong>兩次永久 wedge</strong>（有/無 HiCache 都死）→ <strong>fp8 走不通，唔上 production</strong></li>
</ol>
<h3>5.5 今早最後一擊：spec 參數 / 量化窮舉（08:43–09:00）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>實驗</th>
<th>Config</th>
<th>結果</th>
<th>判定</th>
</tr>
</thead>
<tbody>
<tr>
<td>A</td>
<td>EAGLE3 spec（tree verify）</td>
<td>起機即死</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f512.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--lock" style="height:23px;width:auto;vertical-align:middle" title="🔒" alt="🔒" /> draft 缺 <code>set_embed</code>（fork 未實現 EAGLE3）</td>
</tr>
<tr>
<td>B</td>
<td>MTP steps=4</td>
<td>29.4 / 66.8</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 差過 steps=3（42.7/100.1）→ <strong>steps=3 最優</strong></td>
</tr>
<tr>
<td>C</td>
<td>AWQ target（fp16，MTP-3）</td>
<td>10.6 / 11.6 / 43.3</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> AWQ kernel 喺 gfx1100 冇優化，慢一大截</td>
</tr>
<tr>
<td>D</td>
<td>fp8 KV + MTP-3：conc8 / deep / prefill</td>
<td><strong>132.0</strong> / 29.3 / ~290</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 384K CTX 映射 VRAM 唔夠 → production 兩次 wedge，<strong>走不通</strong></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>fp8 KV 完整畫像（對比 bf16 KV + MTP-3）</strong>：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指標</th>
<th>bf16 KV</th>
<th>fp8 KV</th>
</tr>
</thead>
<tbody>
<tr>
<td>單流 p0/p2</td>
<td>42.7 / 45.6</td>
<td>41.0 / 40.3</td>
</tr>
<tr>
<td>conc4</td>
<td>100.1</td>
<td>103.4</td>
</tr>
<tr>
<td><strong>conc8</strong></td>
<td>—（未測，KV 爆）</td>
<td><strong>132.0</strong></td>
</tr>
<tr>
<td>16k deep decode</td>
<td>40.9</td>
<td>29.3</td>
</tr>
<tr>
<td>16k prefill</td>
<td>659</td>
<td>~290</td>
</tr>
</tbody>
</table>
<p dir="auto">→ <strong>fp8 KV 走不通</strong>：受控 bench 行到（conc8 132、KV 減半），但映射 <strong>384K CTX pool</strong> 嘅 VRAM 分配可能超過 48GB → production <strong>兩次永久 wedge</strong>（有/無 HiCache 都死）→ <strong>唔上 production</strong>。<strong>bf16 KV 係唯一可行選項</strong>（deep 40.9 t/s）；要並發多都只能用 bf16（受 187K pool 限制）。</p>
<p dir="auto"><strong>DFlash 無人區一句講晒</strong>：我哋今早把 DFlash 喺 ROCm/gfx1100 嘅成個無人區開路——3 個 blocker 全部開路（包括一個值得 upstream 嘅 aiter patch）、5 個 DFlash 組合全部實測（全部無增益）、NGRAM/EAGLE3 確認 blocked、aiter attention 兩層撞牆。<strong>結論：DFlash 喺 gfx1100 單卡 = 死症，MTP-3 先係正路。</strong> 希望呢份地圖幫其他人免去無謂想像，唔使再花兩個鐘去撞同一批牆。</p>
<hr />
<h2>六、投產（llama.cpp → SGLang fork，9 次 config 演變全部有記錄）</h2>
<h3>6.1 Config 演變</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>時間</th>
<th>Config</th>
<th>Pool tokens</th>
<th>結果</th>
</tr>
</thead>
<tbody>
<tr>
<td>09:06</td>
<td>bf16 KV + MTP-3 + triton</td>
<td>187K</td>
<td>穩定（baseline）</td>
</tr>
<tr>
<td>09:2x</td>
<td>+ parsers（qwen3 / qwen3_coder）+ thinking off</td>
<td>187K</td>
<td><strong>必修</strong>（唔加 = thinking 混 content + tool call 變文字）</td>
</tr>
<tr>
<td>10:53</td>
<td>+ caps（running 4 / queued 6）</td>
<td>187K</td>
<td>300s timeout 死症 → fast-fail 503</td>
</tr>
<tr>
<td>11:32</td>
<td>+ HiCache size 12</td>
<td>187K</td>
<td>cache hit 65→77%；<strong>size 16 失敗（30Gi RAM 唔夠）</strong></td>
</tr>
<tr>
<td>12:16</td>
<td>+ cache-report</td>
<td>187K</td>
<td><strong>DSH 命中顯示由 0 → 真數字</strong>（config flag，唔使改 code）</td>
</tr>
<tr>
<td>12:5x</td>
<td>fp8 KV 版試</td>
<td>375K（≈384K CTX）</td>
<td><strong>兩次 wedge（有/無 HiCache 都死；384K CTX 映射 VRAM 可能唔夠）→ 走不通，唔上 production</strong></td>
</tr>
<tr>
<td>13:5x</td>
<td>bf16 + chunked 16384</td>
<td>187K</td>
<td>巨 prefill drain 快但 VRAM 峰值高（46.9GB）</td>
</tr>
<tr>
<td>14:1x</td>
<td>bf16 + <strong>chunked 8192</strong> + <strong>ctx 131072</strong></td>
<td>187K</td>
<td><strong>定型 <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></td>
</tr>
<tr>
<td>—</td>
<td><strong>DSH contextWindow 定案</strong></td>
<td>80000→<strong>100000</strong></td>
<td><strong>100K 做 threshold compression</strong>（context 到 100K 就壓縮；hot-reload，唔使重啟）</td>
</tr>
</tbody>
</table>
<h3>6.2 最終定案 config（現役 <code>~/start-server.sh</code>）</h3>
<pre><code class="language-bash">export SGL_DTYPE=bfloat16 SGL_PHASE_TIMING=0
export SGL_RDNA_CUSTOM_AR=1 SGL_RDNA_NO_FUSED=1 SGL_RDNA_GEMMA_TRITON=1 SGL_RDNA_VLLM_VERIFY=1
export TVM_FFI_DISABLE_TORCH_C_DLPACK=1
python -m sglang.launch_server \
  --model-path .../Qwen3.8-27B-W4A16-AutoRound-GPTQ \
  --host 0.0.0.0 --port 8080 --served-model-name qwen3.8-27b \
  --tp-size 1 --quantization gptq --dtype bfloat16 --mamba-ssm-dtype bfloat16 \
  --kv-cache-dtype bf16 --attention-backend triton \
  --chunked-prefill-size 8192 \
  --context-length 131072 --mem-fraction-static 0.88 \
  --speculative-algorithm EAGLE \
  --speculative-draft-model-path &lt;同一 model&gt; \
  --speculative-num-steps 3 --speculative-eagle-topk 1 \
  --reasoning-parser qwen3 --tool-call-parser qwen3_coder \
  --default-chat-template-kwargs '{"enable_thinking": false}' \
  --max-running-requests 4 --max-queued-requests 6 \
  --enable-hierarchical-cache --hicache-ratio 1.0 --hicache-size 12 \
  --hicache-write-policy write_through --hicache-io-backend kernel --hicache-mem-layout page_first \
  --enable-cache-report
</code></pre>
<p dir="auto"><strong>每個 flag 點解要（實測教訓）</strong>：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Flag</th>
<th>原因</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--reasoning-parser qwen3 --tool-call-parser qwen3_coder</code></td>
<td><strong>唔加 = thinking 混入 content + tool call 變純文字</strong>（DSH 唔 parse 到）。呢兩個 parser 係 production 必備</td>
</tr>
<tr>
<td><code>--default-chat-template-kwargs {"enable_thinking": false}</code></td>
<td>llama 時期 <code>--reasoning off</code> 嘅對應；唔加 default thinking ON → 思考文字混答案</td>
</tr>
<tr>
<td><code>--max-running-requests 4 --max-queued-requests 6</code></td>
<td>硬 cap：超過 6 條排隊即刻 reject（fast fail），防止 prefill flood 餓死 decode（今日 300s timeout 事故）</td>
</tr>
<tr>
<td><code>--kv-cache-dtype bf16</code></td>
<td>深度 decode 快（40 t/s vs fp8 29）；<strong>fp8 走不通</strong>（384K CTX 映射 VRAM 唔夠 → 兩次 wedge）→ 並發多都只能用 bf16</td>
</tr>
<tr>
<td><code>MTP-3 (EAGLE steps3)</code></td>
<td>單卡實測最強 spec（+27-39%，16k 深度唔崩）</td>
</tr>
<tr>
<td><code>--enable-hierarchical-cache --hicache-size 12</code></td>
<td>HiCache 三級架構，cache hit 65→77%；size 12 = 30Gi RAM 天花板</td>
</tr>
<tr>
<td><code>--enable-cache-report</code></td>
<td>純文字 request 回 <code>cached_tokens</code>（DSH 命中顯示由 0 → 真數字）</td>
</tr>
</tbody>
</table>
<h3>6.3 全日實戰數據（09:40–15:30 監察）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指標</th>
<th>數值</th>
</tr>
</thead>
<tbody>
<tr>
<td>Decode gen tps</td>
<td>mean ~53 / median ~58（單 session 50-61）</td>
</tr>
<tr>
<td>MTP accept rate / len</td>
<td>~0.74 / ~3.2（最後 config accept 0.65-0.9）</td>
</tr>
<tr>
<td>Cache hit（Radix+HiCache）</td>
<td>全日 65%，HiCache 後 77%</td>
</tr>
<tr>
<td>Pool</td>
<td>bf16 187K tokens（fp8 可 375K 但 wedge）</td>
</tr>
<tr>
<td>最深 KV</td>
<td>176K tokens</td>
</tr>
<tr>
<td>並發</td>
<td>1-8 reqs 目擊；2 條深 stream 60-70 t/s，4 條深跌個位數</td>
</tr>
<tr>
<td>Prefill</td>
<td>全日 new 3.4M + cached 6.4M tokens</td>
</tr>
<tr>
<td>溫度/功耗</td>
<td>junction 41-101°C，max 280W</td>
</tr>
<tr>
<td>health</td>
<td>飽和期 45% polls 餓死（<code>/v1/models</code> 全程即答）</td>
</tr>
<tr>
<td>503 fast-fail</td>
<td>16 次（caps 生效證據）</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>DSH 量（production 實測，真實 agent workload）</strong>—— 完整數據見上面「先講結論」，呢度補返 context：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Segment</th>
<th>時段</th>
<th>batches</th>
<th>gen mean</th>
<th>median</th>
<th>max</th>
<th>KV 範圍</th>
</tr>
</thead>
<tbody>
<tr>
<td>單發（1 stream）</td>
<td>15:34:56–15:36:14</td>
<td>22</td>
<td><strong>50.9 t/s</strong></td>
<td>53.9</td>
<td>79.5</td>
<td>11-21K</td>
</tr>
<tr>
<td>雙發（2 streams aggregate）</td>
<td>15:31:31–15:34:52</td>
<td>66</td>
<td><strong>83.4 t/s</strong></td>
<td>84.9</td>
<td>92.5</td>
<td>15-32K</td>
</tr>
</tbody>
</table>
<ul>
<li>雙發 per-stream ≈ 41-42 t/s（83.4÷2）→ 單→雙每條跌 ~17%，細 context 並發代價細（scaling ~1.6×）</li>
</ul>
<h3>6.4 並發容量實測 + 安全指引（今日最寶貴數據）</h3>
<p dir="auto"><strong>測試</strong>：DSH 7-agent bug audit × 7 HTML（+ 主 session = 8 條 stream，全部深 context）</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>並行 heavy agent</th>
<th>結果</th>
</tr>
</thead>
<tbody>
<tr>
<td>2–4 條</td>
<td>舒服（decode 60-70 t/s）</td>
</tr>
<tr>
<td>4 條深 stream（149K KV）</td>
<td>跌到個位數（6 t/s）—— 唔建議</td>
</tr>
<tr>
<td>8+ 條 / 巨 turn（100K+/turn）</td>
<td>prefill queue 爆 → 300s timeout（舊）／503 fast-fail（caps 後）</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>操作守則（定案）</strong>：</p>
<ul>
<li>同時 <strong>≤4 REQ</strong>（例：每個 agent ≤2 REQ × ≤2 對話）—— decode aggregate ~40 t/s OK</li>
<li><strong>每 REQ 每 turn ≤ ~60-80K tokens</strong>（大過就 prefill &gt;300s 必死）—— agent 每 turn 唔好重讀大 file / 歷史要 summarise</li>
<li>DSH idle timeout 300s 係硬 wall；turn 大就要諗（timeout 提高或 turn 縮細）</li>
<li><strong>DSH 端 context 管理定案：contextWindow = 100K，到 100K 就做 threshold compression</strong>（hot-reload，唔使重啟）—— 呢個係 DSH 自己嘅 context 壓縮閘口，同 sglang server 嘅 <code>--context-length 131072</code> 係兩層（DSH 100K 先壓縮、sglang 131K 係硬上限）</li>
</ul>
<hr />
<h2>七、最終定論（成個研究閉環）</h2>
<ul>
<li><strong>gfx1100 單卡最佳 spec = MTP-3（EAGLE, steps 3, topk 1）</strong>，冇嘢贏到佢</li>
<li>KV dtype 定案：<strong>bf16（唯一可行）</strong>；fp8 <strong>走不通</strong>（384K CTX 映射 VRAM 唔夠 → 兩次永久 wedge）</li>
<li>DFlash / NGRAM / EAGLE3 / AWQ / aiter attention 全部實測排除（死症/未支援）</li>
<li>兩個 upstream patch（aiter solidx==2 + layernorm reorder）+ fp8 KV 實證（受控 bench 行到但 384K CTX 映射 VRAM 唔夠 → 走不通）—— 發帖價值最高嘅三個貢獻</li>
<li><strong>由 llama.cpp 2-slot 轉 SGLang fork + MTP-3 + HiCache 後：cache hit 65-77%、decode 中位 57-60 t/s、應付到 11-subagent 並行審計；最大教訓係「單卡深 context 並發係 2 條舒服、4 條極限」，同埋 parser/cache-report 呢啲 config flag 唔開就係啞功能。</strong></li>
</ul>
<hr />
<h2>八、坑位總表（全部實測，按撞到順序）</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>#</th>
<th>坑 / 經驗</th>
<th>教訓</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td><code>uv venv</code> 入面冇 pip</td>
<td>全部用 <code>uv pip install --python &lt;venv&gt;/bin/python</code></td>
</tr>
<tr>
<td>2</td>
<td>torchcodec 係 CUDA-only，裝咗會死（libnvrtc.so.13 缺失）</td>
<td><code>pip uninstall -y torchcodec</code> + <code>pip install decord2</code>（自動 fallback）</td>
</tr>
<tr>
<td>3</td>
<td><code>moe_q_gemm_rdna3</code> 喺 ROCm 7.2.4 clang 下 compile 唔過（最大坑）</td>
<td>用同簽名 link stub 頂（dense model 唔會 call；MoE+GPTQ 喺呢個 build 唔可用）</td>
</tr>
<tr>
<td>4</td>
<td><code>import sglang</code> 缺 modules</td>
<td>import 循環法：報邊個裝邊個（orjson psutil pybase64 requests starlette tqdm IPython pydantic aiohttp gguf soundfile decord2）</td>
</tr>
<tr>
<td>5</td>
<td>多 engine VRAM 爭用</td>
<td>測邊個先殺晒其他 engine（注意 pkill/pgrep -f self-match 坑）</td>
</tr>
<tr>
<td>6</td>
<td>fork README 話「唔支援 fp8 KV」</td>
<td>受控 bench 行到但 <strong>384K CTX 映射 VRAM 唔夠 → production 兩次 wedge → 走不通</strong>（README 喺 production 層面講得啱）</td>
</tr>
<tr>
<td>7</td>
<td>llama-bench 唔適合 SGLang</td>
<td>用 OpenAI /v1/chat/completions 協議量</td>
</tr>
<tr>
<td>8</td>
<td>DFlash：aiter 必需、layernorm bug、tuned_gemm solidx==2 crash</td>
<td>3 個 blocker 全部 patch（見 §5.1）</td>
</tr>
<tr>
<td>9</td>
<td>aiter attention 喺 gfx1100 兩層撞牆</td>
<td>aiter 係 Instinct-first，gfx1100 唔行；triton attention 先係正路</td>
</tr>
<tr>
<td>10</td>
<td>thinking 混入 content、tool call 變文字</td>
<td><code>--reasoning-parser qwen3 --tool-call-parser qwen3_coder</code> <strong>必須顯式 set</strong>（auto 只 log 唔 parse）</td>
</tr>
<tr>
<td>11</td>
<td>純文字 request <code>prompt_tokens_details=None</code> → DSH 命中顯示 0</td>
<td>開 <code>--enable-cache-report</code>（內置 flag，唔使改 code）</td>
</tr>
<tr>
<td>12</td>
<td><strong>prefill flood 餓死 decode</strong>（8 stream 事故：300s idle timeout）</td>
<td>單 request 100K+ turn 純 prefill &gt;300s 必死；並發 caps + retry 上限先有得救</td>
</tr>
<tr>
<td>13</td>
<td>retry 死循環</td>
<td>DSH retry 會將成段 context 掟返 queue → queue 永遠清唔完；retry 要設上限（DSH=5）</td>
</tr>
<tr>
<td>14</td>
<td>cache hit「0」誤解</td>
<td>純睇 <code>#cached-token: 0</code> 行 = 嗰啲係新內容 chunk；整體 hit 65-77%</td>
</tr>
<tr>
<td>15</td>
<td>HiCache size 16 失敗</td>
<td>30Gi RAM 機 <code>Not enough host memory</code>；<strong>size 12 = 天花板</strong></td>
</tr>
<tr>
<td>16</td>
<td>monitor JS escape</td>
<td>Python triple-quote embed JS：<code>\n</code> 要寫 <code>\\n</code>，否則成頁 SyntaxError 冇 status</td>
</tr>
<tr>
<td>17</td>
<td>health 飽和期 0</td>
<td>sglang <code>/health</code> 要過 scheduler；飽和時餓死但 <code>/v1/models</code> 即答 —— monitor/alerter 用 <code>/v1/models</code> 先準</td>
</tr>
<tr>
<td>18</td>
<td>queue full = caps 生效</td>
<td>running 實際係跟 KV admission（深 context 下 ~2 條），queue 6 滿即 503 fast-fail（比 timeout 好）</td>
</tr>
<tr>
<td>19</td>
<td>fp8 KV + MTP-3 喺 gfx1100 兩次永久 wedge</td>
<td>detokenizer 心跳停，無 HiCache 都中；<strong>384K CTX 映射 VRAM 可能唔夠</strong>；bf16 只會短暫餓死並自癒 → <strong>fp8 走不通，唔上 production</strong></td>
</tr>
<tr>
<td>20</td>
<td>gpu_watchdog 喺 sglang 下盲（llama <code>/slots</code> 冇咗）</td>
<td>power-based busy 偵測 + sglang-compatible temp probe</td>
</tr>
</tbody>
</table>
<hr />
<h2>九、數據來源標注（好重要，發帖時跟）</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>來源</th>
<th>定義</th>
<th>例子</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>DSH 量（production 實測）</strong></td>
<td>DSH client 喺真實 agent workload 中量度（wall + usage tokens，含真實 prompt/生成），係「有實際生產效力」嘅數字 —— 論壇上最有用嗰種</td>
<td>2-stream 細 context aggregate mean 83.4 / max 92.5 t/s（2026-09-08 15:31-15:34）；單 session 50-61 t/s</td>
</tr>
<tr>
<td><strong>sglang log 量（server tick）</strong></td>
<td>server 每個 Decode batch 嘅 instant gen throughput</td>
<td>全日 mean 50 / median 52；單 req max 70.5；多 req max 124.1</td>
</tr>
<tr>
<td><strong>Synthetic bench（AB 測試）</strong></td>
<td>固定 prompt/generation 嘅受控測試</td>
<td>ABC report 入面 p0/p2 wall-rate 42.7/45.6；llama-bench 對照</td>
</tr>
</tbody>
</table>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 發帖時要寫明數字係邊種來源 —— DSH 量嘅數字含真實 workload 噪聲（tool call、prefill、thinking off 等），synthetic 先係純 engine 速度。兩種都係有效數據，但唔可以混埋當同一基準。</p>
<hr />
<h2>十、開放項 / 建議</h2>
<ol>
<li>fp8 <strong>已確認走不通</strong>（384K CTX 映射 VRAM 唔夠 → 兩次 wedge）；如要再試要加 VRAM（同 HiCache full-L2 一樣，要加 RAM/VRAM）</li>
<li>HiCache full-L2（≥187K）要加 RAM（同 flyer666 32→64GB 結論一致）</li>
<li>上游貢獻材料（未發）：aiter solidx==2 patch、layernorm reorder fix、MTP-3 開法（作者未寫低）、fp8 KV 實證（受控 bench 行到但 384K CTX 映射 VRAM 唔夠 → 走不通）、DFlash/NGRAM/ROCm blockers</li>
<li><code>~/.dsh/AGENTS.md</code> 基建段未更新（llama→sglang production）—— 用戶確認後更新</li>
</ol>
<hr />
<p dir="auto"><em>呢篇 SGLang 部份由 DSH（DeepSeek Harness）根據 9/7-9/8 嘅完整調試日誌整理而成。所有數據皆實測，可溯源。</em></p>
]]></description><link>https://lcz.me/topic/1559</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 21:49:40 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1559.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 08 Sep 2026 08:40:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to （2026/9/8 更新）SGLang 投產實測：W7800 48GB 上嘅 gfx1100 fork + MTP-3 + DFlash 無人區 on Wed, 09 Sep 2026 03:46:50 GMT]]></title><description><![CDATA[<p dir="auto">以后的论坛模式变为：<br />
step1:让ai去读论坛内容，按学到的知识配置跑起来后ai发贴<br />
step2:发完贴攒一波评论<br />
step3:让ai读自己贴子评论后逐一测试。选出最终配置后总结发贴<br />
step4： 《 ==等抄作业的人学习自己的第二贴</p>
<p dir="auto">左脚踩右脚螺旋飞升！</p>
]]></description><link>https://lcz.me/post/16828</link><guid isPermaLink="true">https://lcz.me/post/16828</guid><dc:creator><![CDATA[张光璞]]></dc:creator><pubDate>Wed, 09 Sep 2026 03:46:50 GMT</pubDate></item><item><title><![CDATA[Reply to （2026/9/8 更新）SGLang 投產實測：W7800 48GB 上嘅 gfx1100 fork + MTP-3 + DFlash 無人區 on Wed, 09 Sep 2026 01:56:56 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><br />
<img src="https://upload.lcz.me/uploads/3e39cb90-d090-4364-85de-61894b23b1fc.jpg" alt="238533.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">4卡能跑DEEPSEEK V4 FLASH真的不錯<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f916.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--robot_face" style="height:23px;width:auto;vertical-align:middle" title="🤖" alt="🤖" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f916.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--robot_face" style="height:23px;width:auto;vertical-align:middle" title="🤖" alt="🤖" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f916.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--robot_face" style="height:23px;width:auto;vertical-align:middle" title="🤖" alt="🤖" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f916.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--robot_face" style="height:23px;width:auto;vertical-align:middle" title="🤖" alt="🤖" />不過家裡空間有限<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f605.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--sweat_smile" style="height:23px;width:auto;vertical-align:middle" title="😅" alt="😅" />如果QWEN 3.8 27B都不能滿足我的需求，我再考慮呢4卡或其他方案<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f603.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--smiley" style="height:23px;width:auto;vertical-align:middle" title="😃" alt="😃" />謝謝你的意見！</p>
]]></description><link>https://lcz.me/post/16812</link><guid isPermaLink="true">https://lcz.me/post/16812</guid><dc:creator><![CDATA[Wing Wah Law]]></dc:creator><pubDate>Wed, 09 Sep 2026 01:56:56 GMT</pubDate></item><item><title><![CDATA[Reply to （2026/9/8 更新）SGLang 投產實測：W7800 48GB 上嘅 gfx1100 fork + MTP-3 + DFlash 無人區 on Tue, 08 Sep 2026 18:08:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/wing-wah-law" aria-label="Profile: Wing-Wah-Law">@<bdi>Wing-Wah-Law</bdi></a> 这玩意如果真能弄起来，它是比两个DGX Spark更有生产力的，毕竟它可以四开ComfyUI，但是成本高，也折腾。总体上不算事特别难，你应该能搞得定。就是有钱有闲。</p>
]]></description><link>https://lcz.me/post/16768</link><guid isPermaLink="true">https://lcz.me/post/16768</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Tue, 08 Sep 2026 18:08:34 GMT</pubDate></item><item><title><![CDATA[Reply to （2026/9/8 更新）SGLang 投產實測：W7800 48GB 上嘅 gfx1100 fork + MTP-3 + DFlash 無人區 on Tue, 08 Sep 2026 14:01:28 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> 哈，Terry兄<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/261d.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--point_up" style="height:23px;width:auto;vertical-align:middle" title="☝" alt="☝" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f3fb.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--skin-tone-2" style="height:23px;width:auto;vertical-align:middle" title="🏻" alt="🏻" />我的目標真是Deepseek V4 Flash<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f423.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--hatching_chick" style="height:23px;width:auto;vertical-align:middle" title="🐣" alt="🐣" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f425.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--hatched_chick" style="height:23px;width:auto;vertical-align:middle" title="🐥" alt="🐥" /></p>
<p dir="auto">對我個人而言，多買三張就不是投資，是墜入顯卡KK園詐騙陷阱了🪤</p>
]]></description><link>https://lcz.me/post/16695</link><guid isPermaLink="true">https://lcz.me/post/16695</guid><dc:creator><![CDATA[Wing Wah Law]]></dc:creator><pubDate>Tue, 08 Sep 2026 14:01:28 GMT</pubDate></item><item><title><![CDATA[Reply to （2026/9/8 更新）SGLang 投產實測：W7800 48GB 上嘅 gfx1100 fork + MTP-3 + DFlash 無人區 on Tue, 08 Sep 2026 13:57:37 GMT]]></title><description><![CDATA[<p dir="auto">補充一個Rocm燒CPU的小修復，我回家才發現的：</p>
<p dir="auto">【分享】ROCm 7.2.4 + SGLang：idle 冇 request 燒 ~3 core CPU / 83°C → self-build libhsa + 1ms throttle 修好（3→1 core、83→64°C）</p>
<p dir="auto">環境：AMD Radeon PRO W7800（gfx1100）· ROCm 7.2.4 · Ubuntu 24.04 · SGLang（Qwen3.5/3.8 hybrid 27B GPTQ W4A16）</p>
<p dir="auto">症狀</p>
<ul>
<li>idle（GPU 0%、冇 request）長期燒 ~2.9 core / CPU 83°C / 風扇全速</li>
<li>--sleep-on-idle 已開（官方 PR #6026）→ python 主 loop 已 park，照燒</li>
</ul>
<p dir="auto">斷症</p>
<ul>
<li>perf：燒喺 <a href="http://libhsa-runtime64.so" rel="nofollow ugc">libhsa-runtime64.so</a>（ROCm rocr runtime）</li>
<li>rocr 源碼：Runtime::Load() 起兩個 AsyncEventsInfo thread 行 AsyncEventsLoop，<br />
signals 嗰個 hardcode 唔用 interrupt wait → 純 CPU-poll = ROCm runtime 層面問題</li>
<li>關聯：#1730（python 側，--sleep-on-idle 已修）、ROCm PR #7952（throttle，7.2.4 未有）、#5534</li>
</ul>
<p dir="auto">修法（self-build rocr，唔使升 ROCm）</p>
<ol>
<li>git clone --depth 1 --branch rocm-7.2.4 <a href="https://github.com/ROCm/ROCr-runtime" rel="nofollow ugc">https://github.com/ROCm/ROCr-runtime</a> rocr-src</li>
<li>Patch runtime/hsa-runtime/core/runtime/runtime.cpp 嘅 AsyncEventsLoop：<br />
純 CPU-poll 分支掃完一輪冇嘢處理又冇 interrupt wait → 瞓 1ms：<br />
if (!interrupt_wait &amp;&amp; !finish) { os::Sleep(1); }<br />
（插喺 "if (interrupt_wait) { WaitForInterrupt(); init_age = false; }" 之後）</li>
<li>Build 陷阱（最嘥時間位）：<br />
a. trap_handler 要 clang：apt clang-18 讀唔到 ROCm LLVM22 bitcode + 冇 ld.lld<br />
b. 正解 = ROCm bundled AMD clang 22（/opt/rocm/llvm/bin/clang，version 啱 bitcode）<br />
c. ROCm 個 llvm 冇 ClangConfig/LLVMConfig cmake → 自製 shim：<br />
ClangConfig.cmake:<br />
add_executable(clang IMPORTED)<br />
set_target_properties(clang PROPERTIES IMPORTED_LOCATION "/opt/rocm/llvm/bin/clang")<br />
add_executable(Clang::clang ALIAS clang)<br />
LLVMConfig.cmake:<br />
add_executable(llvm-objcopy IMPORTED)<br />
set_target_properties(llvm-objcopy PROPERTIES IMPORTED_LOCATION "/opt/rocm/llvm/bin/llvm-objcopy")<br />
add_executable(LLVM::llvm-objcopy ALIAS llvm-objcopy)<br />
d. export PATH=/opt/rocm/llvm/bin:$PATH<br />
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/rocm <br />
-DClang_DIR=&lt;shim&gt;/clang -DLLVM_DIR=&lt;shim&gt;/llvm .<br />
cmake --build build -j8   →  build/rocr/lib/libhsa-runtime64.so.1.18.0</li>
<li>Swap + rollback：<br />
sudo cp /opt/rocm/lib/libhsa-runtime64.so.1.18.70204 ~/libhsa.orig<br />
sudo cp build/rocr/lib/libhsa-runtime64.so.1.18.0 /opt/rocm/lib/libhsa-runtime64.so.1.18.70204<br />
sudo systemctl restart &lt;engine service&gt;<br />
Rollback：<br />
sudo cp ~/libhsa.orig /opt/rocm/lib/libhsa-runtime64.so.1.18.70204 &amp;&amp; sudo systemctl restart &lt;service&gt;</li>
</ol>
<p dir="auto">結果</p>
<ul>
<li>idle CPU：~3 core → ~1 core（scheduler 1002→502 ticks/5s；main 500→~0）</li>
<li>CPU temp：83°C → 64°C</li>
<li>decode 冇影響：512 token @39.9 t/s、short 0.2s、health 200</li>
</ul>
<p dir="auto">剩餘觀察</p>
<ul>
<li>最後 ~1 core = rocr::core::InterruptSignal::WaitRelaxed（engine 側主動 ACTIVE busy-wait，<br />
perf caller 喺 /dev/dri/renderD128 mmap；disable-overlap/HiCache/poller 無關）→ 似 engine/HIP 主動等，未解</li>
<li>另外加咗 idle 15 分鐘自動停 engine 做保險；冇佢都已經好咗 66%</li>
</ul>
<p dir="auto">有同樣症狀（ROCm + SGLang/vLLM idle 燒 CPU）可試；唔得 rollback 一條 cp 搞掂。</p>
]]></description><link>https://lcz.me/post/16693</link><guid isPermaLink="true">https://lcz.me/post/16693</guid><dc:creator><![CDATA[Wing Wah Law]]></dc:creator><pubDate>Tue, 08 Sep 2026 13:57:37 GMT</pubDate></item><item><title><![CDATA[Reply to （2026/9/8 更新）SGLang 投產實測：W7800 48GB 上嘅 gfx1100 fork + MTP-3 + DFlash 無人區 on Tue, 08 Sep 2026 12:52:31 GMT]]></title><description><![CDATA[<p dir="auto">相当残暴，如此看来，双卡W7800，挺好玩的。4卡没准也能动动，这可是可以单卡Comfyui的神器，4卡DeepSeek V4 Flash，单卡Qwen3.8 27B，神器。</p>
]]></description><link>https://lcz.me/post/16679</link><guid isPermaLink="true">https://lcz.me/post/16679</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Tue, 08 Sep 2026 12:52:31 GMT</pubDate></item><item><title><![CDATA[Reply to （2026/9/8 更新）SGLang 投產實測：W7800 48GB 上嘅 gfx1100 fork + MTP-3 + DFlash 無人區 on Tue, 08 Sep 2026 08:47:00 GMT]]></title><description><![CDATA[<p dir="auto"><img src="https://upload.lcz.me/uploads/5b978385-ede5-468c-aa85-f40f9727dcd8.jpg" alt="Screenshot_20260908_164319_com_android_chrome_ChromeTabbedActivity.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">一杯奶茶就換來巨大生產力<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f916.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--robot_face" style="height:23px;width:auto;vertical-align:middle" title="🤖" alt="🤖" />祝各位壇友事事順利<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2728.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--sparkles" style="height:23px;width:auto;vertical-align:middle" title="✨" alt="✨" />Terry兄財源滾滾<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/270c.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--v" style="height:23px;width:auto;vertical-align:middle" title="✌" alt="✌" />️</p>
]]></description><link>https://lcz.me/post/16630</link><guid isPermaLink="true">https://lcz.me/post/16630</guid><dc:creator><![CDATA[Wing Wah Law]]></dc:creator><pubDate>Tue, 08 Sep 2026 08:47:00 GMT</pubDate></item></channel></rss>