<?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[R9700 32GB 跑 Qwen3.8-27B：llama.cpp Vulkan + MTP 实测与踩坑记录]]></title><description><![CDATA[<p dir="auto">最近在一张 <strong>AMD Radeon AI PRO R9700 32GB</strong> 上折腾 Qwen3.8-27B，前后试了 ROCm 下的 SGLang、vLLM，以及 llama.cpp 的 HIP / Vulkan 路线。</p>
<p dir="auto">最后这台机器上比较稳定、速度也比较理想的方案，是：</p>
<p dir="auto"><strong>llama.cpp + Mesa RADV Vulkan + Q4_K_M + MTP + 128K Context</strong></p>
<p dir="auto">先说结论：如果手里已经有 R9700，现阶段我更建议优先试 llama.cpp Vulkan。至少在我这套环境里，它比我之前折腾的 ROCm 路线省心得多。</p>
<blockquote>
<p dir="auto">下面的数据只代表这台机器、当前驱动和对应版本下的结果，不建议直接外推到所有 R9700 或所有模型。全程使用Gemini 3.7 flash 配置。</p>
</blockquote>
<hr />
<h2>1. 测试环境</h2>
<p dir="auto"><img src="https://upload.lcz.me/uploads/e2f7ec38-5bb0-458e-b5da-41bab118832e.jpeg" alt="3c5fd039-4a59-4168-b40c-9e74da4cf18b-image.jpeg" class=" img-fluid img-markdown" /><br />
硬件大致如下：</p>
<ul>
<li>华南金牌 X99-TF</li>
<li>Xeon E5 v4 2697A</li>
<li>128GB DDR4</li>
<li>AMD Radeon AI PRO R9700 32GB</li>
<li>PCIe 3.0 x16</li>
<li>机器里同时还有一张 NVIDIA 4080s 32G</li>
</ul>
<p dir="auto">软件环境：</p>
<ul>
<li>Ubuntu 24.04</li>
<li>Mesa 25.2.x / RADV Vulkan</li>
<li>llama.cpp Vulkan 构建</li>
<li>Qwen3.8-27B Q4_K_M</li>
<li>视觉模型使用对应的 F16 mmproj</li>
</ul>
<p dir="auto">BIOS 里开启：</p>
<ul>
<li><strong>Above 4G Decoding</strong></li>
<li><strong>Resizable BAR</strong></li>
</ul>
<hr />
<h2>2. 目前的实测结果</h2>
<p dir="auto"><img src="https://upload.lcz.me/uploads/8decab73-e744-4fc3-a3f9-ab7ece169a14.png" alt="c7be7696-b82f-415e-a93b-aa2428a49116.png" class=" img-fluid img-markdown" /></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>场景</th>
<th style="text-align:right">实测</th>
</tr>
</thead>
<tbody>
<tr>
<td>长文本 Prefill，约 2322 tokens</td>
<td style="text-align:right"><strong>730.89 t/s</strong></td>
</tr>
<tr>
<td>非思考模式，代码生成</td>
<td style="text-align:right"><strong>53.10 t/s</strong></td>
</tr>
<tr>
<td>思考模式，数学证明</td>
<td style="text-align:right"><strong>44.81 t/s</strong></td>
</tr>
<tr>
<td>视觉问答生成</td>
<td style="text-align:right"><strong>35.80 t/s</strong></td>
</tr>
<tr>
<td>视觉问答 TTFT</td>
<td style="text-align:right"><strong>约 927 ms</strong></td>
</tr>
<tr>
<td>Context</td>
<td style="text-align:right"><strong>128K</strong></td>
</tr>
<tr>
<td>运行时显存占用</td>
<td style="text-align:right"><strong>约 20.3 GiB</strong></td>
</tr>
</tbody>
</table>
<p dir="auto">其中 53 t/s 并不是所有问题都能稳定达到。</p>
<p dir="auto">Qwen3.8 的 MTP 对任务类型比较敏感。代码、JSON、工具调用这类下一 token 比较容易预测的任务，接受率高，速度会明显上去；开放式写作、视觉问答这类任务，接受率下降，速度也会跟着掉。</p>
<p dir="auto">我这边两个比较典型的数据：</p>
<ul>
<li>代码生成：MTP acceptance <strong>约 68.7%</strong>，53.10 t/s</li>
<li>数学证明：MTP acceptance <strong>约 54.9%</strong>，44.81 t/s</li>
</ul>
<p dir="auto">所以以后看别人贴 R9700 / Qwen3.8 的速度，最好先看他测的是什么题、有没有开 MTP，而不是只看一个 t/s。</p>
<hr />
<h2>3. 我现在用的关键参数</h2>
<p dir="auto">核心启动参数大概是下面这样：</p>
<pre><code class="language-bash">export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.json

./llama-server \
  --model /path/to/Qwen3.8-27B-Q4_K_M.gguf \
  --mmproj /path/to/mmproj-Qwen3.8-27B-F16.gguf \
  --ctx-size 131072 \
  --cache-type-k q4_0 \
  --cache-type-v q4_0 \
  --n-gpu-layers 999 \
  --no-mmap \
  --spec-type draft-mtp \
  --spec-draft-n-max 5 \
  --cache-ram 32768 \
  --flash-attn on \
  --parallel 1 \
  --jinja
</code></pre>
<p dir="auto">几个我觉得比较关键的地方。</p>
<h3>① 双显卡环境最好显式指定 Vulkan ICD</h3>
<p dir="auto">我的机器同时有 AMD 和 NVIDIA 卡。</p>
<p dir="auto">如果直接让 Vulkan 自己探测，偶尔会碰到加载错 ICD 的问题。显式指定：</p>
<pre><code class="language-bash">VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.json
</code></pre>
<p dir="auto">之后省事很多。</p>
<p dir="auto">如果是纯 AMD 单卡机器，未必需要这么做。</p>
<h3>② 128K 下 KV Cache 用 q4_0</h3>
<p dir="auto">我现在是：</p>
<pre><code class="language-bash">--cache-type-k q4_0
--cache-type-v q4_0
</code></pre>
<p dir="auto">这样 128K Context 可以装下，整套运行时显存大约 20.3 GiB，还能留出十来 GB 余量。</p>
<p dir="auto">如果 KV Cache 直接上高精度，32GB 显存会紧张很多。</p>
<h3>③ MTP 我这里 <code>n-max=5</code> 比较合适</h3>
<pre><code class="language-bash">--spec-type draft-mtp
--spec-draft-n-max 5
</code></pre>
<p dir="auto">我试过把步数继续往上加，但不是越大越快。</p>
<p dir="auto">草稿猜错以后需要重新验证，步数过大反而可能拖慢整体 Decode。至少我这组测试里，5 是比较合适的点。</p>
<h3>④ Prompt Cache 别留太小</h3>
<p dir="auto">长对话下，如果 <code>--cache-ram</code> 太小，日志里可能看到 cache skipping，后续请求又重新做 Prefill。</p>
<p dir="auto">我最后给到：</p>
<pre><code class="language-bash">--cache-ram 32768
</code></pre>
<p dir="auto">这主要吃系统内存，不是显存。机器内存够的话可以适当放大。</p>
<hr />
<h2>4. ReBAR 值得检查</h2>
<p dir="auto">这是这次折腾里我觉得最值得单独说的一点。</p>
<p dir="auto">最开始这台 X99 平台没有把 ReBAR 配好，长 Prompt 的 Prefill 大约在 <strong>450 t/s</strong> 左右。</p>
<p dir="auto">BIOS 开启：</p>
<ul>
<li>Above 4G Decoding</li>
<li>Resizable BAR</li>
</ul>
<p dir="auto">并确认系统里 R9700 的 BAR 映射正常后，同一套环境下长文本 Prefill 测到 <strong>730.89 t/s</strong>。</p>
<p dir="auto">从这组结果看，提升大约 <strong>62%</strong>。</p>
<p dir="auto">不过这里我更愿意把它理解成“这台机器上的实测现象”，而不是说所有 R9700 开 ReBAR 都一定能涨 60%。</p>
<p dir="auto">老平台、PCIe 拓扑、驱动版本都可能影响结果。</p>
<p dir="auto">如果 Prefill 明显偏慢，我建议先查 ReBAR，而不是一上来就怀疑模型或 llama.cpp。</p>
<hr />
<h2>5. Vulkan、SGLang、vLLM，我最后为什么留 Vulkan</h2>
<p dir="auto">我前面也折腾过 ROCm。</p>
<p dir="auto">当时大概是这个情况：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>路线</th>
<th>我这台机器上的情况</th>
</tr>
</thead>
<tbody>
<tr>
<td>SGLang / ROCm</td>
<td>可以跑，但大上下文下 Decode 大约 11 t/s，空闲功耗表现也不理想</td>
</tr>
<tr>
<td>vLLM / ROCm</td>
<td>128K 需要继续调 KV Cache 和请求限制，当时 Decode 大约 7～8 t/s</td>
</tr>
<tr>
<td>llama.cpp HIP</td>
<td>可以用，但我测试时稳定性和 MTP 表现不如 Vulkan</td>
</tr>
<tr>
<td>llama.cpp Vulkan</td>
<td>当前最省事，MTP、Flash Attention、128K、mmproj 都能正常用</td>
</tr>
</tbody>
</table>
<p dir="auto">这里要特别说明：</p>
<p dir="auto"><strong>这不是严格的同权重、同量化、同版本横向 benchmark。</strong></p>
<p dir="auto">SGLang / vLLM 当时使用的权重格式和运行条件并不完全一样，所以这些数字只能说明“我最后为什么选 Vulkan”，不能拿来证明 Vulkan 理论上一定比 ROCm 快多少。</p>
<p dir="auto">后面 ROCm、vLLM、SGLang 对 RDNA4 的支持继续完善以后，结果完全可能变化。</p>
<hr />
<h2>6. 几个比较容易踩的坑</h2>
<h3>ReBAR 没开</h3>
<p dir="auto">表现：</p>
<ul>
<li>长 Prompt Prefill 偏慢</li>
<li>视觉输入响应也可能不理想</li>
</ul>
<p dir="auto">先检查 BIOS 的 Above 4G Decoding 和 ReBAR。</p>
<h3>用几十个 token 测 Prefill</h3>
<p dir="auto">短 Prompt 固定开销占比太高，数据没什么参考意义。</p>
<p dir="auto">我现在至少用 2000 tokens 左右的输入来观察 Prefill。</p>
<h3>MTP 步数一味往上加</h3>
<p dir="auto"><code>n-max=8</code>、<code>10</code> 不一定比 5 快。</p>
<p dir="auto">接受率掉下来后，可能越调越慢。</p>
<h3>128K 还坚持高精度 KV Cache</h3>
<p dir="auto">32GB 显存很容易被吃满。</p>
<p dir="auto">如果目标就是单请求 128K，q4_0 KV Cache 是一个比较实用的取舍。</p>
<h3>双卡机器不指定 Vulkan ICD</h3>
<p dir="auto">AMD + NVIDIA 混插时尤其值得注意。</p>
<p dir="auto">遇到 Vulkan 启动异常，可以先确认实际加载的是不是 RADV。</p>
<hr />
<h2>7. 关于老 X99 / E5 v4 会不会拖后腿</h2>
<p dir="auto">这也是我一开始比较担心的。</p>
<p dir="auto">从目前的监控看，Decode 阶段 GPU 利用率很高，CPU 占用并不高。至少在我这套单请求测试里，E5 v4 还没有表现成明显瓶颈。</p>
<p dir="auto">这不代表 CPU 完全不重要。</p>
<p dir="auto">高并发、大量预处理、复杂 Agent 工作流或者频繁 CPU<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2194.png?v=60716d54ab2" class="not-responsive emoji emoji-android emoji--left_right_arrow" style="height:23px;width:auto;vertical-align:middle" title="↔" alt="↔" />GPU 数据交换时，老平台还是可能影响整体体验。</p>
<p dir="auto">但如果只是单用户本地 LLM 推理，我暂时没有因为 X99 去换平台的打算。</p>
<hr />
<h2>8. 目前还没测的东西</h2>
<p dir="auto">这篇主要是单实例、单请求测试。</p>
<p dir="auto">还没有认真做：</p>
<ul>
<li><code>--parallel 4</code> 之类的多并发压力测试</li>
<li>128K 下长时间并发稳定性</li>
<li>接入Hermes的测试</li>
<li>不同 GGUF 量化之间的质量和速度对比</li>
</ul>
<p dir="auto">所以现在更适合把它看成一份 <strong>R9700 + llama.cpp Vulkan 的实机配置记录</strong>，不是完整 benchmark。</p>
<hr />
<h2>结论</h2>
<p dir="auto">如果是 <strong>R9700 32GB + Qwen3.8-27B</strong>，我目前会推荐：</p>
<p dir="auto"><strong>Q4_K_M + llama.cpp Vulkan + MTP + q4_0 KV Cache</strong></p>
<p dir="auto">我这台机器上可以稳定跑 128K，上下文显存余量也比较充足；普通生成大约在 40～50 t/s，代码这类 MTP 接受率高的任务可以到 50 t/s 以上。</p>
<p dir="auto">另外，如果 Prefill 明显低于预期，建议优先检查 <strong>Above 4G Decoding / ReBAR</strong>。</p>
<p dir="auto">:::</p>
]]></description><link>https://lcz.me/topic/1218/r9700-32gb-跑-qwen3.8-27b-llama.cpp-vulkan-mtp-实测与踩坑记录</link><generator>RSS for Node</generator><lastBuildDate>Sat, 22 Aug 2026 03:26:46 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1218.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 20 Aug 2026 10:18:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to R9700 32GB 跑 Qwen3.8-27B：llama.cpp Vulkan + MTP 实测与踩坑记录 on Fri, 21 Aug 2026 01:44:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phoenixrise2026" aria-label="Profile: phoenixrise2026">@<bdi>phoenixrise2026</bdi></a><br />
我也是 R9700，但是CPU是AMD Ryzen 9700X，Mesa RADV Vulkan升级到26.1.7后，llama-bench测试Qwen3.8-27B-UD-Q4_K_XL，prefill比25.2.X版本有明显提升，decode比ROCm快。</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>prompt size</th>
<th>Vulkan 旧驱动 25.2.8</th>
<th>Vulkan 新驱动 26.1.7</th>
<th>ROCm</th>
</tr>
</thead>
<tbody>
<tr>
<td>pp512</td>
<td>881.8</td>
<td>1014.2 (+15.0%)</td>
<td>1206.5</td>
</tr>
<tr>
<td>pp2048</td>
<td>870.1</td>
<td>1004.4(+15.4%)</td>
<td>1182.2</td>
</tr>
<tr>
<td>pp8192</td>
<td>825.7</td>
<td>953.2 (+15.4%)</td>
<td>1124.1</td>
</tr>
<tr>
<td>tg128</td>
<td>28.16</td>
<td>28.41 (+0.9%)</td>
<td>26.43</td>
</tr>
</tbody>
</table>
<p dir="auto">另外好奇的是，你的4080s 32GB是魔改卡吗？为什么不是涡轮散热器？</p>
]]></description><link>https://lcz.me/post/13186</link><guid isPermaLink="true">https://lcz.me/post/13186</guid><dc:creator><![CDATA[wml-ai]]></dc:creator><pubDate>Fri, 21 Aug 2026 01:44:35 GMT</pubDate></item><item><title><![CDATA[Reply to R9700 32GB 跑 Qwen3.8-27B：llama.cpp Vulkan + MTP 实测与踩坑记录 on Thu, 20 Aug 2026 11:44:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/exllm" aria-label="Profile: exllm">@<bdi>exllm</bdi></a> 谢谢提醒，补一个q8_0的测试结果<br />
<img src="https://upload.lcz.me/uploads/fff8c1be-c809-48bd-86d7-bba8e08e646d.png" alt="15ac13bc-d61a-48a0-9431-9e5740df43f7.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://lcz.me/post/13089</link><guid isPermaLink="true">https://lcz.me/post/13089</guid><dc:creator><![CDATA[PhoenixRise2026]]></dc:creator><pubDate>Thu, 20 Aug 2026 11:44:27 GMT</pubDate></item><item><title><![CDATA[Reply to R9700 32GB 跑 Qwen3.8-27B：llama.cpp Vulkan + MTP 实测与踩坑记录 on Thu, 20 Aug 2026 10:44:54 GMT]]></title><description><![CDATA[<p dir="auto">32G 显存， cache 可以用q8_0， 3.8-27B量化用q4_0很容易在思考阶段死循环，调整repeat-penalty也无法排除， 同样的问题3.6-27B就不会。</p>
]]></description><link>https://lcz.me/post/13081</link><guid isPermaLink="true">https://lcz.me/post/13081</guid><dc:creator><![CDATA[exllm]]></dc:creator><pubDate>Thu, 20 Aug 2026 10:44:54 GMT</pubDate></item><item><title><![CDATA[Reply to R9700 32GB 跑 Qwen3.8-27B：llama.cpp Vulkan + MTP 实测与踩坑记录 on Thu, 20 Aug 2026 10:34:48 GMT]]></title><description><![CDATA[<p dir="auto">如果模型能基本完整放进显存，内存速度影响通常不大，Decode 阶段主要还是看显卡和显存带宽。</p>
<p dir="auto">内存容量更重要一些，主要影响模型加载、系统文件缓存、Prompt Cache，以及显存不够时的 CPU offload。内存太小会导致加载困难、频繁换页，甚至直接 OOM。</p>
<p dir="auto">如果模型需要大量 CPU/GPU 混合推理，那内存带宽就会明显重要起来，情况会不一样。</p>
]]></description><link>https://lcz.me/post/13076</link><guid isPermaLink="true">https://lcz.me/post/13076</guid><dc:creator><![CDATA[PhoenixRise2026]]></dc:creator><pubDate>Thu, 20 Aug 2026 10:34:48 GMT</pubDate></item><item><title><![CDATA[Reply to R9700 32GB 跑 Qwen3.8-27B：llama.cpp Vulkan + MTP 实测与踩坑记录 on Thu, 20 Aug 2026 10:26:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phoenixrise2026" aria-label="Profile: PhoenixRise2026">@<bdi>PhoenixRise2026</bdi></a> 谢谢分享， 请问电脑内存的大小和速度影响大么？</p>
]]></description><link>https://lcz.me/post/13075</link><guid isPermaLink="true">https://lcz.me/post/13075</guid><dc:creator><![CDATA[johnnybegood]]></dc:creator><pubDate>Thu, 20 Aug 2026 10:26:04 GMT</pubDate></item></channel></rss>