<?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[7900 XTX 的可能性探索｜单卡篇（一）：daniel-mtp HIP build — 我目前实测最优的 Qwen3.8-27B Q4 + KV Q8 本地部署方案]]></title><description><![CDATA[<p dir="auto"><img src="https://upload.lcz.me/uploads/0af46c6b-292e-4df6-a4fb-0b48d1c5228c.png" alt="8e3fad02-5011-42a8-977c-51903ab1c090.png" class="img-markdown  img-fluid" /></p>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=fe25256ab4a" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️注：本文仅代表我自己机器上的实测结果，以及我自己不同配置之间的对比。肯定还有高手，欢迎分享您的方案</p>
</blockquote>
<hr />
<p dir="auto">AMD Radeon RX 7900 XTX 是一张很有特点的显卡：24GB 显存、960GB/s 显存带宽，运行安静，放到今天看性价比依然有一定优势。</p>
<p dir="auto">在老特的感召下，我前后买了两张这个卡，自己用了三个多月，也陆续折腾和尝试了不少不同的本地大模型部署方案，想看看这张卡到底还能挖出多少潜力。</p>
<p dir="auto">这次准备把自己这段时间的一些测试、配置和踩坑经验分几篇整理出来，算是抛砖引玉，给同样在折腾 AMD 7900 XTX 的朋友做个参考。</p>
<p dir="auto">也欢迎大家分享自己的配置、测试结果和优化思路，有更好的方案也请多提宝贵意见。</p>
<hr />
<h2>1. 新的 HIP build 来源</h2>
<p dir="auto">本次主要性能提升来自新的 HIP build / 编译路径</p>
<p dir="auto">特别感谢：</p>
<ul>
<li>llama.cpp 项目  <a href="https://github.com/ggml-org/llama.cpp" rel="nofollow ugc">https://github.com/ggml-org/llama.cpp</a></li>
<li><code>daniel-mtp</code> 分支，HEAD 6fcaa16f4（2026-09-21），基于 llama.cpp upstream + MTP PR #28243</li>
<li>AMD ROCm / HIP 社区针对 gfx1100 的持续优化</li>
</ul>
<hr />
<h2>2. 测试硬件与环境</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 24GB</td>
</tr>
<tr>
<td>GPU 数量</td>
<td>1</td>
</tr>
<tr>
<td>CPU</td>
<td>AMD Ryzen 5 9600X</td>
</tr>
<tr>
<td>主板</td>
<td>GIGABYTE B850 AI TOP AMD AM5 ATX Motherboard</td>
</tr>
<tr>
<td>系统内存</td>
<td>64GB DDR5</td>
</tr>
<tr>
<td>PCIe</td>
<td>PCIe 4.0 x8（主机安装双卡后该槽位工作在 x8；本篇测试仅使用 GPU0 单卡）</td>
</tr>
<tr>
<td>OS</td>
<td>Linux</td>
</tr>
<tr>
<td>ROCm</td>
<td>7.2.3</td>
</tr>
<tr>
<td>Backend</td>
<td>llama.cpp HIP</td>
</tr>
<tr>
<td>Model</td>
<td>Qwen3.8-27B Q4_K_M</td>
</tr>
<tr>
<td>GPU offload</td>
<td><code>-ngl 99</code></td>
</tr>
<tr>
<td>Flash Attention</td>
<td><code>-fa on</code></td>
</tr>
<tr>
<td>Batch</td>
<td><code>-b 2048</code></td>
</tr>
<tr>
<td>UBatch</td>
<td><code>-ub 512</code></td>
</tr>
<tr>
<td>KV</td>
<td>q8_0 主测，128K Full-KV 已完整验证；更大上下文可考虑 <code>q4_0</code></td>
</tr>
<tr>
<td>MTP</td>
<td>模型自带 nextn head</td>
</tr>
<tr>
<td>GPU arch</td>
<td>gfx1100</td>
</tr>
<tr>
<td>Compiler</td>
<td>ROCm clang</td>
</tr>
<tr>
<td><code>GGML_NATIVE</code></td>
<td>ON</td>
</tr>
<tr>
<td><code>GGML_OPENMP</code></td>
<td>ON</td>
</tr>
<tr>
<td>HIP flag</td>
<td><code>-mllvm --amdgpu-unroll-threshold-local=600</code></td>
</tr>
</tbody>
</table>
<hr />
<h2>3. Cold Prefill 性能</h2>
<h3>Server 实测</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:right">Context</th>
<th style="text-align:right">Prompt tokens</th>
<th style="text-align:right">Prefill</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:right">32K</td>
<td style="text-align:right">32,741</td>
<td style="text-align:right"><strong>882.98 tok/s</strong></td>
</tr>
<tr>
<td style="text-align:right">64K</td>
<td style="text-align:right">65,474</td>
<td style="text-align:right"><strong>763.74 tok/s</strong></td>
</tr>
<tr>
<td style="text-align:right">128K</td>
<td style="text-align:right">130,941</td>
<td style="text-align:right"><strong>607.22 tok/s</strong></td>
</tr>
</tbody>
</table>
<h3>llama-bench 独立复核</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:right">Context</th>
<th style="text-align:right">Prefill</th>
<th style="text-align:right">样本稳定性</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:right">32K</td>
<td style="text-align:right"><strong>886.13 tok/s</strong></td>
<td style="text-align:right">σ = 2.81</td>
</tr>
<tr>
<td style="text-align:right">64K</td>
<td style="text-align:right"><strong>764.87 tok/s</strong></td>
<td style="text-align:right">σ = 0.58</td>
</tr>
<tr>
<td style="text-align:right">128K</td>
<td style="text-align:right"><strong>606.43 tok/s</strong></td>
<td style="text-align:right">σ = 0.11</td>
</tr>
</tbody>
</table>
<p dir="auto">Server 与 llama-bench 基本重合，这说明测试结果具有较好的可重复性：</p>
<ul>
<li>32K: 882.98 vs 886.13</li>
<li>64K: 763.74 vs 764.87</li>
<li>128K: 607.22 vs 606.43</li>
</ul>
<p dir="auto"><code>llama-bench</code> 更接近底层纯性能测试，用来观察模型和后端本身的 Prefill 吞吐；<code>llama-server</code> 则更接近实际部署场景，还包含服务端请求、tokenization、调度等额外路径。</p>
<p dir="auto">两套独立测试在 32K / 64K / 128K 三档都高度一致，说明这里的 Prefill 数字不是单一 benchmark 工具或服务端计时方式造成的偶然结果，可以作为后续配置对比的稳定基线。</p>
<hr />
<h2>4. 对比我之前的旧 build-rocmfp4 路线。</h2>
<p dir="auto">已确认的主要差异：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项目</th>
<th>旧 baseline</th>
<th>当前配置</th>
</tr>
</thead>
<tbody>
<tr>
<td>GPU</td>
<td>RX 7900 XTX 24GB，单卡</td>
<td>RX 7900 XTX 24GB，单卡</td>
</tr>
<tr>
<td>Model</td>
<td>Qwen3.8-27B Q4_K_M</td>
<td>Qwen3.8-27B Q4_K_M</td>
</tr>
<tr>
<td>Backend</td>
<td>llama.cpp / ROCm HIP</td>
<td>llama.cpp / ROCm HIP</td>
</tr>
<tr>
<td>Build</td>
<td><code>build-rocmfp4</code></td>
<td><code>daniel-mtp</code> HIP build</td>
</tr>
<tr>
<td>ROCm</td>
<td>7.2.x 环境</td>
<td>7.2.3</td>
</tr>
<tr>
<td>KV cache</td>
<td><code>q4_0</code></td>
<td><code>q8_0</code> 主测；<code>q4_0</code> 可根据情况自行配置</td>
</tr>
<tr>
<td>Flash Attention</td>
<td>ON</td>
<td>ON</td>
</tr>
<tr>
<td>GPU offload</td>
<td>Full GPU offload</td>
<td><code>-ngl 99</code></td>
</tr>
<tr>
<td>当前编译目标</td>
<td>旧 build 原配置</td>
<td><code>gfx1100</code> 单架构</td>
</tr>
<tr>
<td>Compiler</td>
<td>旧 build 工具链</td>
<td>ROCm clang</td>
</tr>
<tr>
<td><code>GGML_NATIVE</code></td>
<td>旧 build 原配置</td>
<td>ON</td>
</tr>
<tr>
<td><code>GGML_OPENMP</code></td>
<td>旧 build 原配置</td>
<td>ON</td>
</tr>
<tr>
<td>HIP compile flag</td>
<td>旧 build 原配置</td>
<td><code>-mllvm --amdgpu-unroll-threshold-local=600</code></td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto">注：旧 build 与当前 build 并不是严格的单变量源码 A/B，因此本文把结果表述为“旧部署 build → 当前 HIP build 的整体提升”，不把全部增益强行归因给某一个单独编译参数。</p>
<p dir="auto">后续我又在<strong>当前同一个 build</strong>下补做了 <code>q4_0</code> vs <code>q8_0</code> KV A/B，结果 Prefill 几乎完全一致，因此可以排除“这次提升主要来自 KV dtype 改变”这一解释。</p>
</blockquote>
<h3>Prefill 对比</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:right">Context</th>
<th style="text-align:right">9/25 旧 build</th>
<th style="text-align:right">当前 build</th>
<th style="text-align:right">提升</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:right">32K</td>
<td style="text-align:right">725.98</td>
<td style="text-align:right"><strong>882.98</strong></td>
<td style="text-align:right"><strong>+21.6%</strong></td>
</tr>
<tr>
<td style="text-align:right">64K</td>
<td style="text-align:right">574.16</td>
<td style="text-align:right"><strong>763.74</strong></td>
<td style="text-align:right"><strong>+33.0%</strong></td>
</tr>
<tr>
<td style="text-align:right">128K</td>
<td style="text-align:right">~406</td>
<td style="text-align:right"><strong>607.22</strong></td>
<td style="text-align:right"><strong>约 +49.6%</strong></td>
</tr>
</tbody>
</table>
<p dir="auto">上图可以看出，新 build 不仅整体 Prefill 更高，随着 Context 增长，性能衰减也明显更缓。</p>
<p dir="auto">最后附一张对比图结尾。</p>
<p dir="auto">后面的帖子里，我会继续介绍基于这套底座延伸出来的新玩法；这也是这篇帖子里 KV 只以 q8_0 为主测的原因。</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/2bc9f6cb-ce19-462e-9e54-a6fdd45f5286.png" alt="937dbc60-955d-4587-b3b7-eec6e9e36f54.png" class="img-markdown  img-fluid" /></p>
]]></description><link>https://lcz.me/topic/1960</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 18:24:37 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1960.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 27 Sep 2026 04:31:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 7900 XTX 的可能性探索｜单卡篇（一）：daniel-mtp HIP build — 我目前实测最优的 Qwen3.8-27B Q4 + KV Q8 本地部署方案 on Sun, 27 Sep 2026 19:26:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry" aria-label="Profile: terry">@<bdi>terry</bdi></a> 特哥，第三篇发了 <a href="https://lcz.me/topic/1972">https://lcz.me/topic/1972</a></p>
]]></description><link>https://lcz.me/post/21192</link><guid isPermaLink="true">https://lcz.me/post/21192</guid><dc:creator><![CDATA[Ben Lee]]></dc:creator><pubDate>Sun, 27 Sep 2026 19:26:19 GMT</pubDate></item><item><title><![CDATA[Reply to 7900 XTX 的可能性探索｜单卡篇（一）：daniel-mtp HIP build — 我目前实测最优的 Qwen3.8-27B Q4 + KV Q8 本地部署方案 on Sun, 27 Sep 2026 04:39:46 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> 老特，这是我特调的底座，等我单卡篇（3），等你东山再起发大财<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60a.png?v=fe25256ab4a" class="not-responsive emoji emoji-android emoji--blush" style="height:1.4em;width:auto;vertical-align:middle" title=":blush:" alt="😊" /> <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f44d.png?v=fe25256ab4a" class="not-responsive emoji emoji-android emoji--+1" style="height:1.4em;width:auto;vertical-align:middle" title=":+1:" alt="👍" /></p>
]]></description><link>https://lcz.me/post/21088</link><guid isPermaLink="true">https://lcz.me/post/21088</guid><dc:creator><![CDATA[Ben Lee]]></dc:creator><pubDate>Sun, 27 Sep 2026 04:39:46 GMT</pubDate></item><item><title><![CDATA[Reply to 7900 XTX 的可能性探索｜单卡篇（一）：daniel-mtp HIP build — 我目前实测最优的 Qwen3.8-27B Q4 + KV Q8 本地部署方案 on Sun, 27 Sep 2026 04:34:42 GMT]]></title><description><![CDATA[<p dir="auto">可以 Q8KV的话单卡干活还挺好的，不过我还是觉得双卡TP，多会话长上下文爽点。单会话带一个ComfyUI跑Minimax H3也挺好。不用受我的感召，我没感召谁，我就是发视频赚钱<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f622.png?v=fe25256ab4a" class="not-responsive emoji emoji-android emoji--cry" style="height:1.4em;width:auto;vertical-align:middle" title="😢" alt="😢" /></p>
]]></description><link>https://lcz.me/post/21086</link><guid isPermaLink="true">https://lcz.me/post/21086</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sun, 27 Sep 2026 04:34:42 GMT</pubDate></item></channel></rss>