<?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[单张 RTX 5060 Ti Ubuntu 上运行 Qwen3.8-Flash-Next（UD-Q4_K_XL，192K 上下文）的完整调优记录]]></title><description><![CDATA[<h1>Basalt 调优报告 — 2026-11-12</h1>
<p dir="auto">本机在单张 RTX 5060 Ti 上运行 Qwen3.8-Flash-Next（UD-Q4_K_XL，192K 上下文）的完整调优记录：<br />
从 23 t/s 的基线到 55 t/s 的最终结果，以及调优过程中对内存与磁盘行为的两个有趣发现。</p>
<hr />
<h2>1. 硬件与软件</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>组件</th>
<th>规格</th>
</tr>
</thead>
<tbody>
<tr>
<td>CPU</td>
<td>2 × Intel Xeon E5-2673 v3 @ 2.40 GHz（12 核 × 2，共 48 线程，2 个 NUMA 节点；<strong>无 AVX-512</strong>，专家内核走 AVX-2）</td>
</tr>
<tr>
<td>内存</td>
<td>125.7 GiB</td>
</tr>
<tr>
<td>GPU</td>
<td>NVIDIA RTX 5060 Ti 16 GB（Blackwell / sm_120，驱动 580.178.04）</td>
</tr>
<tr>
<td>磁盘</td>
<td>TEAM T253512GB，512 GB SATA SSD</td>
</tr>
<tr>
<td>系统</td>
<td>Ubuntu 24.04，内核 7.0.0-42-generic，x86_64</td>
</tr>
</tbody>
</table>
<p dir="auto">软件：Basalt 引擎 <strong>0.3.2</strong>（2026-11-08 从源码构建）+ Python server（<code>serve/</code>），在 <code>127.0.0.1:8080</code> 提供 OpenAI / Anthropic / Responses 三种 API，<code>basalt-vision</code> sidecar 负责图像输入。</p>
<h2>2. 模型信息</h2>
<p dir="auto"><strong>Qwen3.8-Flash-Next（MoE）— UD-Q4_K_XL 量化包</strong></p>
<ul>
<li>模型文件 <code>models/Qwen3.8-FN-UD-Q4_K_XL.basalt</code>：<strong>115.3 GB</strong>（107.4 GiB），<code>.basalt</code> v2 格式</li>
<li>加载：76.9 GiB / 189 s —— 显存专家层 12.9 GiB + 内存专家层 64.0 GiB，<strong>全部专家驻留</strong>（无 SSD 冷层）</li>
<li>运行配置：上下文 <strong>192,000</strong>，KV 缓存 <code>q4_0</code>（&gt;32K 部分弹性伸缩），<code>spec 8</code> 投机解码，grammar 约束输出，单槽并发</li>
</ul>
<h2>3. 调优过程</h2>
<p dir="auto">当天日志显示：<strong>60–80K 上下文档位解码只有 ~23 t/s</strong>，专家缓存命中率仅 50%，且前缀恢复成本随深度上升。对比 Strata 的 192K 日志（0.1.59，<code>STRATA_ROUTE_TAIL_SKIP=7</code>）后发现 Basalt 缺少这几个开关，逐一实测（每次用 <code>--restart</code> 重启服务端，按相同深度分段对比）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>配置</th>
<th style="text-align:right">60K+ 深度解码</th>
<th style="text-align:right">专家命中率</th>
<th>结论</th>
</tr>
</thead>
<tbody>
<tr>
<td>无开关（基线）</td>
<td style="text-align:right"><strong>23 t/s</strong></td>
<td style="text-align:right">~50%</td>
<td>起点</td>
</tr>
<tr>
<td><code>--route-tail-skip 7</code></td>
<td style="text-align:right"><strong>27.5 t/s</strong>（+20%）</td>
<td style="text-align:right">—</td>
<td>保留</td>
</tr>
<tr>
<td><code>--route-tail-skip 7</code> + <code>--route-prior 1.5</code></td>
<td style="text-align:right"><strong>55 t/s</strong>（约 2 倍）</td>
<td style="text-align:right">85%+</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=3c59dda5525" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✅" alt="✅" /> 核心收益</td>
</tr>
<tr>
<td><code>--route-prior 1.5</code> + <code>--relaxed-drafting 0.5</code></td>
<td style="text-align:right">47 t/s</td>
<td style="text-align:right">85.5%</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=3c59dda5525" class="not-responsive emoji emoji-android emoji--x" style="height:1.4em;width:auto;vertical-align:middle" title="❌" alt="❌" /> 变慢，已移除</td>
</tr>
</tbody>
</table>
<p dir="auto">各参数要点：</p>
<ul>
<li><code>--route-tail-skip 7</code>：跳过权重排名靠后、且无 GPU 层持有的专家——这台"会 miss 专家的卡"正是它的设计目标。</li>
<li><code>--route-prior 1.5</code>（本次最大收益）：被持有的专家在选择时相当于概率放大 e^1.5 ≈ 4.5 倍，miss 大幅减少。官方质量门实测过 1.5/7 组合（PPL 代价个位数百分比），λ 往上（16）质量崩塌式变差，1.5 是文档推荐的甜点值。</li>
<li><code>--relaxed-drafting 0.5</code>：更激进地接受草稿 token；实测 55 → 47 t/s（工具调用型请求不吃这个 flag），已移除。</li>
<li><code>expert-profile-save</code>（<code>data/profiles/qwen4exp-192k.prof</code>，196 KB）：专家适配结果每 10 分钟落盘，重启后热专家排布免费暖启动。</li>
</ul>
<h2>4. 最终结果</h2>
<p dir="auto">最终配置（写入 <code>basalt_config_192k.json</code>）：</p>
<pre><code class="language-json">"route-tail-skip": 7,
"route-prior": 1.5,
"expert-profile-save": "data/profiles/qwen4exp-192k.prof"
</code></pre>
<p dir="auto"><strong>对比强调</strong>：从基线 23 t/s → 稳态 <strong>50–55 t/s，深度解码提升约 2.4 倍</strong>。UI 仪表盘现场验证：76.6K 上下文时解码 52.5 tok/s、单请求峰值 71.3 t/s，专家命中率 87%；会话首次突破 <strong>148K 真实上下文，50+ t/s</strong>，约为同深度 Strata（0.1.59）的两倍——"深度衰减"问题彻底消失。</p>
<h2>5. 有趣的发现</h2>
<h3>5.1 模型文件为什么比加载量大 30 GiB？</h3>
<p dir="auto">直接解析文件头（18 个 section）：71.7 GiB 专家全部进入显存+内存层；差额主要在 <code>gguf</code> 段（32.0 GiB）里的 <strong>PLE n-gram 表 <code>per_layer_token_embd.weight</code>（IQ4_NL，26.8 GiB）</strong>。Basalt 默认 <code>--ple-io direct</code>：这张表<strong>留在 SSD 上，每次生成 token 按 4 KiB 行级直读</strong>，不进引擎内存。另有 0.85 GiB 的 vision 投影器由 sidecar 原位读取。所以"文件 107.4 GiB、加载 76.9 GiB"是设计行为，不是异常。</p>
<h3>5.2 磁盘读写的真凶</h3>
<p dir="auto">运行中的 Basalt 进程 4 小时磁盘读 <strong>~25.6 GiB（约 6 GB/h）</strong>、写仅 3 MB（profile 落盘）——读全部来自 PLE 直读。对照之下这正是 <strong>Strata 运行时无磁盘读、且内存多占 ~28 GiB 的原因</strong>：Strata 默认在 RAM 装得下时把整张 n-gram 表锁进 RAM（<code>STRATA_PLE_AUTO_RAM</code>），也解释了之前"Strata 113 GiB vs Basalt 84.8 GiB"的差值。对 SSD 寿命而言读不占 TBW 写入预算，~50 TB/年的读率完全可忽略；若想消除这部分读流量，可改 <code>--ple-io ram</code>（本机还有 ~39 GiB 余量可用）。</p>
]]></description><link>https://lcz.me/topic/3022</link><generator>RSS for Node</generator><lastBuildDate>Thu, 19 Nov 2026 00:44:34 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/3022.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 Nov 2026 02:22:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 单张 RTX 5060 Ti Ubuntu 上运行 Qwen3.8-Flash-Next（UD-Q4_K_XL，192K 上下文）的完整调优记录 on Fri, 13 Nov 2026 22:49:00 GMT]]></title><description><![CDATA[<p dir="auto">明年我們論壇上應該會有很多 5060 Ti 16G 使用者 也是甜品卡之一</p>
]]></description><link>https://lcz.me/post/33144</link><guid isPermaLink="true">https://lcz.me/post/33144</guid><dc:creator><![CDATA[kos or]]></dc:creator><pubDate>Fri, 13 Nov 2026 22:49:00 GMT</pubDate></item><item><title><![CDATA[Reply to 单张 RTX 5060 Ti Ubuntu 上运行 Qwen3.8-Flash-Next（UD-Q4_K_XL，192K 上下文）的完整调优记录 on Fri, 13 Nov 2026 20:30:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kos-or" aria-label="Profile: kos-or">@<bdi>kos-or</bdi></a><br />
现在偶尔就会破100 tok/s. Basalt面板上显示 "Single slot · Best 113.8 tok/s"</p>
]]></description><link>https://lcz.me/post/33128</link><guid isPermaLink="true">https://lcz.me/post/33128</guid><dc:creator><![CDATA[San Han]]></dc:creator><pubDate>Fri, 13 Nov 2026 20:30:51 GMT</pubDate></item><item><title><![CDATA[Reply to 单张 RTX 5060 Ti Ubuntu 上运行 Qwen3.8-Flash-Next（UD-Q4_K_XL，192K 上下文）的完整调优记录 on Fri, 13 Nov 2026 20:25:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/holy-wen" aria-label="Profile: Holy-Wen">@<bdi>Holy-Wen</bdi></a><br />
速度上快一点但是精度可能差一点.有空试一下.</p>
]]></description><link>https://lcz.me/post/33127</link><guid isPermaLink="true">https://lcz.me/post/33127</guid><dc:creator><![CDATA[San Han]]></dc:creator><pubDate>Fri, 13 Nov 2026 20:25:08 GMT</pubDate></item><item><title><![CDATA[Reply to 单张 RTX 5060 Ti Ubuntu 上运行 Qwen3.8-Flash-Next（UD-Q4_K_XL，192K 上下文）的完整调优记录 on Fri, 13 Nov 2026 09:04:16 GMT]]></title><description><![CDATA[<p dir="auto">RTX 50 Blackwell系列用 Basalt 直接起飛 , 5060 Ti 16G Decode 55 tok/s 都很夠用了<br />
玩ComfyUI也舒服, 漲價前一張 RMB$4000 CP值高</p>
<p dir="auto">說不定2027年底前 5060 Ti 16G Decode 會破100 tok/s <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60d.png?v=3c59dda5525" class="not-responsive emoji emoji-android emoji--heart_eyes" style="height:1.4em;width:auto;vertical-align:middle" title=":heart_eyes:" alt="😍" /></p>
]]></description><link>https://lcz.me/post/33014</link><guid isPermaLink="true">https://lcz.me/post/33014</guid><dc:creator><![CDATA[kos or]]></dc:creator><pubDate>Fri, 13 Nov 2026 09:04:16 GMT</pubDate></item><item><title><![CDATA[Reply to 单张 RTX 5060 Ti Ubuntu 上运行 Qwen3.8-Flash-Next（UD-Q4_K_XL，192K 上下文）的完整调优记录 on Fri, 13 Nov 2026 08:43:38 GMT]]></title><description><![CDATA[<p dir="auto">跑NVFP4的模型是不是更好？</p>
]]></description><link>https://lcz.me/post/33009</link><guid isPermaLink="true">https://lcz.me/post/33009</guid><dc:creator><![CDATA[Holy Wen]]></dc:creator><pubDate>Fri, 13 Nov 2026 08:43:38 GMT</pubDate></item></channel></rss>