<?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[單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告]]></title><description><![CDATA[<blockquote>
<p dir="auto">原本使用論壇文章直接丟給AI<br />
最後他給我跑出來的 Qwen3.8-27B 跑起來 25~60 t/s 上下幅度很大<br />
複雜任務常常掉到 3x t/s</p>
</blockquote>
<p dir="auto">後來在b站看到  <a href="https://www.bilibili.com/video/BV1n4tP6EEPv/?spm_id_from=333.1007.tianma.1-1-1.click&amp;vd_source=dc20a67cacccae152dcc1b0c6b53ba25" rel="nofollow ugc">链接文本</a></p>
<blockquote>
<p dir="auto">把裡面的資訊整理一下貼給AI 優化，發現平均速度明顯提升<br />
最低常常維持在40~50 tok/s<br />
AI 跟我說重複的內容可以跑到 120 TOK/S 我是不太相信, 我自己跑平常的任務<br />
大概是 40~60 TOK/S<br />
另外我目前是使用 OCuLink 從M.2 外接顯卡的，看起來這塊影響不大<br />
詳細記述我也不太懂, 反正優化不錯就丟上來給大家參考</p>
</blockquote>
<p dir="auto">-----AI 整理報告</p>
<h1>單張 RX 7900 XTX 24GB 把 Qwen3.8-27B 推到 124 t/s —— Vulkan 路線實測報告</h1>
<blockquote>
<p dir="auto">起因：看到一篇「7900XTX 用 ROCm HIP + FP4 把 Qwen3.8-27B 推到 97.8 t/s、256K 上下文」的技術報告，想照著優化自己的機器。<br />
結果：<strong>用 Vulkan 就打到 124 t/s，而且是在完全不重編、不換權重、不裝 ROCm 的情況下</strong>，關鍵只有一個參數。<br />
底下每個數字都是同一台機器實測，含失敗的組合與踩到的坑，方便大家直接抄或避雷。</p>
</blockquote>
<hr />
<h2>TL;DR</h2>
<p dir="auto"><strong>加一個參數：<code>--spec-type ngram-map-k4v,draft-mtp</code></strong></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>配置</th>
<th>重複內容</th>
<th>推理內容</th>
<th>創造性散文</th>
<th>VRAM</th>
</tr>
</thead>
<tbody>
<tr>
<td>原本（只有 MTP 自投機）</td>
<td>80.8 t/s</td>
<td>66.4 t/s</td>
<td>40.9 t/s</td>
<td>22.02 GiB</td>
</tr>
<tr>
<td><strong>加上 ngram-map-k4v</strong></td>
<td><strong>124.0 t/s</strong></td>
<td>67.1 t/s</td>
<td>41.9 t/s</td>
<td>21.96 GiB</td>
</tr>
<tr>
<td>參考文章的 HIP+FP4 極限方案</td>
<td>97.8 t/s</td>
<td>68.7 t/s</td>
<td>29~33 t/s</td>
<td>24.2 GiB</td>
</tr>
</tbody>
</table>
<p dir="auto">重複內容 <strong>+53%</strong>，推理與散文<strong>零退步</strong>，VRAM <strong>零成本</strong>。</p>
<p dir="auto"><strong>但有個大前提：<code>--spec-ngram-map-k4v-size-n</code> 一定要拉到 32。<strong>用一般會照抄的 12 會在「格式重複但內容要換」的任務上</strong>反而變慢 5~10%</strong>（詳見第三節，這是本文最重要的發現）。</p>
<p dir="auto">另外三個結論（細節在後面）：</p>
<ol>
<li><strong><code>spec_n_max=5</code> + <code>p_min=0.4</code> 是有害的</strong>——重複內容看起來變快，但推理 -22%、散文 -37%。</li>
<li><strong>KV 量化不影響速度，只換容量</strong>。24GB 卡的實際天花板：<code>q8_0/q8_0</code> 約 128K、<code>K q5_1/V q4_0</code> 到 200K、<code>q4_0/q4_0</code> 到 224K。</li>
<li><strong>VRAM 有懸崖不是斜坡</strong>：22.16 GiB 滿速、22.30 GiB 直接掉 40%。RADV 一旦把 buffer 溢出到 GTT（系統記憶體）就全線崩，256K 在 24GB 卡上不可行。</li>
</ol>
<hr />
<h2>一、環境</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>項目</th>
<th>內容</th>
</tr>
</thead>
<tbody>
<tr>
<td>GPU</td>
<td>AMD Radeon RX 7900 XTX（Navi 31 / gfx1100），<strong>sysfs 回報 VRAM 23.98 GiB</strong></td>
</tr>
<tr>
<td>後端</td>
<td><strong>Vulkan（RADV）</strong> —— 不是 ROCm/HIP</td>
</tr>
<tr>
<td>OS / RAM</td>
<td>Ubuntu 24.04 / 31 GB</td>
</tr>
<tr>
<td>推理引擎</td>
<td>llama.cpp 帶投機解碼分支（<code>llama-server</code> 0.3.0-dev，ggml 0.22.0），<code>build-vulkan</code></td>
</tr>
<tr>
<td>模型</td>
<td>Qwen3.8-27B unsloth <strong>Q4_K_M</strong>（15.93 GiB）+ <code>mmproj-BF16</code>（0.87 GiB，視覺）</td>
</tr>
</tbody>
</table>
<h3>為什麼沒走 HIP</h3>
<p dir="auto">原文把 HIP 當效能基座（prefill 105 t/s）。但我這台 <strong>Vulkan 的 prefill 實測 146~166 t/s</strong>，本來就比它快，加上機器裡 ROCm 7.2.4 的 dpkg 記錄雖然在、<code>/opt/rocm-7.2.4</code> 的檔案卻已經被清掉（<code>hipcc</code>、<code>rocminfo</code> 都不存在），要重裝是好幾 GB。<strong>投機解碼的收益跟後端無關</strong>，所以整條 HIP + ROCm-FP4 移植路線我直接跳過——那部分還需要自己逐算子移植 STX 4-bit 格式，並且沒有現成的 FP4 權重檔。</p>
<p dir="auto">結論：<strong>如果你是 RDNA3 想跑大模型，Vulkan 已經夠好，先別為了「AMD 就該用 ROCm」去折騰。</strong></p>
<h3>模型結構（決定 KV 開銷的關鍵）</h3>
<p dir="auto">Qwen3.8-27B（<code>qwen35</code> 架構）是混合注意力：</p>
<pre><code>qwen35.block_count            = 65      # 其中 blk.64 是內建 MTP 頭
qwen35.full_attention_interval = 4      # → 64 層裡只有 16 層是全注意力
qwen35.attention.key_length    = 256
qwen35.attention.value_length  = 256
qwen35.attention.head_count_kv = 4
qwen35.nextn_predict_layers    = 1      # 內建 MTP，不需要外掛 draft 模型
</code></pre>
<p dir="auto">只有 <strong>16 層全注意力</strong>會隨上下文長度吃 KV，其餘 48 層是 DeltaNet 線性注意力（狀態固定大小）。所以：</p>
<p dir="auto"><strong>每 token 的 K（或 V）元素數 = 16 層 × 4 kv heads × 256 = 16384</strong></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>KV 型別</th>
<th>bits/elem</th>
<th>每 token 每側</th>
<th>每 token K+V</th>
<th>64K ctx</th>
</tr>
</thead>
<tbody>
<tr>
<td>f16</td>
<td>16</td>
<td>32 KiB</td>
<td>64 KiB</td>
<td><strong>4.0 GiB</strong></td>
</tr>
<tr>
<td>q8_0</td>
<td>8.5</td>
<td>17 KiB</td>
<td>34 KiB</td>
<td>2.13 GiB</td>
</tr>
<tr>
<td>q5_1</td>
<td>6.0</td>
<td>12 KiB</td>
<td>24 KiB</td>
<td>1.50 GiB</td>
</tr>
<tr>
<td>q5_0</td>
<td>5.5</td>
<td>11 KiB</td>
<td>22 KiB</td>
<td>1.38 GiB</td>
</tr>
<tr>
<td>q4_0</td>
<td>4.5</td>
<td>9 KiB</td>
<td>18 KiB</td>
<td>1.13 GiB</td>
</tr>
</tbody>
</table>
<p dir="auto">（f16 每 64K 剛好 4 GiB，跟原文的觀測吻合。這張表可以直接拿來算你要開多少 ctx。）</p>
<hr />
<h2>二、核心優化：把 n-gram 映射疊在 MTP 上</h2>
<p dir="auto">llama.cpp 的投機解碼分支支援<strong>多種投機器同時啟用</strong>，<code>--spec-type</code> 吃逗號清單：</p>
<pre><code>--spec-type none,draft-simple,draft-eagle3,draft-mtp,draft-dflash,draft-dspark,
            ngram-simple,ngram-map-k,ngram-map-k4v,ngram-mod,ngram-cache
</code></pre>
<p dir="auto">原本只開 <code>draft-mtp</code>（模型內建 MTP 頭自投機）。<strong>改成 <code>ngram-map-k4v,draft-mtp</code> 之後</strong>：</p>
<pre><code class="language-bash">--spec-type ngram-map-k4v,draft-mtp \
--spec-draft-n-max 3 \
--spec-ngram-map-k4v-size-n 12 \
--spec-ngram-map-k4v-size-m 48 \
--spec-ngram-map-k4v-min-hits 1
</code></pre>
<p dir="auto">原理：<code>ngram-map-k4v</code> 從已生成的上下文做 n-gram 查表，命中就一次吐出最多 <strong>48 個 draft token</strong>（<code>size-m 48</code>）。這在有重複結構的內容上幾乎零成本地暴力加速；沒命中就退回 MTP，所以<strong>不會拖慢</strong>其他內容。MTP 是「每步猜 3 個」，n-gram 是「命中就猜一大段」，兩者互補。</p>
<p dir="auto">看接受率就很清楚（來自 <code>timings.draft_n_accepted / draft_n</code>）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>內容類型</th>
<th>接受率</th>
<th>解讀</th>
</tr>
</thead>
<tbody>
<tr>
<td>重複內容</td>
<td><strong>463/463 = 1.00</strong></td>
<td>n-gram 全中，等於免費</td>
</tr>
<tr>
<td>推理內容</td>
<td>356/462 = 0.77</td>
<td>MTP 為主</td>
</tr>
<tr>
<td>創造性散文</td>
<td>171/489 = 0.35</td>
<td>本質不可預測，投機幫不上</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>這也是為什麼「t/s」這個數字單獨拿出來沒意義</strong>——投機解碼的速度完全由內容的可預測性決定。測速一定要固定內容類型，不然數字可以任意漂移 3 倍。</p>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ <strong>重要：上面「重複內容」那一欄是合成案例（叫模型把同一行印 30 次），是天花板不是實際值。</strong><br />
真實工作負載的收益差異極大，而且<strong>參數沒調好會變慢</strong>。務必看下面第三節。</p>
</blockquote>
<hr />
<h2>三、真實工作負載才是重點：k4v 不是無腦贏，<code>size-n</code> 是關鍵旋鈕</h2>
<p dir="auto">合成案例好看不代表實用。我另外做了四個貼近實務的測項，都是「輸出跟輸入/前文有部分重複」的任務：</p>
<ul>
<li><strong>程式碼改寫</strong>：給一支 40 行 Python，要求改一個函式、其餘原樣輸出完整檔案</li>
<li><strong>模板批次產出</strong>：給一張角色設定卡，要求用同格式再產 3 張（格式重複、內容全新）</li>
<li><strong>字幕重排</strong>：給一段 SRT，文字完全不動、只把時間軸各推後 2 秒</li>
<li><strong>長文引述</strong>：逐條照抄規格原文再接上判定</li>
</ul>
<p dir="auto">先看「照抄別人推薦的 <code>size-n 12</code>」會發生什麼事（RTX 4080S、其餘參數不變）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>情境</th>
<th>關 k4v</th>
<th>k4v n=12</th>
<th>差異</th>
<th>接受率變化</th>
</tr>
</thead>
<tbody>
<tr>
<td>程式碼改寫</td>
<td>104.1</td>
<td><strong>166.4</strong></td>
<td><strong>+60%</strong></td>
<td>0.93 → 0.72</td>
</tr>
<tr>
<td>長文引述</td>
<td>99.8</td>
<td>98.4</td>
<td>-1.4%</td>
<td>0.89 → 0.82</td>
</tr>
<tr>
<td>模板批次產出</td>
<td>72.0</td>
<td>68.4</td>
<td><strong>-5%</strong></td>
<td>0.57 → 0.39</td>
</tr>
<tr>
<td>字幕重排</td>
<td><strong>106.1</strong></td>
<td>95.8</td>
<td><strong>-10%</strong></td>
<td>0.96 → 0.51</td>
</tr>
</tbody>
</table>
<p dir="auto">**有兩項變慢了。**原因看 draft 計數就很清楚——字幕重排在 n=12 時 draft 了 992 個 token 只接受 510，而不開 k4v 是 draft 536 接受 514。<strong>n-gram 一直開火、一直猜錯，白做了 450 個 token 的計算。</strong></p>
<p dir="auto">為什麼字幕會猜錯？因為那個任務要「文字照抄、時間軸改掉」。n-gram 看到前文就把<strong>舊的時間戳</strong>一起預測出來，每到時間軸就撞牆。<strong>格式重複但內容要換的任務，n-gram 是負資產。</strong></p>
<h3>掃 <code>--spec-ngram-map-k4v-size-n</code>（查表 n-gram 長度）</h3>
<p dir="auto"><code>size-n</code> 決定「要比對多長的前文才算命中」。拉長 = 更嚴格 = 少開火但更準。完整掃描（RTX 4080S）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>size-n</th>
<th>程式碼改寫</th>
<th>模板批次</th>
<th>字幕重排</th>
<th>長文引述</th>
<th>合成重複</th>
</tr>
</thead>
<tbody>
<tr>
<td>關閉</td>
<td>104.1</td>
<td><strong>72.0</strong></td>
<td><strong>106.1</strong></td>
<td>99.8</td>
<td>108.6</td>
</tr>
<tr>
<td>12</td>
<td>166.4</td>
<td>68.4 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /></td>
<td>95.8 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /></td>
<td>98.4</td>
<td>178.6</td>
</tr>
<tr>
<td>24</td>
<td><strong>169.1</strong></td>
<td>70.2</td>
<td>100.9 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /></td>
<td>98.0</td>
<td>—</td>
</tr>
<tr>
<td><strong>32（建議）</strong></td>
<td>157.0</td>
<td>71.1</td>
<td>105.4</td>
<td>99.1</td>
<td><strong>237.0</strong></td>
</tr>
<tr>
<td>40</td>
<td>136.0</td>
<td>71.9</td>
<td>104.8</td>
<td>99.2</td>
<td>236.9</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong><code>size-n 32</code> 是甜蜜點</strong>：程式碼改寫還有 <strong>+51%</strong>、合成重複衝到 <strong>237 t/s（+118%）</strong>，而<strong>所有負面項全部收斂到 ±1.3% 的噪音內</strong>。n=24 的程式碼分數最高但字幕還是掉 5%；n=40 開始連程式碼都保不住。</p>
<h3>在 7900 XTX 上交叉驗證（同樣有效）</h3>
<p dir="auto">同一個發現搬到 AMD 卡（Vulkan、K q5_1/V q4_0、200K ctx，只改 <code>size-n</code>）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>情境</th>
<th>k4v n=12</th>
<th><strong>k4v n=32</strong></th>
<th>差異</th>
</tr>
</thead>
<tbody>
<tr>
<td>程式碼改寫</td>
<td>79.3</td>
<td><strong>109.1</strong></td>
<td><strong>+38%</strong></td>
</tr>
<tr>
<td>字幕重排</td>
<td>58.8</td>
<td><strong>80.6</strong></td>
<td><strong>+37%</strong>（接受率 0.60 → <strong>1.00</strong>）</td>
</tr>
<tr>
<td>模板批次產出</td>
<td>51.6</td>
<td>51.8</td>
<td>—</td>
</tr>
<tr>
<td>長文引述</td>
<td>78.4</td>
<td>78.8</td>
<td>—</td>
</tr>
</tbody>
</table>
<p dir="auto">字幕重排的接受率從 0.60 直接拉到 <strong>1.00</strong>——n=12 的誤開火在 AMD 上代價更慘（那張卡本來就比較吃虧），修好之後 +37%。</p>
<h3><code>min_hits</code> 不要動</h3>
<p dir="auto">我試過 <code>--spec-ngram-map-k4v-min-hits 2</code>（要求 n-gram 出現兩次才採用），結果<strong>四項數字跟完全關掉 k4v 一模一樣</strong>（draft 計數逐項相同）。等於直接把功能關掉，別浪費時間。</p>
<h3>所以什麼情況真的會用到？</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>你的任務長這樣</th>
<th>k4v 收益</th>
</tr>
</thead>
<tbody>
<tr>
<td>要模型把一整份檔案/文章原樣吐回來，只改幾行（<strong>程式碼重構、翻譯校對、逐條批註</strong>）</td>
<td><strong>+40~60%，最有價值</strong></td>
</tr>
<tr>
<td>大量重複的結構化輸出（<strong>JSON/YAML/SRT/表格批次</strong>）</td>
<td>中等，前提是 <code>size-n</code> 要夠大</td>
</tr>
<tr>
<td>逐條照抄原文再加判定（<strong>規格檢查、RAG 引述、法條比對</strong>）</td>
<td>小幅或持平</td>
</tr>
<tr>
<td>格式固定但內容全新（<strong>套模板產新資料</strong>）</td>
<td>持平（n=12 會變慢）</td>
</tr>
<tr>
<td>純創作、思考鏈、對話</td>
<td>無感（不會變慢）</td>
</tr>
</tbody>
</table>
<p dir="auto">一句話：<strong>k4v 賺的是「逐字重現」，不是「格式相似」。</strong> 只要你的工作流裡有「把長內容原樣搬過去、只動一小塊」，這招就非常值得；如果全是從零創作，就當它不存在（也不會扣分）。</p>
<hr />
<h2>四、全部實測結果（合成案例，含失敗組合）</h2>
<p dir="auto">測法：同一組固定 prompt、<code>temperature=0</code>、<code>max_tokens=512</code>、<code>stream=false</code>，讀 llama-server 回傳的 <code>timings.predicted_per_second</code>（不是自己掐秒錶）。每次改設定都完整重啟服務、跑一次暖機再測。</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>#</th>
<th>配置</th>
<th>重複</th>
<th>推理</th>
<th>散文</th>
<th>VRAM</th>
<th>判定</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td><strong>基準</strong>：MTP n3、q8_0 KV、128K</td>
<td>80.8</td>
<td>66.4</td>
<td>40.9</td>
<td>22.02</td>
<td>起點</td>
</tr>
<tr>
<td>1</td>
<td>k4v+MTP、<strong>n_max=5 / p_min=0.4</strong>、q8_0、128K</td>
<td>95.2</td>
<td><strong>51.6</strong></td>
<td><strong>26.2</strong></td>
<td>22.02</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 有害</td>
</tr>
<tr>
<td>2</td>
<td>k4v+MTP、<strong>n_max=3 不設 p_min</strong>、q8_0、128K</td>
<td><strong>123.9</strong></td>
<td>66.9</td>
<td>41.8</td>
<td>21.96</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=2fb7360d8c6" 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>同上但 KV 換 <strong>q4_0</strong>、128K</td>
<td>124.5</td>
<td>68.4</td>
<td>40.4</td>
<td>19.96</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> 省 2GB</td>
</tr>
<tr>
<td>4</td>
<td>q4_0、<strong>160K</strong></td>
<td>123.9</td>
<td>68.2</td>
<td>40.2</td>
<td>20.68</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /></td>
</tr>
<tr>
<td>5</td>
<td>q4_0、<strong>192K</strong></td>
<td>124.1</td>
<td>68.1</td>
<td>40.3</td>
<td>21.40</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /></td>
</tr>
<tr>
<td>6</td>
<td>q4_0、<strong>224K</strong></td>
<td>123.9</td>
<td>68.1</td>
<td>40.1</td>
<td>22.12</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> 純 q4_0 上限</td>
</tr>
<tr>
<td>7</td>
<td><strong>K q5_1 / V q4_0、200K</strong></td>
<td>124.1</td>
<td>68.1</td>
<td>40.9</td>
<td><strong>22.16</strong></td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> 最佳折衷</td>
</tr>
<tr>
<td>8</td>
<td>K q5_1 / V q4_0、<strong>224K</strong></td>
<td>76.8</td>
<td>40.5</td>
<td>23.2</td>
<td>22.30</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 爆</td>
</tr>
<tr>
<td>9</td>
<td>q4_0、<strong>256K</strong></td>
<td>76.9</td>
<td>40.9</td>
<td>23.3</td>
<td>22.37</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 爆</td>
</tr>
</tbody>
</table>
<p dir="auto">噪音水準：同一個配置重跑，重複內容 124.7 → 123.6（-0.9%）。<strong>所以 1% 以內的差別都不要當真。</strong></p>
<h3>坑 1：<code>n_max=5</code> + <code>p_min=0.4</code> 是陷阱</h3>
<p dir="auto">原文推薦 <code>n5/p0.4</code>。實測（#1 vs #2）：重複內容 95.2，看起來不錯；但<strong>推理掉 22%、散文掉 37%</strong>。原因是 draft 猜長了、接受率上不去（散文只有 0.39），每步都在做白工。</p>
<p dir="auto">原文自己的數據也有同樣特徵（散文只有 29~33 t/s）。<strong>維持 <code>n_max=3</code>、不要設 <code>p_min</code></strong>，重複內容反而衝到 123.9——比它們的 97.8 還快 27%。</p>
<h3>坑 2：VRAM 是懸崖，不是斜坡</h3>
<p dir="auto">看 #5→#6→#8→#9 的 VRAM 與速度：</p>
<pre><code>21.40 GiB (192K)  → 滿速
22.12 GiB (224K)  → 滿速
22.16 GiB (200K, q5_1) → 滿速      ← 上限就在這附近
22.30 GiB (224K, q5_1) → 掉 40%
22.37 GiB (256K)  → 掉 40%
</code></pre>
<p dir="auto">**天花板在 22.16 ~ 22.30 GiB 之間，只有約 140 MB 的餘裕。**超過之後 RADV 會把 buffer 靜靜地放到 GTT（走 PCIe 的系統記憶體），不會報錯、不會 OOM，就是全線掉 40%，非常容易誤判成「256K 本來就比較慢」。</p>
<p dir="auto">我特別驗證過<strong>不是分層掉到 CPU</strong>：#6(224K) 與 #3(128K) 的 VRAM 差 2.16 GiB，剛好等於多出來的 q4_0 KV（229376-131072 tokens × 18 KiB = 2.13 GiB），所有層都還在 GPU 上。</p>
<p dir="auto"><strong>所以 24GB 卡跑 27B Q4_K_M + 視覺投影，256K 是不可行的</strong>（原文能到是因為開了 SAM 拿到 25.75 GiB 的預算，而且用更小的 FP4 權重）。</p>
<h3>坑 3：<code>q5_K</code> 不能當 KV cache</h3>
<p dir="auto">原文寫「引入 q5_k / q4_0 組合」——<strong>這個參數傳不進去</strong>：</p>
<pre><code>$ llama-server --cache-type-k q5_K
error while handling argument "--cache-type-k": Unsupported cache type: q5_K
allowed values: f32, f16, bf16, q8_0, q4_0, q4_1, iq4_nl, q5_0, q5_1
</code></pre>
<p dir="auto">KV cache 只吃「legacy 量化」。K-quant（q5_K/q4_K…）用 256 元素超級區塊＋階層子縮放，flash-attention 的 KV 讀寫核心沒有實作那種存取樣式。</p>
<p dir="auto"><strong>想要 5-bit KV 就用 <code>q5_1</code></strong>（6 bits/elem，比 q5_0 多一個 zero-point，精度較好）。而且 <strong>K 比 V 敏感，可以不對稱配置</strong>：</p>
<pre><code class="language-bash">--cache-type-k q5_1 --cache-type-v q4_0    # → 200K 滿速，VRAM 22.16 GiB
</code></pre>
<p dir="auto">這是我最後採用的長上下文方案：比純 q4_0 的 224K 只少 11% 容量，換到 K 精度 +33%。</p>
<h3>坑 4：KV 量化不會讓你變快，別指望它</h3>
<p dir="auto">#2(q8_0) vs #3(q4_0) 在同樣 128K 下：123.9/66.9/41.8 vs 124.5/68.4/40.4——<strong>差異在噪音內</strong>。KV 量化省的是 VRAM，買到的是 ctx，<strong>不是速度</strong>。（順便：#3 的散文看起來慢 3%，實際是因為模型那次多寫了 14 個 token 才停，屬於輸出長度差異，不是吞吐量差異。這種假訊號在 benchmark 裡很常見。）</p>
<h3>沒踩到的坑：注意力旋轉</h3>
<p dir="auto">原文說開 KV 量化會在 hadamard 旋轉路徑觸發 <code>GGML_ASSERT(buffer) abort</code>，必須 <code>export LLAMA_ATTN_ROT_DISABLE=1</code>。</p>
<p dir="auto">我 <strong>q8_0 / q5_1 / q4_0 三種 KV 量化全部在旋轉開啟的狀態下正常運行</strong>，沒有崩。旋轉本身是提升量化 KV 精度的，能不關就別關。如果你真的撞到那個 assert 再開這個環境變數。</p>
<hr />
<h2>五、「越聊越慢」的穩定性套件</h2>
<p dir="auto">原文提到多輪對話後解碼一路下滑，因為 <code>kv_unified</code> 預設共享 KV，混合架構跨請求保不住狀態，每輪都要全量重算 prefill。修法是四件套：</p>
<pre><code class="language-bash">--no-kv-unified --parallel 1 --ctx-checkpoints 2 --cache-ram 4096
</code></pre>
<p dir="auto">實測：<strong>這組完全不影響速度</strong>（#8 加了三件套 vs #9 沒加，數字一模一樣），所以就算你沒遇到問題也可以直接加上。</p>
<p dir="auto">4 輪對話的增量 prefill 驗證（每輪都把前面的回覆整包送回去）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>輪次</th>
<th>重新 prefill 的 token 數</th>
<th>prefill 耗時</th>
<th>decode</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>24</td>
<td>0.32s</td>
<td>38.69 t/s</td>
</tr>
<tr>
<td>2</td>
<td><strong>190</strong></td>
<td>1.08s</td>
<td>41.11 t/s</td>
</tr>
<tr>
<td>3</td>
<td><strong>164</strong></td>
<td>1.08s</td>
<td>42.17 t/s</td>
</tr>
<tr>
<td>4</td>
<td><strong>158</strong></td>
<td>1.08s</td>
<td>42.55 t/s</td>
</tr>
</tbody>
</table>
<p dir="auto">第 2 輪只重算 190 token（= 新增的助手回覆 + 新問題），不是整段對話，而且 decode 速度<strong>沒有衰減反而微升</strong>。沒有雪崩。</p>
<hr />
<h2>六、DFlash2 sidecar：想用要重編</h2>
<p dir="auto">原文最終方案用 <code>--spec-type ngram-map-k4v,draft-dflash</code> 搭 DFlash2 側掛 drafter。我下了 <code>z-lab/Qwen3.8-27B-DFlash2</code>（Q4_K_M 只有 1.06 GB），載入直接失敗：</p>
<pre><code>llama_model_load: error loading model: done_getting_tensors:
  wrong number of tensors; expected 81, got 58
</code></pre>
<p dir="auto">差的 23 個張量正好是 <code>blk.*.attn_conv_base</code>、<code>blk.*.attn_conv_proj</code>、<code>blk.*.ffn_conv_base</code>、<code>blk.*.ffn_conv_proj</code>（4×5=20）＋ <code>selector_hidden</code> / <code>selector_predecessor</code> / <code>selector_successor</code>（3）。也就是<strong>舊的 dflash 實作不認識 DFlash2 的 conv + selector 結構</strong>，要用得換帶 DFlash2 支援的原始碼重編。</p>
<p dir="auto">不過：<strong>我沒重編也已經比它們的 97.8 快了</strong>，所以這步的邊際效益要自己評估。（有人編起來測到請回報，我很想知道 <code>k4v + dflash</code> 對散文有沒有幫助——那是目前唯一還是弱項的內容類型。）</p>
<hr />
<h2>七、最終配置（可直接抄）</h2>
<h3>方案 A：極速（KV 精度優先，128K）</h3>
<pre><code class="language-bash">./build-vulkan/bin/llama-server \
  -m models/Qwen3.8-27B-unsloth-Q4_K_M.gguf \
  --mmproj models/mmproj-Qwen3.8-27B-BF16.gguf \
  -c 131072 -fa on -np 1 -t 16 -tb 6 -ub 256 \
  --cache-type-k q8_0 --cache-type-v q8_0 \
  --device Vulkan0 --fit on --no-mmap \
  --no-kv-unified --ctx-checkpoints 2 --cache-ram 4096 \
  --spec-type ngram-map-k4v,draft-mtp \
  --spec-draft-n-max 3 --spec-draft-threads 4 --spec-draft-threads-batch 4 \
  --spec-ngram-map-k4v-size-n 32 \
  --spec-ngram-map-k4v-size-m 48 \
  --spec-ngram-map-k4v-min-hits 1 \
  --host 0.0.0.0 --port 9120 --alias qwen38-max --jinja
</code></pre>
<p dir="auto">→ <strong>124.0 / 67.1 / 41.9 t/s</strong>，VRAM 21.96 GiB</p>
<h3>方案 B：長上下文（200K）</h3>
<p dir="auto">把上面兩行 KV 改掉即可：</p>
<pre><code class="language-bash">  -c 204800 \
  --cache-type-k q5_1 --cache-type-v q4_0 \
</code></pre>
<p dir="auto">→ <strong>124.1 / 68.1 / 40.9 t/s</strong>，VRAM 22.16 GiB</p>
<p dir="auto">兩者<strong>速度完全相同</strong>，差別只有「K 精度 8.5 bit / 128K」對「6 bit / 200K」。</p>
<h3>幾個參數的說明</h3>
<ul>
<li><code>--device Vulkan0</code>：雙顯卡機器一定要指定，不然會被分到別張卡去。</li>
<li><code>--fit on</code>：讓引擎自適應分配、避免硬性 OOM。但要注意它可能安靜地把層搬到 CPU，<strong>看 VRAM 佔用比看 log 快</strong>。</li>
<li><code>-ub 256</code>：實測比預設好，prefill 沒有變慢。</li>
<li><code>-t 16 -tb 6</code>：CPU 執行緒；投機的 draft 執行緒另外用 <code>--spec-draft-threads 4</code>。</li>
<li><code>--no-mmap</code>：權重直接載進 VRAM，避免第一次推理時的分頁抖動。</li>
</ul>
<hr />
<h2>八、測速方法（請照著做，不然數字沒有意義）</h2>
<ol>
<li><strong>固定內容類型</strong>分開報。我用三種：重複輸出（n-gram 天堂）、數學推理（結構化）、創造性散文（不可預測）。混在一起測等於自欺欺人。</li>
<li><strong><code>temperature=0</code></strong>，不然每次採樣路徑不同、接受率跟輸出長度都會飄。</li>
<li><strong>讀 <code>timings.predicted_per_second</code></strong>，不要用「總時間 ÷ token 數」（會把 prefill 算進去）。</li>
<li><strong>看 <code>draft_n</code> / <code>draft_n_accepted</code></strong>。速度異常時先看接受率，八成問題在那裡。</li>
<li><strong>注意輸出長度</strong>。同一個 prompt 兩個配置可能一個寫 335 token、一個寫 369 token，t/s 會差 3% 但那不是速度差異。</li>
<li><strong>每次改設定都完整重啟 + 暖機一次</strong>，第一發請求永遠偏低。</li>
<li><strong>同一配置至少測兩次</strong>估噪音。我這台是 ±1%，超過這個範圍才算真差異。</li>
</ol>
<hr />
<h2>九、給 RDNA3 同好的重點整理</h2>
<ol>
<li><strong>先加 <code>--spec-type ngram-map-k4v,draft-mtp</code>，並且 <code>--spec-ngram-map-k4v-size-n 32</code></strong>。零成本、零 VRAM、零重編，逐字重現類任務直接快 40~60%。這是本次唯一真正的效能來源。<code>size-n</code> 太小會在部分任務上倒扣，是唯一要小心的地方。</li>
<li><strong><code>n_max</code> 保持 3、不要設 <code>p_min</code></strong>。猜多了在不可預測內容上是純虧損。</li>
<li><strong>KV 量化只換容量不換速度</strong>。想要長 ctx 用 <code>K q5_1 / V q4_0</code>；<code>q5_K</code> 不存在於 KV cache。</li>
<li><strong>盯 VRAM 佔用，天花板約 22.2 GiB</strong>。過線不會報錯，只會靜靜地掉 40%。24GB 卡別想 256K。</li>
<li><strong>Vulkan 別自卑</strong>。prefill 146~166 t/s、decode 124 t/s，不裝 ROCm、不編 HIP、不移植 FP4。</li>
<li><strong>穩定性四件套免費</strong>，直接加。</li>
<li><strong>投機解碼的 t/s 是內容的函數</strong>，看到別人報單一數字先問「什麼內容」。</li>
</ol>
<hr />
<h2>附錄：同一招在 NVIDIA 上一樣有效（+64%）</h2>
<p dir="auto">有人會問這是不是 AMD/Vulkan 特有的。不是——<strong>這是引擎層的投機解碼，跟後端無關</strong>。我在同一台機器的另一張卡上用完全相同的方法驗證：</p>
<p dir="auto">環境：RTX 4080 SUPER（32GB 魔改版）、CUDA build、Qwen3.8-27B <strong>Q5_K_M</strong>、<code>q4_0</code> KV、<strong>192K ctx</strong>、thinking 開啟（effort low / budget 1024）、外掛官方 <code>mtp-Qwen3.8-27B-Q4_0</code> drafter。</p>
<p dir="auto"><strong>單一變數對照</strong>（除了 <code>--spec-type</code> 與 k4v 三個參數，其餘指令列完全一致）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>配置</th>
<th>重複</th>
<th>推理</th>
<th>散文</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>draft-mtp</code>（原本）</td>
<td>108.6</td>
<td>88.0</td>
<td>62.7</td>
</tr>
<tr>
<td><strong><code>ngram-map-k4v,draft-mtp</code></strong></td>
<td><strong>178.6</strong></td>
<td>89.5</td>
<td>63.2</td>
</tr>
<tr>
<td>增幅</td>
<td><strong>+64.5%</strong></td>
<td>+1.7%</td>
<td>+0.8%</td>
</tr>
</tbody>
</table>
<p dir="auto">重複內容 <strong>108.6 → 178.6 t/s</strong>，比 7900 XTX 的 +53% 收益更大，推理與散文同樣沒有退步。</p>
<h3>順手掃了 <code>n_max</code> 的交互作用（k4v 開啟下）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th><code>--spec-draft-n-max</code></th>
<th>重複</th>
<th>推理</th>
<th>散文</th>
</tr>
</thead>
<tbody>
<tr>
<td>3</td>
<td>180.5</td>
<td>82.5</td>
<td><strong>64.4</strong></td>
</tr>
<tr>
<td><strong>4（採用）</strong></td>
<td>178.6</td>
<td>89.5</td>
<td>63.2</td>
</tr>
<tr>
<td>5</td>
<td><strong>183.5</strong></td>
<td><strong>91.1</strong></td>
<td>59.4</td>
</tr>
</tbody>
</table>
<p dir="auto">規律很乾淨：<strong><code>n_max</code> 越大，可預測內容越快、不可預測內容越慢</strong>（散文接受率從 0.57 掉到 0.39）。重複內容那欄三者都在 ±3% 噪音內，所以真正的取捨是「推理 vs 散文」。我選 4 當平衡點；如果你的用途偏程式碼/結構化輸出可以拉到 5，偏創作就用 3。</p>
<p dir="auto">這也回頭解釋了本文坑 1：原文的 <code>n5/p0.4</code> 之所以災難，主因不是 <code>n_max=5</code>，而是<strong>再疊上 <code>p_min=0.4</code></strong> 把低機率的 draft 也硬塞進去。</p>
<p dir="auto"><strong>所以這招 NVIDIA / AMD 都該開，成本是零。</strong></p>
<hr />
<p dir="auto"><em>所有數據為同一台機器單次工作階段內連續實測，含失敗組合。有錯歡迎指正。</em></p>
]]></description><link>https://lcz.me/topic/1398</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 16:51:02 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1398.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 29 Aug 2026 06:50:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Mon, 07 Sep 2026 11:07:06 GMT]]></title><description><![CDATA[<p dir="auto">AGI 谢谢回复，其实还可以加--spec-draft-type-k q4_0 --spec-draft-type-v q4_0，这样可以更省一步显存，另外日常任务多用分身去完成，主体只获取子agent的答案，这样上下文消耗速度明显降低<br />
。</p>
]]></description><link>https://lcz.me/post/16420</link><guid isPermaLink="true">https://lcz.me/post/16420</guid><dc:creator><![CDATA[gslzk]]></dc:creator><pubDate>Mon, 07 Sep 2026 11:07:06 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Sun, 06 Sep 2026 06:49:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gslzk" aria-label="Profile: gslzk">@<bdi>gslzk</bdi></a> 非常好的建议！很感谢！</p>
]]></description><link>https://lcz.me/post/16153</link><guid isPermaLink="true">https://lcz.me/post/16153</guid><dc:creator><![CDATA[AGI]]></dc:creator><pubDate>Sun, 06 Sep 2026 06:49:51 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Sun, 06 Sep 2026 06:25:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/zero-snow" aria-label="Profile: zero-snow">@<bdi>zero-snow</bdi></a>  OCuLink 從M.2 外接顯卡你用的谁家的？</p>
]]></description><link>https://lcz.me/post/16151</link><guid isPermaLink="true">https://lcz.me/post/16151</guid><dc:creator><![CDATA[nami ryuu]]></dc:creator><pubDate>Sun, 06 Sep 2026 06:25:59 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Fri, 04 Sep 2026 18:07:13 GMT]]></title><description><![CDATA[<p dir="auto">非常感謝 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f64f.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--pray" 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=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--skin-tone-2" style="height:23px;width:auto;vertical-align:middle" title="🏻" alt="🏻" /></p>
]]></description><link>https://lcz.me/post/15892</link><guid isPermaLink="true">https://lcz.me/post/15892</guid><dc:creator><![CDATA[Ranford Wong]]></dc:creator><pubDate>Fri, 04 Sep 2026 18:07:13 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Thu, 03 Sep 2026 13:48:42 GMT]]></title><description><![CDATA[<p dir="auto">可以加--no-mmproj-offload，让cpu计算图片，又可以省一些显存出来，而且速度不慢，适合读图不多的工作环境。</p>
<p dir="auto">另外我加载了--chat-template-file D:\models\Qwen3.8-27B-GGUF\chat_template.jinja，可以让思考变少一些</p>
]]></description><link>https://lcz.me/post/15706</link><guid isPermaLink="true">https://lcz.me/post/15706</guid><dc:creator><![CDATA[gslzk]]></dc:creator><pubDate>Thu, 03 Sep 2026 13:48:42 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Thu, 03 Sep 2026 13:13:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chia-an-yang" aria-label="Profile: CHIA-AN-YANG">@<bdi>CHIA-AN-YANG</bdi></a> 既然你开口了，那就置顶，推下。</p>
]]></description><link>https://lcz.me/post/15690</link><guid isPermaLink="true">https://lcz.me/post/15690</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Thu, 03 Sep 2026 13:13:43 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Thu, 03 Sep 2026 12:46:22 GMT]]></title><description><![CDATA[<p dir="auto">推一個 優質好文,願意分享就給讚</p>
]]></description><link>https://lcz.me/post/15675</link><guid isPermaLink="true">https://lcz.me/post/15675</guid><dc:creator><![CDATA[CHIA AN YANG]]></dc:creator><pubDate>Thu, 03 Sep 2026 12:46:22 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Thu, 03 Sep 2026 07:22:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/heheimback" aria-label="Profile: heheimback">@<bdi>heheimback</bdi></a> 没办法，这是硬伤，单卡承受不住kv，势必会掉到内存，那瓶颈就是主板的pcie通道速度</p>
]]></description><link>https://lcz.me/post/15631</link><guid isPermaLink="true">https://lcz.me/post/15631</guid><dc:creator><![CDATA[坤坤]]></dc:creator><pubDate>Thu, 03 Sep 2026 07:22:13 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Thu, 03 Sep 2026 07:05:43 GMT]]></title><description><![CDATA[<p dir="auto">长上下文掉速，帮补个通用账（也值得公开回一下），先分清是哪种：</p>
<ol>
<li>线性掉速（正常物理账）：decode 每生成一个 token 都要把整段 KV 扫一遍，上下文翻倍 = KV 读取翻倍。27B 的 KV 约 37KB/token（q8 时），128K 上下文每次生成要扫约 4.7GB，掉速是必然不是 bug。能优化的是这几处：</li>
</ol>
<ul>
<li>KV 量化 q8→q4_0：KV 字节和带宽占用直接减半，质量损失很小（站内实测 tg 只掉 2-3%），对长上下文收益最大；</li>
<li>窗口按需：别固定开 256K，什么任务开多大——短任务 16-32K 就够，速度立刻回来；</li>
<li>查"断崖"：如果掉速是断崖式的（到某个长度突然暴跌），那是显存不够、权重或 KV 溢出到内存了，先确认 -ngl 和 KV 缓存全在显存里，跟量化无关。</li>
</ul>
<ol start="2">
<li>边际提醒：MTP/投机解码在长上下文下收益会变小——draft 头每步也要扫同一段 KV，上下文越长它的成本越高，别指望投机解码救长窗。</li>
</ol>
<p dir="auto">如果能贴一下具体数字（多少 K 开始掉、从多少掉到多少、KV 量化开没开、有没有溢出），就能定位是纯物理账还是有配置问题。</p>
]]></description><link>https://lcz.me/post/15627</link><guid isPermaLink="true">https://lcz.me/post/15627</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Thu, 03 Sep 2026 07:05:43 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Thu, 03 Sep 2026 01:59:28 GMT]]></title><description><![CDATA[<p dir="auto">大佬，有没有长上下文速度tps降的太多的优化方案呢</p>
]]></description><link>https://lcz.me/post/15569</link><guid isPermaLink="true">https://lcz.me/post/15569</guid><dc:creator><![CDATA[heheimback]]></dc:creator><pubDate>Thu, 03 Sep 2026 01:59:28 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Wed, 02 Sep 2026 09:57:35 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andyfay" aria-label="Profile: andyfay">@<bdi>andyfay</bdi></a> <a href="/post/15185">说</a>:</p>
<p dir="auto">不错，多谢分享，R9700单卡Q5从30到40多了</p>
</blockquote>
<p dir="auto">谢谢老哥分享，Q5 40多不错了吧！</p>
]]></description><link>https://lcz.me/post/15488</link><guid isPermaLink="true">https://lcz.me/post/15488</guid><dc:creator><![CDATA[coolstar]]></dc:creator><pubDate>Wed, 02 Sep 2026 09:57:35 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Tue, 01 Sep 2026 14:26:36 GMT]]></title><description><![CDATA[<p dir="auto">真不错！收藏了，支持</p>
]]></description><link>https://lcz.me/post/15356</link><guid isPermaLink="true">https://lcz.me/post/15356</guid><dc:creator><![CDATA[fantasy2026]]></dc:creator><pubDate>Tue, 01 Sep 2026 14:26:36 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Tue, 01 Sep 2026 09:03:31 GMT]]></title><description><![CDATA[<p dir="auto">非常好的帖子，我去试下</p>
]]></description><link>https://lcz.me/post/15322</link><guid isPermaLink="true">https://lcz.me/post/15322</guid><dc:creator><![CDATA[heheimback]]></dc:creator><pubDate>Tue, 01 Sep 2026 09:03:31 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Mon, 31 Aug 2026 15:24:11 GMT]]></title><description><![CDATA[<p dir="auto">不错，多谢分享，R9700单卡Q5从30到40多了</p>
]]></description><link>https://lcz.me/post/15185</link><guid isPermaLink="true">https://lcz.me/post/15185</guid><dc:creator><![CDATA[andyfay]]></dc:creator><pubDate>Mon, 31 Aug 2026 15:24:11 GMT</pubDate></item><item><title><![CDATA[Reply to 單張 RX 7900 XTX 24GB  Qwen3.8-27B 優化紀錄 —— Vulkan 路線實測報告 on Sat, 29 Aug 2026 07:16:13 GMT]]></title><description><![CDATA[<p dir="auto">挺好的分享，单卡单会话下很有价值。</p>
]]></description><link>https://lcz.me/post/14738</link><guid isPermaLink="true">https://lcz.me/post/14738</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sat, 29 Aug 2026 07:16:13 GMT</pubDate></item></channel></rss>