<?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 (RDNA3) 终极压榨：RoxxY 魔改分支 vs 原生 llama.cpp 交叉评测与 DFlash 调优避坑]]></title><description><![CDATA[<h1>【折腾实录】7900 XTX (RDNA3) 终极压榨：RoxxY 魔改分支 vs 原生 llama.cpp 交叉评测与 DFlash 调优避坑</h1>
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e0.png?v=9786174bac0" class="not-responsive emoji emoji-android emoji--hammer_and_wrench" style="height:23px;width:auto;vertical-align:middle" title="🛠" alt="🛠" />️ 硬件平台</h2>
<ul>
<li><strong>显卡</strong>: XFX Radeon RX 7900 XTX 24GB (ROCm 7.2.0 / gfx1100)</li>
<li><strong>CPU</strong>: Intel Xeon E5-2682 v4 × 2 (双路 32核64线程)</li>
<li><strong>内存</strong>: 64GB DDR4 REG ECC (四通道插满)</li>
<li><strong>系统</strong>: Ubuntu 24.04 LTS (Kernel 6.8.0)</li>
</ul>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f3bc.png?v=9786174bac0" class="not-responsive emoji emoji-android emoji--musical_score" style="height:23px;width:auto;vertical-align:middle" title="🎼" alt="🎼" /> 起因：魔改分支 RoxxY 真的能起飞吗？</h2>
<p dir="auto">最近在Reddit看到有开发者发布了针对 RDNA3（gfx1100，如 7900 XTX）优化 KV 缓存与 prefill 的魔改 llama.cpp 分支 —— <strong>RoxxY</strong> (tbq4-rdna3-experiment)。<br />
为了验证其真实含金量，我们在独立的沙盒中编译了 RoxxY，并与最新的原生 <code>llama.cpp</code> 进行了严格的交叉对比。所有测试均基于 <strong>Qwen3.6-27B</strong> 不同量化版模型，并且全部挂载 <code>numactl --cpunodebind=0 --membind=0</code> 锁定直连显卡的 NUMA Node 0 物理节点。</p>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4ca.png?v=9786174bac0" class="not-responsive emoji emoji-android emoji--bar_chart" style="height:23px;width:auto;vertical-align:middle" title="📊" alt="📊" /> 纯自回归（AR）性能交叉比对表</h2>
<p dir="auto"><em>(测试参数: -p 512,2048 -n 128 -fa 1 -r 1)</em></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:left">测试模型</th>
<th style="text-align:left">评测后端</th>
<th style="text-align:center">pp512 Prefill (t/s)</th>
<th style="text-align:center">pp2048 Prefill (t/s)</th>
<th style="text-align:center">tg128 Decode (tok/s)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>Model A (Q4_K_M)</strong>&lt;br&gt;<em>Huihui 去审查版</em></td>
<td style="text-align:left">原生 llama.cpp</td>
<td style="text-align:center"><strong>910.18</strong></td>
<td style="text-align:center"><strong>977.84</strong></td>
<td style="text-align:center">30.72</td>
</tr>
<tr>
<td style="text-align:left"></td>
<td style="text-align:left">RoxxY packed16</td>
<td style="text-align:center">907.72</td>
<td style="text-align:center">964.58</td>
<td style="text-align:center"><strong>31.97 (+4.06% <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f680.png?v=9786174bac0" class="not-responsive emoji emoji-android emoji--rocket" style="height:23px;width:auto;vertical-align:middle" title="🚀" alt="🚀" />)</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>Model B (IQ4_XS)</strong>&lt;br&gt;<em>128K 长文本版</em></td>
<td style="text-align:left">原生 llama.cpp</td>
<td style="text-align:center"><strong>382.35</strong></td>
<td style="text-align:center"><strong>391.83</strong></td>
<td style="text-align:center"><strong>39.79</strong></td>
</tr>
<tr>
<td style="text-align:left"></td>
<td style="text-align:left">RoxxY packed16</td>
<td style="text-align:center">377.45</td>
<td style="text-align:center">389.15</td>
<td style="text-align:center">38.86 (-2.33%)</td>
</tr>
<tr>
<td style="text-align:left"><strong>Model C (MTP 65层)</strong>&lt;br&gt;<em>自我投机版</em></td>
<td style="text-align:left">原生 llama.cpp</td>
<td style="text-align:center">863.21</td>
<td style="text-align:center"><strong>952.25</strong></td>
<td style="text-align:center">30.46</td>
</tr>
<tr>
<td style="text-align:left"></td>
<td style="text-align:left">RoxxY packed16</td>
<td style="text-align:center"><strong>868.57</strong></td>
<td style="text-align:center">929.67</td>
<td style="text-align:center"><strong>31.22 (+2.49%)</strong></td>
</tr>
</tbody>
</table>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f50d.png?v=9786174bac0" class="not-responsive emoji emoji-android emoji--mag" style="height:23px;width:auto;vertical-align:middle" title="🔍" alt="🔍" /> 核心结论 1：RoxxY 的 Prefill 优化“解密”</h3>
<p dir="auto">RoxxY 分支宣称的“针对 RDNA3 进行专门的 packed16 与 WMMA 算子重构，能极大地加速 Prefill”在我们的实测中并没有显现出超越最新原生 <code>llama.cpp</code> 的优势。在三大模型下，原生的 Prefill 速度与 RoxxY 几乎在同一个档次，原生甚至还微弱胜出 1% 左右。<br />
不过，在 Decode 阶段，RoxxY 的 packed16 格式在部分模型上确实能依靠底层 <code>rocm_packed16_dot4_mmq</code> 算子带来 <strong>2% ~ 4%</strong> 的微弱性能拉升。</p>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f50d.png?v=9786174bac0" class="not-responsive emoji emoji-android emoji--mag" style="height:23px;width:auto;vertical-align:middle" title="🔍" alt="🔍" /> 核心结论 2：先前原生 Mode B 被严重低估了</h3>
<p dir="auto">之前测试原生的 IQ4_XS（Mode B）Prefill 只有 251 t/s，本次测试证实，只要<strong>锁死 NUMA 物理核心（避免跨 CPU 通信）并强制开启 Flash Attention</strong>，原生的 pp512 速度当场就能飞到 <strong>382.35 t/s</strong>！并非原生不行，而是之前运行脚本未锁 NUMA 导致总线带宽成了瓶颈。</p>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=9786174bac0" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ DFlash 投机解码：双 4-bit KV 缓存的“稳定性陷阱”</h2>
<p dir="auto">很多小伙伴在使用 DFlash (Lucebox 架构) 榨取 7900 XTX 性能时，喜欢追求极限，开启 <code>--cache-type-k q4_0 --cache-type-v q4_0</code>（双 4-bit KV 压缩）。我们在 10 道 HumanEval 的 <code>bench_he.py</code> 测试中发现了致命的稳定性问题：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:left">DFlash KV 缓存配置</th>
<th style="text-align:center">Decode 速度 (tok/s)</th>
<th style="text-align:center">显存节省率</th>
<th style="text-align:left">稳定性表现</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>f16 K + f16 V</strong> (默认)</td>
<td style="text-align:center">100.83</td>
<td style="text-align:center">基准</td>
<td style="text-align:left">稳定</td>
</tr>
<tr>
<td style="text-align:left"><strong>q8_0 K + q4_0 V</strong> (推荐调音)</td>
<td style="text-align:center">95.74</td>
<td style="text-align:center">节省 60%+</td>
<td style="text-align:left"><strong>完美稳定</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>q4_0 K + q4_0 V</strong> (激进双4-bit)</td>
<td style="text-align:center"><strong>101.17</strong></td>
<td style="text-align:center">节省 75%+</td>
<td style="text-align:left"><strong>崩溃 (ROCm Abort -6)</strong> <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=9786174bac0" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /></td>
</tr>
</tbody>
</table>
<ul>
<li><strong>崩溃根因</strong>：激进的 <code>q4_0 K</code>（Key 缓存压缩至 4-bit）由于极致减少了显存读取带宽，在单次简单输出中确实能跑出 101.17 tok/s 的超快速度。但是在长文本或复杂的验证回滚树计算中，会稳定触发 ROCm 驱动底层 <code>hipStreamSynchronize</code> 的同步内存对齐异常，导致推理服务直接 Abort 闪退（exit code -6）。</li>
<li><strong>避坑推荐</strong>：<strong><code>q8_0 K + q4_0 V</code></strong> 是目前最完美的黄金甜点组合！10 道测试题全部稳稳通过，解码速度高达 <strong>95.74 tok/s</strong>，既省显存又避开闪退。</li>
</ul>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e0.png?v=9786174bac0" class="not-responsive emoji emoji-android emoji--hammer_and_wrench" style="height:23px;width:auto;vertical-align:middle" title="🛠" alt="🛠" />️ 最佳实践启动脚本分享</h2>
<h3>1. 模式 A (DFlash 极速黄金调音版)</h3>
<pre><code class="language-bash">#!/bin/bash
export LD_LIBRARY_PATH=/opt/rocm-7.2.0/lib:$LD_LIBRARY_PATH
export HSA_OVERRIDE_GFX_VERSION=11.0.0
cd /home/peter/lucebox-hub/dflash

# 锁死 NUMA 0，使用 q8_0 K + q4_0 V 黄金稳定版
nohup numactl --cpunodebind=0 --membind=0 python3 scripts/server.py \
  --target '/mnt/models/Qwen3.6/Huihui-Qwen3.6-27B-abliterated.Q4_K_M.gguf' \
  --draft models/dflash-draft-3.6-q8_0.gguf \
  --budget 8 --max-ctx 32768 --fa-window 0 \
  --cache-type-k q8_0 --cache-type-v q4_0 \
  --tokenizer Qwen/Qwen3.6-27B \
  --host 0.0.0.0 --port 11435 \
  &gt; /home/peter/llama-server-dflash.log 2&gt;&amp;1 &amp;
</code></pre>
<h3>2. 模式 B (原生 llama.cpp 长文本 128K 极速 Prefill 版)</h3>
<pre><code class="language-bash">#!/bin/bash
pkill -f "llama-server" 2&gt;/dev/null
sleep 1
export LD_LIBRARY_PATH=/home/peter/llama.cpp/build-rocm/bin:/opt/rocm-7.2.0/lib:$LD_LIBRARY_PATH
export HIP_VISIBLE_DEVICES=0
export HSA_OVERRIDE_GFX_VERSION=11.0.0

# 挂载 NUMA 0 绑定，强制 -fa 1 开启 Flash Attention，加入 --no-mmap 提升载入速度
setsid numactl --cpunodebind=0 --membind=0 /home/peter/llama.cpp/build-rocm/bin/llama-server \
  -m /mnt/models/Qwen3.6/Qwen3.6-27B-Uncensored-HauhauCS-Balanced-IQ4_XS.gguf \
  -c 131072 -ngl 99 \
  -fa 1 \
  --no-mmap \
  --tensor-split 0 \
  --cont-batching \
  --cache-type-k q4_0 --cache-type-v q4_0 \
  --host 0.0.0.0 --port 11435 \
  &gt; /home/peter/llama-server-iq4xs.log 2&gt;&amp;1 &amp;
</code></pre>
]]></description><link>https://lcz.me/topic/557/折腾实录-7900-xtx-rdna3-终极压榨-roxxy-魔改分支-vs-原生-llama.cpp-交叉评测与-dflash-调优避坑</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Jul 2026 23:29:52 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/557.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 Jun 2026 08:13:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 折腾实录】7900 XTX (RDNA3) 终极压榨：RoxxY 魔改分支 vs 原生 llama.cpp 交叉评测与 DFlash 调优避坑 on Mon, 15 Jun 2026 10:04:41 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> 明白的，我的数据都是实测的，只是测试过程跟文章都是ai写的而已<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=9786174bac0" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":disappointed:" alt="😞" /></p>
]]></description><link>https://lcz.me/post/6921</link><guid isPermaLink="true">https://lcz.me/post/6921</guid><dc:creator><![CDATA[abaalei]]></dc:creator><pubDate>Mon, 15 Jun 2026 10:04:41 GMT</pubDate></item><item><title><![CDATA[Reply to 折腾实录】7900 XTX (RDNA3) 终极压榨：RoxxY 魔改分支 vs 原生 llama.cpp 交叉评测与 DFlash 调优避坑 on Mon, 15 Jun 2026 07:29:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/abaalei" aria-label="Profile: abaalei">@<bdi>abaalei</bdi></a> 挺好的，穿插截图的意义是，版主和其它读者会很快确定你的文稿的真实性，因为太长了，大家不想看很久之后发现是AI写的。</p>
]]></description><link>https://lcz.me/post/6908</link><guid isPermaLink="true">https://lcz.me/post/6908</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Mon, 15 Jun 2026 07:29:40 GMT</pubDate></item><item><title><![CDATA[Reply to 折腾实录】7900 XTX (RDNA3) 终极压榨：RoxxY 魔改分支 vs 原生 llama.cpp 交叉评测与 DFlash 调优避坑 on Mon, 15 Jun 2026 03:02:29 GMT]]></title><description><![CDATA[<p dir="auto">多图杀猫~~<br />
哈哈 好久没说过这句话了<br />
<img src="https://upload.lcz.me/uploads/446e546f-72e6-478f-9997-d51b434de1fc.jpeg" alt="fa4f9bba-bad5-400c-a944-71518f4c330a-image.jpeg" class=" img-fluid img-markdown" /><br />
<img src="https://upload.lcz.me/uploads/6072d56e-31f9-468c-8320-6fb126c45557.jpeg" alt="39de8dcc-ff67-4ea2-bdf7-1688cea68056-image.jpeg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://lcz.me/post/6875</link><guid isPermaLink="true">https://lcz.me/post/6875</guid><dc:creator><![CDATA[abaalei]]></dc:creator><pubDate>Mon, 15 Jun 2026 03:02:29 GMT</pubDate></item><item><title><![CDATA[Reply to 折腾实录】7900 XTX (RDNA3) 终极压榨：RoxxY 魔改分支 vs 原生 llama.cpp 交叉评测与 DFlash 调优避坑 on Mon, 15 Jun 2026 03:00:13 GMT]]></title><description><![CDATA[<p dir="auto">好的版主，虽然全场都是agent操作，我啥都看不明白，就随便贴点agent的思考过程吧<br />
<img src="https://upload.lcz.me/uploads/3244f787-c5ec-4d5d-bef0-89bb610e15f9.jpeg" alt="0796d1ae-25a4-43c9-b68c-7f3a18e8eda0-image.jpeg" class=" img-fluid img-markdown" /><br />
<img src="https://upload.lcz.me/uploads/f11f47a2-6efe-4583-958c-ebb816b39dab.jpeg" alt="71b7010e-6a6c-42b9-93e1-5d17ee645309-image.jpeg" class=" img-fluid img-markdown" /><br />
<img src="https://upload.lcz.me/uploads/e10f10ae-34c5-4e46-811e-807723cc005a.jpeg" alt="02f64e29-3af1-41a5-8796-31e85dbde7f6-image.jpeg" class=" img-fluid img-markdown" /><br />
<img src="https://upload.lcz.me/uploads/1b005ece-4475-40a8-904a-35f15d1fc284.jpeg" alt="8387e25c-e677-4e70-9302-1751a4f61b0c-image.jpeg" class=" img-fluid img-markdown" /><br />
<img src="https://upload.lcz.me/uploads/fb89d9d1-cfc6-4de3-85f7-6c025e0a096a.jpeg" alt="5bae4714-9809-4eea-82e6-2bcd934dee1d-image.jpeg" class=" img-fluid img-markdown" /><br />
<img src="https://upload.lcz.me/uploads/cb1bf8a3-bf35-4b89-a66d-767fd020f0d4.jpeg" alt="f61e0bb2-d420-455b-92ea-6c8837ab8141-image.jpeg" class=" img-fluid img-markdown" /><br />
<img src="https://upload.lcz.me/uploads/52010a9e-52dd-487f-8071-8250f355822e.jpeg" alt="b28a3c66-e3ab-4a8b-99c2-40b71351bf0b-image.jpeg" class=" img-fluid img-markdown" /><br />
<img src="https://upload.lcz.me/uploads/25bdd133-ec80-4f16-a8dd-7b167e6638ad.jpeg" alt="a68cee74-4be2-484b-920d-655bdd9de953-image.jpeg" class=" img-fluid img-markdown" /><br />
<img src="https://upload.lcz.me/uploads/2f0899f5-a7fd-455f-9bdf-42c2b2102381.jpeg" alt="0583c969-403a-4bdc-b33d-5e150f561ff7-image.jpeg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://lcz.me/post/6874</link><guid isPermaLink="true">https://lcz.me/post/6874</guid><dc:creator><![CDATA[abaalei]]></dc:creator><pubDate>Mon, 15 Jun 2026 03:00:13 GMT</pubDate></item><item><title><![CDATA[Reply to 折腾实录】7900 XTX (RDNA3) 终极压榨：RoxxY 魔改分支 vs 原生 llama.cpp 交叉评测与 DFlash 调优避坑 on Sun, 14 Jun 2026 11:21:39 GMT]]></title><description><![CDATA[<p dir="auto">补充下截图，很有意义</p>
]]></description><link>https://lcz.me/post/6818</link><guid isPermaLink="true">https://lcz.me/post/6818</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sun, 14 Jun 2026 11:21:39 GMT</pubDate></item><item><title><![CDATA[Reply to 折腾实录】7900 XTX (RDNA3) 终极压榨：RoxxY 魔改分支 vs 原生 llama.cpp 交叉评测与 DFlash 调优避坑 on Sun, 14 Jun 2026 10:25:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ye9ok" aria-label="Profile: ye9ok">@<bdi>ye9ok</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/566656661" aria-label="Profile: 566656661">@<bdi>566656661</bdi></a> FA支持情况补充一下：</p>
<p dir="auto">RDNA3 (7900 XTX, gfx1100) 的 FA 支持取决于你用什么后端：</p>
<p dir="auto"><strong>ROCm/HIP 路线</strong>（RoxxY魔改分支就是走这条路）：</p>
<ul>
<li>ROCm 6.x 通过 hipFlashAttn 官方支持 FA2（flash_attn &gt;= 2.0 在 ROCm 上已经可用）</li>
<li>但注意：hipFlashAttn 目前只支持 FA2，不支持 FA3（那是 Hopper 架构专属）</li>
<li>在 RoxxY / llama.cpp ROCm 后端下，只要编译时启用了 <code>-DLLAMA_HIPBLAS=ON</code>，FA 是正常生效的</li>
<li>不过 RDNA3 的 FA 效率不如 NVIDIA：实测 7900 XTX 开 FA 大约能省 15-20% 显存，速度提升约 10-15%</li>
</ul>
<p dir="auto"><strong>Vulkan 路线</strong>：</p>
<ul>
<li>FA 目前确实不支持 Vulkan 后端</li>
<li>所以如果用原生 llama.cpp 的 Vulkan 后端（<code>-ngl N -ngv vulkan</code>），是打不开 FA 的</li>
<li>这也是 RoxxY 魔改分支（基于 ROCm）比原生 Vulkan 版本在某些场景下更快的原因之一——不仅仅是驱动优化，FA 带来的 attention 计算加速也是一个因素</li>
</ul>
<p dir="auto">简单总结：RDNA3 开 FA 可行，但仅限于 ROCm/HIP 后端。如果走 Vulkan 路线，确实没有 FA。</p>
]]></description><link>https://lcz.me/post/6816</link><guid isPermaLink="true">https://lcz.me/post/6816</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Sun, 14 Jun 2026 10:25:35 GMT</pubDate></item><item><title><![CDATA[Reply to 折腾实录】7900 XTX (RDNA3) 终极压榨：RoxxY 魔改分支 vs 原生 llama.cpp 交叉评测与 DFlash 调优避坑 on Sun, 14 Jun 2026 10:35:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ye9ok" aria-label="Profile: ye9ok">@<bdi>ye9ok</bdi></a></p>
<p dir="auto">FA官方是寫有支持的, 不過那是基於ROCm跟HIP</p>
<p dir="auto">Reddit上面倒是沒寫Vulkan有支持FA, 先當作沒有？</p>
]]></description><link>https://lcz.me/post/6803</link><guid isPermaLink="true">https://lcz.me/post/6803</guid><dc:creator><![CDATA[566656661]]></dc:creator><pubDate>Sun, 14 Jun 2026 10:35:47 GMT</pubDate></item><item><title><![CDATA[Reply to 折腾实录】7900 XTX (RDNA3) 终极压榨：RoxxY 魔改分支 vs 原生 llama.cpp 交叉评测与 DFlash 调优避坑 on Sun, 14 Jun 2026 08:54:30 GMT]]></title><description><![CDATA[<p dir="auto">rdna3到底支不支持Flash Attention？俺咋记得打不开</p>
]]></description><link>https://lcz.me/post/6798</link><guid isPermaLink="true">https://lcz.me/post/6798</guid><dc:creator><![CDATA[ye9ok]]></dc:creator><pubDate>Sun, 14 Jun 2026 08:54:30 GMT</pubDate></item></channel></rss>