<?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[【实测】7900xt单卡 + Avalon + qwen4-35b-a3b调优结果，单流480K长上下文prefill最高5000+ decode 120+，多路聚合decode最大271]]></title><description><![CDATA[<h2>配置</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项目</th>
<th>配置</th>
</tr>
</thead>
<tbody>
<tr>
<td>CPU</td>
<td>Intel Xeon E5-2686 v4（18 核 36 线程，2.3 GHz 基频）</td>
</tr>
<tr>
<td>内存</td>
<td>64 GB DDR3-1600 REG ECC（4×16 GB 四通道）</td>
</tr>
<tr>
<td>显卡</td>
<td>Radeon RX 7900 XT 20 GB（gfx1100，RDNA3）</td>
</tr>
<tr>
<td>主板 / 总线</td>
<td>华南X99-TF，PCIe 3.0 x16（实测 H2D 12.7 GB/s）</td>
</tr>
<tr>
<td>系统盘</td>
<td>NVMe SSD，Ubuntu 24.04.5 LTS</td>
</tr>
<tr>
<td>计算栈</td>
<td>ROCm 10.2（TheRock 用户态解包，不装 amdgpu-dkms，走内核自带 amdgpu）</td>
</tr>
<tr>
<td>推理引擎</td>
<td><a href="https://github.com/freriadoc/Avalon" rel="nofollow ugc">Avalon</a>（llama.cpp 派生）<code>0.8.0-dev</code>，commit <code>fb78456</code></td>
</tr>
<tr>
<td>模型</td>
<td><a href="https://huggingface.co/freriadoc/Qwen4-35B-A3B-Avalon-GGUF" rel="nofollow ugc">Qwen4-35B-A3B-Avalon-GGUF</a> IQ4K，39.13 GB，5.09 bpw，MTP 头（单独文件，非该仓库）：<a href="https://huggingface.co/ggml-org/Qwen4-35B-A3B-GGUF" rel="nofollow ugc">https://huggingface.co/ggml-org/Qwen4-35B-A3B-GGUF</a></td>
</tr>
<tr>
<td>上下文长度设置</td>
<td>480K，<strong>Avalon 的 QSA 选择器硬上限是 491,520</strong>（<code>qsa_tiles_max_kv = 480&lt;&lt;10</code>），超过就 <code>GGML_ASSERT</code> 崩。所以 <code>-c 500K</code> 只是“允许分配”，<strong>真正 500K 的请求仍然跑不了</strong>，实际可用上限还是 480K 左右。</td>
</tr>
</tbody>
</table>
<h2>单路测试内容</h2>
<blockquote>
<p dir="auto">太长不读：基于ARM指令集手册生成用于测试128k、256k、512k上下文的文本，在读入文本后进行追问，并让模型进行较长回答，这样可以比较精确地测量decode的性能。测试结果均经过warm up轮后采样。</p>
</blockquote>
<h3>材料</h3>
<p dir="auto">单一长文档，避免跨主题干扰：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>值</th>
</tr>
</thead>
<tbody>
<tr>
<td>来源</td>
<td>Arm Architecture Reference Manual for A-profile（DDI0487H.a），69 MB PDF</td>
</tr>
<tr>
<td>抽取</td>
<td><code>pdftotext -layout</code>，保留列对齐</td>
</tr>
<tr>
<td>总量</td>
<td>37,036,255 字符 / 7,681,697 token</td>
</tr>
<tr>
<td>切片</td>
<td>按 token 精确截断取前缀：120K、240K、480K</td>
</tr>
</tbody>
</table>
<h3>题库（查证能力，防“长上下文退化”）</h3>
<p dir="auto">每档 8 题，全部从切片正文中人工选题、机器校验：</p>
<ul>
<li>6 道单问：答案分别落在文档深度 <strong>~5%、~30%、~50%、~70%、~95%</strong> 附近，覆盖“开头/中段/尾部”；</li>
<li>2 组两轮追问：第 2 问必须依赖第 1 问的答案（如“某地址定义 marked block → 该地址哪些位定义它”）；</li>
<li>校验方式：每题 evidence 必须在切片中<strong>唯一命中</strong>、逐字一致，answer 必须是 evidence 的子串。</li>
</ul>
<h3>速度探针（长输出 decode）</h3>
<p dir="auto">QA 题的答案太短（6–96 token），decode 会被首 token 延迟污染。因此另设 4 道<strong>解释型</strong>问题，强制长输出：</p>
<ol>
<li>interprocessing model 是什么、为什么存在、AArch64/AArch32 如何切换；</li>
<li><code>ID_AA64ISAR2_EL1.PAC_frac</code> 的作用、<code>FEAT_CONSTPACFIELD</code> 改变了什么；</li>
<li><code>SPSR_ELx.SSBS</code> 的含义、与 <code>PSTATE.SSBS</code> 的关系、Armv8.0–8.4 软件该怎么做；</li>
<li>为什么是 31 个通用寄存器、X30/SP/XZR 的特殊性及调用约定后果。</li>
</ol>
<p dir="auto">每题生成 <strong>384 token</strong>、greedy、不截断，取 3 次中位；<strong>每题的首次请求作为 warm-up，不计入</strong>。</p>
<h3>补的空白上下文测试</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>提示</th>
<th>生成</th>
<th>decode</th>
<th>接受率</th>
</tr>
</thead>
<tbody>
<tr>
<td>“介绍什么是超标量处理器”</td>
<td>512 token</td>
<td><strong>127.4 t/s</strong></td>
<td>61%</td>
</tr>
<tr>
<td>“解释什么是虚拟内存”</td>
<td>512 token</td>
<td><strong>128.3 t/s</strong></td>
<td>58%</td>
</tr>
</tbody>
</table>
<h2>测试设置</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>值</th>
</tr>
</thead>
<tbody>
<tr>
<td>请求路径</td>
<td>HTTP <code>/completion</code>，<code>temperature 0</code>，<code>cache_prompt true</code></td>
</tr>
<tr>
<td>上下文</td>
<td><code>-c 262144</code>、<code>-np 1</code>（500K 档改为 <code>-c 524288</code>）</td>
</tr>
<tr>
<td>KV</td>
<td><code>-ctk q8_0 -ctv q4_0</code>，draft KV <code>-ctkd/-ctvd q8_0</code></td>
</tr>
<tr>
<td>批处理</td>
<td><code>-b 16384 -ub 16384</code></td>
</tr>
<tr>
<td>专家</td>
<td><code>-cmoe --moe-cache auto</code>，PLE <code>-ot per_layer_token_embd=CPU</code></td>
</tr>
<tr>
<td>投机</td>
<td><code>--spec-type draft-mtp --spec-draft-n-max 2</code></td>
</tr>
<tr>
<td>线程</td>
<td><code>-t 32</code></td>
</tr>
<tr>
<td>采样</td>
<td>greedy（<code>temperature 0</code>）</td>
</tr>
<tr>
<td>报告口径</td>
<td>prefill/decode 取 3 次中位；warm-up 剔除；同时记录 draft 接受率、专家池驻留数、KV 与剩余显存</td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto">说明：decode 数字全部来自“预热后、缓存命中、连续 384 token”的稳态段，不包含冷启动 prefill 与首 token 延迟。</p>
</blockquote>
<h3>实验结果</h3>
<p dir="auto">启动参数固定为 <code>-ngl 99 -cmoe --moe-cache auto -fa on -c 524288 -np 1 -ctk q8_0 -ctv q4_0 -b/-ub 16384 --spec-type draft-mtp --spec-draft-n-max 2 -ot per_layer_token_embd=CPU</code>。测量分两段：先在空上下文下问两个常识问题、各生成 512 token，标定“无上下文”时的 decode 上限；同一服务不重启，依次发送 120K、240K、480K 三段，后两段是前一段的严格前缀，靠 <code>cache_prompt</code> 复用 KV，于是每段只 prefill 新增的那部分，记录真实的 prefill token 数、prefill 速率、墙钟和随后 384 token 的生成速率与 draft 接受率。所有请求贪心解码（<code>temperature 0, top_k 1</code>），480K 档另用该深度处的 6 道编码表题核对，答案全部逐字命中。</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>档位</th>
<th>累计上下文</th>
<th>本次新 prefill</th>
<th>prefill t/s</th>
<th>prefill 墙钟</th>
<th>生成 token</th>
<th>decode t/s</th>
<th>接受率</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>空上下文</strong></td>
<td>~30</td>
<td>29 / 35</td>
<td>—（无意义）</td>
<td>—</td>
<td>512</td>
<td><strong>128.3 / 127.4</strong></td>
<td>58% / 61%</td>
</tr>
<tr>
<td>① 120K</td>
<td>120K</td>
<td>120,000</td>
<td><strong>5,003</strong></td>
<td>28.1 s</td>
<td>384</td>
<td>98.6</td>
<td>63%</td>
</tr>
<tr>
<td>② 240K</td>
<td>240K</td>
<td>120,004（前缀命中）</td>
<td><strong>4,694</strong></td>
<td>29.1 s</td>
<td>384</td>
<td>121.5</td>
<td>75%</td>
</tr>
<tr>
<td>③ 480K</td>
<td>480K</td>
<td>240,004（前缀命中）</td>
<td><strong>4,179</strong></td>
<td>61.8 s</td>
<td>384</td>
<td>107.7</td>
<td>71%</td>
</tr>
<tr>
<td>③' 480K 长生成</td>
<td>480K</td>
<td>—（复用）</td>
<td>—</td>
<td>—</td>
<td>400</td>
<td><strong>114.7</strong></td>
<td>80%</td>
</tr>
</tbody>
</table>
<h2>多路测试内容</h2>
<blockquote>
<p dir="auto">基于水浒传小说文本生成切片，并在头部插入随机数使得kv cache无法复用，测试多路下的decode吞吐量。在多路下mtp意义不大，因此关闭mtp以释放更多vram</p>
<p dir="auto">这个实验是先做的，单路用arm手册的实验是后面想出来的</p>
</blockquote>
<h3>公共参数（所有并发实验）</h3>
<pre><code>模型: Qwen4-35B-A3B-Avalon IQ4K（39.13 GB）+ MTP 头 Q8_0（2.0 GB）
-ngl 99 -cmoe --moe-cache auto -fa on
-ctk q8_0 -ctv q4_0          # k8v4
-ot per_layer_token_embd=CPU # PLE 钉 CPU
--load-mode mmap --lazy-mode on
-t 32
</code></pre>
<h2>各档参数</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>实验</th>
<th>并发/上下文</th>
<th>关键参数</th>
<th>MTP</th>
</tr>
</thead>
<tbody>
<tr>
<td>4 槽崩溃组</td>
<td><code>-np 4</code>，4×65,536</td>
<td><code>-c 262144 -b 4096 -ub 4096</code>（<code>-ub 16384</code> 起不来：compute pp buffer 分配失败）</td>
<td>开：<code>--spec-type draft-mtp --spec-draft-n-max 2 -ctkd q8_0 -ctvd q8_0</code></td>
</tr>
<tr>
<td>2 槽</td>
<td><code>-np 2</code></td>
<td>短 prompt（512 token 生成），其余同上</td>
<td>开，同上</td>
</tr>
<tr>
<td>8 槽</td>
<td><code>-np 8</code>，8×32K</td>
<td><code>-c 262144</code>；<code>-b/-ub</code> 我不确定是 16384 还是被 np 整除的值（当时没有专门记录）</td>
<td><strong>关</strong></td>
</tr>
<tr>
<td>5 槽</td>
<td><code>-np 5</code>，5×100K</td>
<td><code>-c 512000 -b 2560 -ub 2560</code>（<code>-b</code> 必须能被 <code>-np</code> 整除，否则加载期 <code>GGML_ASSERT(ggml_can_repeat)</code>）</td>
<td>关</td>
</tr>
<tr>
<td>4×128K</td>
<td><code>-np 4</code>，4×131,072</td>
<td><code>-c 524288</code></td>
<td>关</td>
</tr>
</tbody>
</table>
<p dir="auto">MTP 关（并发场景的可用配置）</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>并发</th>
<th>每槽上下文</th>
<th>每路 decode</th>
<th>聚合</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>8 槽</td>
<td>32K</td>
<td>38.8（热）</td>
<td><strong>271</strong></td>
<td>冷态 242.6；KV 3.27 GB、专家池 4,611/7,304</td>
</tr>
<tr>
<td>5 槽</td>
<td>100K</td>
<td>49.6（热）</td>
<td><strong>224.6</strong></td>
<td><code>-c 512000 -b/-ub 2560</code></td>
</tr>
<tr>
<td>4 槽</td>
<td>128K</td>
<td>54.4（热）</td>
<td><strong>197</strong></td>
<td><code>-c 524288</code>，KV 5.77 GB</td>
</tr>
</tbody>
</table>
<p dir="auto">MTP 开（帖子同款：<code>--spec-type draft-mtp --spec-draft-n-max 2</code>）</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>并发</th>
<th>上下文/槽</th>
<th>每路 decode</th>
<th>聚合</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>1 槽</td>
<td>64K 左右</td>
<td>102.7</td>
<td>102.7</td>
<td>单流基线</td>
</tr>
<tr>
<td>2 槽</td>
<td>短 prompt（512 token 生成）</td>
<td>~72.9</td>
<td><strong>145.7</strong></td>
<td>2 路真实重叠，有收益</td>
</tr>
<tr>
<td>4 槽</td>
<td>长 prompt（水浒传切片）</td>
<td>33.2 / 36.0 / 37.2</td>
<td><strong>106.4</strong></td>
<td>只有 3 路跑起来</td>
</tr>
<tr>
<td>4 槽</td>
<td>满 4 路长 prompt</td>
<td>—</td>
<td><strong>崩溃</strong></td>
<td>5 次里崩 4 次</td>
</tr>
</tbody>
</table>
<p dir="auto">崩溃细节：<code>common_speculative_impl_draft_mtp::draft</code> → <code>get_sub_batch: failed to add token 1100646382 at index 2 (error -2, n = 4)</code>（token id 越界，词表只有 15 万），随后 <code>ggml_abort</code>；服务进程还在、<code>/health</code> 200，但请求永久挂起，只能 <code>kill -9</code>。</p>
<h2>附赠：本机测试过的其他引擎+模型量化组合</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>引擎</th>
<th>模型</th>
<th>prefill</th>
<th>decode</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>llama.cpp</strong>（qwen4exp b13023）</td>
<td>Qwen4 IQ3_S</td>
<td>2,952 @短</td>
<td>78（MTP n=3 → 124.6）</td>
<td>4 路聚合 149.5</td>
</tr>
<tr>
<td><strong>llama.cpp</strong></td>
<td>Qwen3.8-27B IQ3_S(+MTP)</td>
<td>1,142 @125K</td>
<td>43</td>
<td>第一次在 20GB 上跑 27B</td>
</tr>
<tr>
<td><strong>Strata</strong>（0.1.74.1）</td>
<td>Qwen4 IQ4_XS</td>
<td>2,025 @64K</td>
<td>105</td>
<td>命中 87–90%；<code>--kv-grow</code> 变 3,514/77.2</td>
</tr>
<tr>
<td><strong>Strata</strong></td>
<td>Qwen4 Q3_K_XL</td>
<td>2,105 @64K</td>
<td>81.6</td>
<td>全专家驻留时 2,158/134.2</td>
</tr>
<tr>
<td><strong>PolyStrata / KVMem</strong>（poly.10）</td>
<td>Qwen4 Q3_K_XL</td>
<td>1,956–2,158 @64K</td>
<td>132.8–134.5</td>
<td><strong>支持1M 上下文：944K → 1,907/123.6</strong></td>
</tr>
<tr>
<td><strong>rdna-boosts</strong>（r432）</td>
<td>Qwen4 Q3_K_XL</td>
<td>2,037 @128K</td>
<td>52.6–76.7</td>
<td>4×131K 聚合 79</td>
</tr>
<tr>
<td><strong>Radiance</strong>（v2.5.0）</td>
<td>Qwen3.8-27B iq4r-l</td>
<td>1,141 @948</td>
<td>61.7–79.7</td>
<td>静态图；Qwen4 缺内核跑不了</td>
</tr>
<tr>
<td><strong>Avalon</strong>（fb78456 + ROCm 10.2）</td>
<td>Qwen4 IQ4K</td>
<td><strong>128K 5,025 / 256K 4,840 / 480K 4,511</strong></td>
<td><strong>125.3 / 123.6 / 114.7</strong></td>
<td>当前主力；单流、MTP n=2</td>
</tr>
</tbody>
</table>
]]></description><link>https://lcz.me/topic/3589</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Dec 2026 22:17:00 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/3589.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 Dec 2026 03:33:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 【实测】7900xt单卡 + Avalon + qwen4-35b-a3b调优结果，单流480K长上下文prefill最高5000+ decode 120+，多路聚合decode最大271 on Sun, 06 Dec 2026 06:37:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/colt" aria-label="Profile: Colt">@<bdi>Colt</bdi></a> 实验过程中最高40多g，32g可以砍上下文长度试试</p>
]]></description><link>https://lcz.me/post/38261</link><guid isPermaLink="true">https://lcz.me/post/38261</guid><dc:creator><![CDATA[kasperis7]]></dc:creator><pubDate>Sun, 06 Dec 2026 06:37:31 GMT</pubDate></item><item><title><![CDATA[Reply to 【实测】7900xt单卡 + Avalon + qwen4-35b-a3b调优结果，单流480K长上下文prefill最高5000+ decode 120+，多路聚合decode最大271 on Sun, 06 Dec 2026 05:49:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kasperis7" aria-label="Profile: kasperis7">@<bdi>kasperis7</bdi></a> 请问Avalon+Qwen4 IQ4K， 内存用了多少？ 我是32G内存，不知道是否可以跑。</p>
]]></description><link>https://lcz.me/post/38247</link><guid isPermaLink="true">https://lcz.me/post/38247</guid><dc:creator><![CDATA[Colt]]></dc:creator><pubDate>Sun, 06 Dec 2026 05:49:12 GMT</pubDate></item></channel></rss>