<?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[3080 Ti 12GB：Linux + 新版引擎 + 四轮 A/B 调参 + 会话缓存，Qwen3.8-Flash-Next-IQ3_S 跑到 192–195 tok/s prefill 2,500]]></title><description><![CDATA[<h1>3080 Ti 单卡 12GB 跑 Strata / Qwen3.8 Flash-Next：IQ3_S 与 111GB UD-Q4_K_XL 双档实测，Linux 服务器四轮 A/B 调参全记录</h1>
<h2>先看张图（服务自带的监控面板）</h2>
<p dir="auto">(<br />
<img src="https://upload.lcz.me/uploads/f3d55041-37fb-4642-8d61-02d9cb3c950f.png" alt="9ab42e30dcd0b001501d0abbcd841e44.png" class="img-markdown  img-fluid" /><br />
图片地址)<br />
这台是 <strong>Linux 服务器</strong>，面板上几个关键数字：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>面板上的数字</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Decode 153.6 / Prefill 2,394</strong></td>
<td>一条正在生成的长回复的实时速度（IQ3_S 档，12,685 tokens 进行中）</td>
</tr>
<tr>
<td><strong>VRAM 11.9 / 12 GB · GPU load 99% · 297W / 350W · 76℃</strong></td>
<td>显存吃满，显卡满载，温度和功耗都温和</td>
</tr>
<tr>
<td><strong>Experts cached 2,523 — 4.8 GB</strong></td>
<td>显存里缓存的专家槽位（对比 @cc tgo 帖的 2,451 槽 / 3.3 GB：槽位数相近，但他那台是 IQ2_XS，专家单个更小）</td>
</tr>
<tr>
<td><strong>PCIe Gen3 ×16 · to GPU 1,643 MB/s</strong></td>
<td>和那位楼主一样，这条 PCIe 就是 MoE 的真实通道；生成高峰期实测搬运 9.8~12.5 GB/s，基本跑满</td>
</tr>
<tr>
<td><strong>Disk read 0.1 MB/s</strong></td>
<td>模型进内存后不读硬盘（UD-Q4_K_XL 档我们也专门测过：<strong>32K prompt 盘读 0.0 GB</strong>）</td>
</tr>
<tr>
<td><strong>System RAM 99.2 / 121 GB</strong></td>
<td>121 GB 内存是这套玩法的真正底气：全部专家 + KV 后备都在内存里</td>
</tr>
<tr>
<td><strong>Context fill 6%（15K / 256K）</strong></td>
<td>上下文给了 <strong>262,144</strong>，面板这一时刻才用了 6%</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>Recent requests 那张表比速度数字更能说明问题</strong>（都是当天真实 agent 负载）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>时间</th>
<th style="text-align:right">PROMPT</th>
<th style="text-align:right">REUSED</th>
<th style="text-align:right">OUTPUT</th>
<th style="text-align:right">PREFILL T/S</th>
<th style="text-align:right">DECODE T/S</th>
<th style="text-align:right">HIT RATE</th>
<th style="text-align:right">耗时</th>
</tr>
</thead>
<tbody>
<tr>
<td>19:06:20</td>
<td style="text-align:right">17,442</td>
<td style="text-align:right"><strong>17,382</strong></td>
<td style="text-align:right">120</td>
<td style="text-align:right">88</td>
<td style="text-align:right">101.5</td>
<td style="text-align:right">76.9%</td>
<td style="text-align:right"><strong>1.9s</strong></td>
</tr>
<tr>
<td>19:04:40</td>
<td style="text-align:right">2,531</td>
<td style="text-align:right">0</td>
<td style="text-align:right">13,449</td>
<td style="text-align:right">141</td>
<td style="text-align:right"><strong>162.9</strong></td>
<td style="text-align:right">94.5%</td>
<td style="text-align:right">100.1s</td>
</tr>
<tr>
<td>19:04:22</td>
<td style="text-align:right">16,404</td>
<td style="text-align:right">0</td>
<td style="text-align:right">779</td>
<td style="text-align:right"><strong>1,555</strong></td>
<td style="text-align:right">111.0</td>
<td style="text-align:right">88.3%</td>
<td style="text-align:right">17.7s</td>
</tr>
<tr>
<td>19:01:54</td>
<td style="text-align:right">2,542</td>
<td style="text-align:right">2,537</td>
<td style="text-align:right">9,007</td>
<td style="text-align:right"><strong>1</strong></td>
<td style="text-align:right">142.1</td>
<td style="text-align:right">93.4%</td>
<td style="text-align:right">67.8s</td>
</tr>
<tr>
<td>18:58:08</td>
<td style="text-align:right"><strong>126,171</strong></td>
<td style="text-align:right"><strong>126,135</strong></td>
<td style="text-align:right">265</td>
<td style="text-align:right">145</td>
<td style="text-align:right">122.9</td>
<td style="text-align:right">88.4%</td>
<td style="text-align:right"><strong>11.1s</strong></td>
</tr>
</tbody>
</table>
<ul>
<li><code>PREFILL T/S = 1</code> 那一行：几乎整个 prompt 都是缓存回放，读 1.6 万 token 只花几毫秒。</li>
<li><strong>126,171 个 token 的 prompt，复用 126,135，整条请求 11.1 秒</strong>——这就是 conversation cache（会话缓存）的意义：停放的会话不用重新读一遍，直接「热启动」。</li>
<li>@cc tgo 帖子面板上 <code>REUSED 全是 0、HIT RATE 只有 58~60%</code>，他自己说这是「后面可以优化的地方」——我们这套恰好在这点上做了功课（见第七节）。</li>
</ul>
<hr />
<h2>一、电脑硬件与系统软件</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项目</th>
<th>配置</th>
</tr>
</thead>
<tbody>
<tr>
<td>操作系统</td>
<td><strong>Ubuntu Linux</strong>（服务器常开，systemd 服务）</td>
</tr>
<tr>
<td>CPU</td>
<td>Intel Xeon <strong>E5-2696 v3</strong>，18 核 36 线程，Haswell-EP</td>
</tr>
<tr>
<td>系统内存</td>
<td><strong>121 GB DDR3-1866 四通道</strong>（≈74.6 GB/s）</td>
</tr>
<tr>
<td>显卡</td>
<td><strong>RTX 3080 Ti 12GB</strong>，PCIe <strong>Gen3 ×16</strong>（实测 H2D ≈12.5 GB/s）</td>
</tr>
<tr>
<td>硬盘</td>
<td>NVMe，顺序读 ≈2.5 GB/s（模型加载后基本不参与）</td>
</tr>
<tr>
<td>推理引擎</td>
<td>Strata fork（Speedy，serve 层 0.5.4 / <strong>engine 0.1.53</strong>），编译开 <code>STRATA_NATIVE_EXPERTS=ON</code>、<code>STRATA_MMQ_KQUANTS=ON</code></td>
</tr>
<tr>
<td>模型档 A</td>
<td>Qwen3.8 Flash-Next <strong>IQ3_S</strong>（54.8 GB，双分片 + BF16 mmproj 走 CPU 做 vision）</td>
</tr>
<tr>
<td>模型档 B</td>
<td>Qwen3.8 Flash-Next <strong>UD-Q4_K_XL</strong>（4 分片共 <strong>111.33 GB</strong>，SHA-256 全部校验）</td>
</tr>
<tr>
<td>上下文</td>
<td><strong>262,144 tokens</strong>，KV <code>int8</code></td>
</tr>
</tbody>
</table>
<h2>二、模型与量化选择</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>量化</th>
<th style="text-align:right">体积</th>
<th>我们的态度</th>
</tr>
</thead>
<tbody>
<tr>
<td>IQ2_XS</td>
<td style="text-align:right">39.2 GB</td>
<td>64GB 内存机的选择（楼主在用，合理）</td>
</tr>
<tr>
<td><strong>IQ3_S</strong></td>
<td style="text-align:right">54.8 GB</td>
<td><strong>主力日常档</strong>：速度快、质量稳</td>
</tr>
<tr>
<td><strong>UD-Q4_K_XL</strong></td>
<td style="text-align:right">111.33 GB</td>
<td><strong>质量优先档</strong>：dense 侧全 Q8_0、专家 down 是 Q5_1</td>
</tr>
<tr>
<td>Q4_K_M（原版）</td>
<td style="text-align:right">~110 GB</td>
<td>试过后删了：down 层 Q5_0 组合在引擎里 unsupported，且总体不如 UD</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>UD-Q4_K_XL 的量化分布（拆 GGUF tensor 实测）</strong>：路由专家 gate/up 是 Q4_K（第 2 层是 Q5_K），<strong>down 投影 43 层是 Q5_1、5 层是 Q8_0</strong>；attention/SSM/hyper-connections/shared expert/PLE key/token embedding/output head <strong>全部 Q8_0</strong>；PLE n-gram 大表是 <strong>IQ4_NL（26.82 GiB）</strong>。专家合计 <strong>71.7 GiB</strong>。</p>
<p dir="auto"><strong>关于「纸面 ppl 接近、实际差很多」</strong>：论坛流传 IQ3_S 与 Q4_K_XL「纸面只差一点、实践差很多」的说法。我们拿两种量化在同样样本上对比过输出分布：纸面 ppl 只差 <strong>0.7%</strong>（4.068 vs 4.097），但同 top-token 一致率是 <strong>93.09% vs 87.69%</strong>、平均 KL <strong>0.056 vs 0.144</strong>（差 2.6 倍）、KL p99 <strong>0.829 vs 1.975</strong>（差 2.4 倍）。<strong>分布差距远大于 ppl 暗示的差距——ppl 接近 ≠ 输出接近，选量化不要只看这一个数。</strong></p>
<h2>三、它凭什么能在 12GB 显存上跑 111GB 的模型</h2>
<p dir="auto">和楼主帖一样是三层分工（厨房比喻就不重复了），但我们在「储藏间」这一层多做了两件事：</p>
<ol>
<li><strong>全部专家 page-locked 常驻内存</strong>：<code>--resident-budget-gib 72</code> 把 UD 的 71.1 GiB 专家<strong>全部锁页</strong>在 DDR3 里，CPU 直接原地算，<strong>生成全程盘读 0.0 GB</strong>。这是硬前提——我们老板的条件是「专家要放到 SSD 的话就没必要试了」，实测确实不落地。</li>
<li><strong>lend region（借出区）全命中</strong>：引擎会留一批「借给 GPU 的槽位」，budget 72 时 <strong>1031 / 1031 个 lendable 槽位的专家也都在内存里</strong>，需要从盘读的冷文件集只剩 <strong>0.3 GiB</strong>（页缓存轻松装下）。budget 给到 64 时 lend 区是 0/1046 命中、冷文件集 7.2 GiB——也能跑但差一档，所以我们最终定 72。</li>
<li>显存里则放「每个词都躲不开的活」+ <strong>learned expert profile</strong>（边跑边学哪些专家热，QUIT 时自动写回 <code>--expert-profile-save</code>，下次启动直接带上学到的路由）。</li>
</ol>
<p dir="auto">投机解码同样开着：<code>--spec 4 --mtp ... --mtp-q4 all</code>（MTP 草稿量化成 Q4 更省）。</p>
<h2>四、安装与踩坑（四个，都挺费时间）</h2>
<ol>
<li><strong>UD 文件必须先做 pack</strong>：<code>iq_pack.py --gguf &lt;shard1&gt; --compat-bf16</code>。<code>--compat-bf16</code> 对 Unsloth 的 UD 文件<strong>必须开</strong>（实测 195 个张量被舍入，最大误差 0.0144）。另外这脚本要用仓库 venv 里的 python（numpy 只装在 venv 里），系统 python 直接 <code>ModuleNotFoundError</code>。</li>
<li><strong><code>--resident-budget-gib</code> 隐含 resident 模式，必须配一个静态 expert-profile</strong>，否则引擎直接退出：<code>--resident-cpu-experts requires --mmap-experts and a static --expert-profile</code>。首次用 <code>tools/make_profile.py --no-base --n-expert 512</code> 生成种子文件即可。</li>
<li><strong>SHA-256 校验 111GB 要开并行</strong>：单线程 <code>sha256sum -c</code> 要 25 分钟，4 个分片并行算只要 ~6 分钟。别串行等。</li>
<li><strong>杀进程后显存残留会坑下一次启动</strong>：残留的引擎进程没退干净时，新启动会报 <code>cudaMalloc ... for the weight arena failed (out of memory)</code>——<strong>这不是配置错、更不是 KV 格式错</strong>，纯粹是显存没释放。我们的切换脚本现在会等 <code>nvidia-smi</code> 显示 VRAM &lt; 100 MiB 再起服务，稳如老狗。</li>
</ol>
<h2>五、配置与四轮 A/B 调参（这是本帖最硬核的一节）</h2>
<p dir="auto">统一测试口径（和 @cc tgo 帖的「冷 prefill」可互相换算）：</p>
<ul>
<li>decode：2K prompt / 400 tokens 生成 / 3 次取中位数；</li>
<li>prefill 墙钟：同长度两档 <strong>28,623 / 108,611 tokens</strong>（<code>vram_bench.py --tiers 16000,60000</code>）。</li>
</ul>
<h3>5.1 IQ3_S：四轮共 30 个方案的 A/B 记录</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>轮次</th>
<th>方案</th>
<th style="text-align:right">28K wall</th>
<th style="text-align:right">108K wall</th>
<th>结论</th>
</tr>
</thead>
<tbody>
<tr>
<td>opt</td>
<td>int8 基线</td>
<td style="text-align:right">22.62</td>
<td style="text-align:right">71.07</td>
<td>基线（默认配置）</td>
</tr>
<tr>
<td>opt</td>
<td>k8v4</td>
<td style="text-align:right">22.64</td>
<td style="text-align:right">71.08</td>
<td>无差异</td>
</tr>
<tr>
<td>opt</td>
<td>per-layer expert cache</td>
<td style="text-align:right">22.62</td>
<td style="text-align:right">68.92</td>
<td>无差异</td>
</tr>
<tr>
<td>opt</td>
<td>THP</td>
<td style="text-align:right">22.27</td>
<td style="text-align:right">68.37</td>
<td>微弱</td>
</tr>
<tr>
<td>opt</td>
<td>lookup/suffix</td>
<td style="text-align:right">22.68</td>
<td style="text-align:right">70.88</td>
<td>无差异</td>
</tr>
<tr>
<td><strong>opt2</strong></td>
<td><strong>prefill auto:16384 / 32768</strong></td>
<td style="text-align:right"><strong>17.62</strong></td>
<td style="text-align:right"><strong>51.55</strong></td>
<td><strong>+25%，第一个大收益</strong></td>
</tr>
<tr>
<td>opt3</td>
<td>reserve 300</td>
<td style="text-align:right">18.77</td>
<td style="text-align:right">50.60</td>
<td>有效</td>
</tr>
<tr>
<td>opt3</td>
<td>best+THP</td>
<td style="text-align:right">17.55</td>
<td style="text-align:right">51.06</td>
<td>有效</td>
</tr>
<tr>
<td><strong>opt4</strong></td>
<td><strong>auto:32768 + THP + reserve 300（最终）</strong></td>
<td style="text-align:right"><strong>18.40</strong></td>
<td style="text-align:right"><strong>48.19</strong></td>
<td>采用</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>从基线到最终：108K prompt 从 71 秒 → 48.2 秒（-32%）。</strong> 两个大项：<code>--prefill auto:16384/32768</code>（+25%）和 <code>--vram-reserve-mib 300</code>（默认档太保守，300 让显存多装 ~150 个专家槽）。其余十几个旋钮——k8v4、per-layer cache、fixed prefill、suffix lookup——<strong>全部无效或微弱</strong>，扫一遍就知道边界了。</p>
<h3>5.2 UD-Q4_K_XL：7 个变体的 A/B</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>#</th>
<th>配置</th>
<th style="text-align:right">专家槽</th>
<th style="text-align:right">chunk</th>
<th style="text-align:right">28K wall</th>
<th style="text-align:right"><strong>108K wall</strong></th>
<th style="text-align:right">decode 2K</th>
<th style="text-align:right">VRAM 空闲</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>reserve 768, prefill auto:8192</td>
<td style="text-align:right">1243</td>
<td style="text-align:right">7424</td>
<td style="text-align:right">28.94</td>
<td style="text-align:right">105.93</td>
<td style="text-align:right">155.7</td>
<td style="text-align:right">631 MiB</td>
</tr>
<tr>
<td>2</td>
<td>reserve 768, prefill auto:16384</td>
<td style="text-align:right">—</td>
<td style="text-align:right">7424</td>
<td style="text-align:right"><strong>OOM 被杀</strong></td>
<td style="text-align:right">—</td>
<td style="text-align:right">—</td>
<td style="text-align:right">—</td>
</tr>
<tr>
<td>3</td>
<td>reserve 768, prefill auto:32768</td>
<td style="text-align:right">1243</td>
<td style="text-align:right">7424</td>
<td style="text-align:right">28.91</td>
<td style="text-align:right">105.85</td>
<td style="text-align:right">156.1</td>
<td style="text-align:right">631 MiB</td>
</tr>
<tr>
<td>4</td>
<td><strong>reserve 300</strong></td>
<td style="text-align:right">1401</td>
<td style="text-align:right">8704</td>
<td style="text-align:right">29.43</td>
<td style="text-align:right"><strong>95.15</strong></td>
<td style="text-align:right">158.7</td>
<td style="text-align:right">149 MiB <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=2bf455356c3" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️</td>
</tr>
<tr>
<td>5</td>
<td>reserve 300 + KV_PREFETCH=1</td>
<td style="text-align:right">1401</td>
<td style="text-align:right">8704</td>
<td style="text-align:right">29.53</td>
<td style="text-align:right">95.23</td>
<td style="text-align:right"><strong>147.5</strong></td>
<td style="text-align:right">149 MiB</td>
</tr>
<tr>
<td>6</td>
<td>reserve 512</td>
<td style="text-align:right">1328</td>
<td style="text-align:right">8192</td>
<td style="text-align:right">31.49</td>
<td style="text-align:right">97.35</td>
<td style="text-align:right">157.2</td>
<td style="text-align:right">365 MiB</td>
</tr>
<tr>
<td>7</td>
<td><strong>reserve 300（复测）</strong></td>
<td style="text-align:right">1401</td>
<td style="text-align:right">8704</td>
<td style="text-align:right">30.18</td>
<td style="text-align:right"><strong>95.14</strong></td>
<td style="text-align:right">156.9</td>
<td style="text-align:right">149 MiB</td>
</tr>
</tbody>
</table>
<p dir="auto">三个要点：</p>
<ol>
<li><strong><code>--vram-reserve-mib 300</code> 是 UD 上唯一的大项</strong>：108K 从 105.9s → 95.1s（-10.2%），机制同样是槽位 1243→1401、chunk 7424→8704。代价是 VRAM 只剩 149 MiB（引擎会警告 "requests may stall"），实测不崩、可复现；怕崩还有个 reserve 768 的保守档。</li>
<li><strong><code>--prefill auto:N</code> 在 UD 上无效</strong>：专家 71.7 GiB 太大，引擎自己就把 chunk 封顶在 7424~8704，给 16384/32768 都不理（给 16384 那次还被 OOM 杀了）。<strong>这和 IQ3_S 正好相反</strong>——同一颗旋钮在不同量化档位上效果完全不同，所以调参必须按档重扫，抄不来。</li>
<li><strong><code>STRATA_KV_PREFETCH=1</code> 无效</strong>：长 prompt 没变化（95.23 vs 95.15），decode 还掉 7%（158.7→147.5）。这种文档上写着 +1.5% 的旋钮，实测不认账就别开。</li>
</ol>
<h3>5.3 上下文与 KV 格式的选择</h3>
<ul>
<li><strong>k8v4 试过不要</strong>：262K ctx 下能跑通，但专家槽反而更少（UD：1133 vs int8 的 1243），KV pin 内存还省一点（2.39 vs 3.09 GiB），综合不划算。</li>
<li><strong>q4_0 更别碰</strong>：省是省，困惑度 +8~12%。</li>
<li>最终两档都是 <code>--kv int8</code> + <code>--kv-resident</code>（KV 流式驻留、其余放 pinned RAM）。<strong>262,144 的上下文我们真跑过 108,611 token 的单条 prompt</strong>，不是标称值。</li>
</ul>
<h2>六、实测速度（两档全量数据）</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指标</th>
<th style="text-align:right">IQ3_S（日常档）</th>
<th style="text-align:right">UD-Q4_K_XL（质量档）</th>
<th style="text-align:right">@cc tgo 帖（IQ2_XS 参考）</th>
</tr>
</thead>
<tbody>
<tr>
<td>decode（短中上下文，中位数）</td>
<td style="text-align:right"><strong>192–195</strong></td>
<td style="text-align:right"><strong>156.9–158.7</strong></td>
<td style="text-align:right">48.0（固定短测）/ 63.4（引擎自报均）</td>
</tr>
<tr>
<td>decode @ ~100K+ 长上下文</td>
<td style="text-align:right">90–98</td>
<td style="text-align:right">81–87 @47K</td>
<td style="text-align:right">—</td>
</tr>
<tr>
<td><strong>28,623 token prompt</strong></td>
<td style="text-align:right"><strong>18.40s</strong>（≈1,556 tok/s）</td>
<td style="text-align:right"><strong>30.18s</strong>（≈948 tok/s）</td>
<td style="text-align:right">25,547 tok ≈ 20.6s（≈1,238 tok/s）</td>
</tr>
<tr>
<td><strong>108,611 token prompt</strong></td>
<td style="text-align:right"><strong>48.19s</strong>（≈2,253 tok/s）</td>
<td style="text-align:right"><strong>95.14s</strong>（≈1,142 tok/s）</td>
<td style="text-align:right">—（32K 就到顶了，测不了）</td>
</tr>
<tr>
<td>专家缓存命中率</td>
<td style="text-align:right">88.6%</td>
<td style="text-align:right">82–97%</td>
<td style="text-align:right">58–60%（HIT RATE）</td>
</tr>
<tr>
<td>模型加载 / 服务启动</td>
<td style="text-align:right"><strong>~8 秒</strong></td>
<td style="text-align:right">110–125 秒（锁 72 GiB 的代价）</td>
<td style="text-align:right">~20 秒</td>
</tr>
<tr>
<td>生成时 PCIe 搬运</td>
<td style="text-align:right">~12 GB/s 跑满</td>
<td style="text-align:right">~12 GB/s 跑满</td>
<td style="text-align:right">9.8~12 GB/s 跑满</td>
</tr>
<tr>
<td>生成时盘读</td>
<td style="text-align:right">0.0 MB/s</td>
<td style="text-align:right"><strong>0.0 GB / 32K prompt</strong></td>
<td style="text-align:right">0.0 MB/s</td>
</tr>
</tbody>
</table>
<p dir="auto">口径说明：我们的 decode 中位数与楼主的「短提示固定测」同类可互比；prefill 墙钟按 tokens÷秒换算即可互相加减。UD 档的 prefill 吞吐（948~1,142）<strong>低于</strong>楼主那台的 1,238——这是事实，模型大 2.8 倍、dense 侧全 Q8_0，读的速度自然慢；但 decode 和上下文两项仍全面压制。</p>
<h2>七、上下文与会话缓存：「REUSED 全是 0」的问题</h2>
<p dir="auto">我们开 <code>--conversation-cache-mib 40960 --conversation-cache-slots 16</code>（UD 档 12288 MiB / 8 slots），加上 <code>--prompt-cache 12</code>：</p>
<ul>
<li><strong>停放的会话整段 KV 留在内存里</strong>，下次回来直接热启动——面板上那条 <strong>126,171 prompt / 复用 126,135 / 全程 11.1 秒</strong>就是现场证据；</li>
<li><code>--conversation-cache-min-tokens 4096</code> 让短对话不占坑，16 个槽位全是「值得留」的会话；</li>
<li>效果就是面板上 <code>REUSED</code> 不再是 0，agent 多轮任务的重复回喂基本免单。</li>
</ul>
<h2>八、调用方式与安全</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>方式</th>
<th>结果</th>
</tr>
</thead>
<tbody>
<tr>
<td>网页面板 Monitor 页</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2714.png?v=2bf455356c3" class="not-responsive emoji emoji-android emoji--heavy_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✔" alt="✔" /></td>
</tr>
<tr>
<td>OpenAI 兼容 <code>/v1/chat/completions</code>（带 api key）</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2714.png?v=2bf455356c3" class="not-responsive emoji emoji-android emoji--heavy_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✔" alt="✔" />，常用机上的 harness 直接挂 LAN 地址调用</td>
</tr>
<tr>
<td>vision（图片输入）</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2714.png?v=2bf455356c3" class="not-responsive emoji emoji-android emoji--heavy_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✔" alt="✔" />，BF16 mmproj 放 CPU 跑</td>
</tr>
<tr>
<td>流式 SSE / function calling</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2714.png?v=2bf455356c3" class="not-responsive emoji emoji-android emoji--heavy_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✔" alt="✔" /></td>
</tr>
</tbody>
</table>
<p dir="auto">和「反向隧道」的玩法不同：服务器常开、只听内网 + key 保护，客户端不需要维护一条 ssh；关掉浏览器窗口不影响服务。两种都干净，看环境选。</p>
<h2>九、一键切换两个模型档</h2>
<p dir="auto"><code>sudo strata-model</code>，一条命令换模型：</p>
<pre><code>strata-model iq3      # 切到 IQ3_S（日常最快，启动 ~8s）
strata-model ud       # 切到 UD-Q4_K_XL（质量优先，启动 ~2 分钟）
strata-model ud-safe  # UD + reserve 768（显存留 631 MiB 的保险档）
strata-model status   # 看当前挂的是哪档
</code></pre>
<p dir="auto">脚本会改 systemd 的环境变量、杀干净旧进程、<strong>等 VRAM 释放到 &lt;100 MiB 再起服务</strong>、轮询 <code>/health</code> 直到模型就绪（48×5s），超时会自动回滚到上一个可用配置。以前「停不下来 / 起不来」的坑就是这么填平的。</p>
<h2>十、和 @cc tgo 帖的正面对比（同一块卡，两种平台）</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th></th>
<th style="text-align:right">他（i9-9900X / Win11 / 64GB DDR4 / IQ2_XS / ctx 32K）</th>
<th style="text-align:right">我们（E5-2696v3 / Linux / 121GB DDR3 / IQ3_S·UD-Q4_K_XL / ctx 256K）</th>
</tr>
</thead>
<tbody>
<tr>
<td>decode</td>
<td style="text-align:right">63.4（引擎自报均）/ 48.0 固定测</td>
<td style="text-align:right"><strong>192–195</strong>（IQ3_S）→ <strong>3.0×</strong></td>
</tr>
<tr>
<td>冷 prefill</td>
<td style="text-align:right">1,238 tok/s</td>
<td style="text-align:right">1,556~2,253（IQ3_S）→ 1.3~1.8×；UD 948~1,142 → <strong>低于他</strong></td>
</tr>
<tr>
<td>上下文上限</td>
<td style="text-align:right">32,768（实测 26.3K 就到顶，28K 直接 400）</td>
<td style="text-align:right"><strong>262,144</strong>（108K prompt 实测 48s）→ <strong>8×</strong></td>
</tr>
<tr>
<td>端到端同任务</td>
<td style="text-align:right">15K入+14K出 = <strong>235~244s</strong></td>
<td style="text-align:right">换算约 <strong>85s</strong> → <strong>2.8×</strong></td>
</tr>
<tr>
<td>模型质量</td>
<td style="text-align:right">IQ2_XS（最轻档）</td>
<td style="text-align:right">高一到两档（IQ3_S / UD-Q4_K_XL）</td>
</tr>
<tr>
<td>缓存复用</td>
<td style="text-align:right">REUSED=0，HIT 58~60%</td>
<td style="text-align:right">conversation cache，126K prompt 复用 126K</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>差距是怎么来的（也先说他的优势）</strong>：</p>
<ul>
<li><strong>他的优势</strong>：内存带宽 115 GB/s 比我们高 53%；IQ2_XS 模型小加载快。</li>
<li><strong>我们的来源，按贡献排序</strong>：① 引擎版本——他 0.1.38（10月），我们 fork 的 0.1.53 带 MMQ K-quant 内核、native experts、MTP-Q4；② <strong>Linux vs Windows</strong>（WDDM 常驻吃显存 + 驱动调度开销）；③ 调参深度——四轮 30 方案 A/B 扫出来的 prefill 大 chunk 与 reserve 300 两个大项他还没做；④ 36 线程对 20 线程（CPU 算专家的路径吃线程）。</li>
<li><strong>一句话： decode 约 3×、端到端约 2.8×、上下文 8×，外加量化档位高一到两档。</strong> 而且这还是在内存带宽输给他的情况下做到的。</li>
</ul>
<h2>十一、局限与后续</h2>
<ul>
<li>UD 档<strong>启动要 110–125 秒</strong>（锁 72 GiB 内存），IQ3_S 只要 ~8 秒——日常还是 IQ3_S。</li>
<li>reserve 300 时 VRAM 只剩 <strong>149 MiB</strong>，引擎会警告 stall；真遇到就切 <code>ud-safe</code>。</li>
<li>UD 档还有三个旋钮没扫：<code>--expert-cache-per-layer</code>、<code>--kv-grow</code>、<code>STRATA_PROMPT_ATTN_IMMA</code>（IQ3_S 上前两个测过是无差异/微弱，UD 值得补一轮）。</li>
<li>MTP 草稿接受率没有像楼主那样单独统计过口径，下次对照。</li>
<li>长上下文 decode 会衰减：IQ3_S @108K 约 90–98 tok/s（短上下文的 192 打折），这是 PCIe 搬运 + KV 读取的联合成本，两档都一样。</li>
</ul>
<h2>一句话总结</h2>
<blockquote>
<p dir="auto"><strong>同一块 3080 Ti 12GB：Linux + 新版引擎 + 四轮 A/B 调参 + 会话缓存，能让 54.8GB 的 IQ3_S 跑到 192–195 tok/s、108K prompt 48 秒读完；还能把 111GB 的 UD-Q4_K_XL 全专家锁进内存（盘读 0.0 GB）跑出 157 tok/s。上下文 262K，比 32K 到顶的方案宽 8 倍。</strong></p>
<p dir="auto">项目地址：<a href="https://github.com/Niko1221/Strata" rel="nofollow ugc">Niko1221/Strata</a>（我们跑的是其 fork：DevDock-AI/Speedy，engine 0.1.53）</p>
</blockquote>
]]></description><link>https://lcz.me/topic/3377</link><generator>RSS for Node</generator><lastBuildDate>Sun, 29 Nov 2026 03:01:59 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/3377.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 28 Nov 2026 11:47:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 3080 Ti 12GB：Linux + 新版引擎 + 四轮 A/B 调参 + 会话缓存，Qwen3.8-Flash-Next-IQ3_S 跑到 192–195 tok/s prefill 2,500 on Sun, 29 Nov 2026 02:42:49 GMT]]></title><description><![CDATA[<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=2bf455356c3" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✅" alt="✅" /> 版主审定：本帖设为<strong>优秀</strong>，作者 <strong>+3 积分</strong>奖励，继续加油！</p>
<blockquote>
<p dir="auto">奖励凭证：优秀 +3 分 · 编号 e3377-4999-1</p>
</blockquote>
]]></description><link>https://lcz.me/post/36383</link><guid isPermaLink="true">https://lcz.me/post/36383</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Sun, 29 Nov 2026 02:42:49 GMT</pubDate></item><item><title><![CDATA[Reply to 3080 Ti 12GB：Linux + 新版引擎 + 四轮 A/B 调参 + 会话缓存，Qwen3.8-Flash-Next-IQ3_S 跑到 192–195 tok/s prefill 2,500 on Sun, 29 Nov 2026 01:28:43 GMT]]></title><description><![CDATA[<p dir="auto">一定要顶上去，我已让我的OPENCLAW来认真研读 学习了</p>
]]></description><link>https://lcz.me/post/36373</link><guid isPermaLink="true">https://lcz.me/post/36373</guid><dc:creator><![CDATA[九门奇人]]></dc:creator><pubDate>Sun, 29 Nov 2026 01:28:43 GMT</pubDate></item><item><title><![CDATA[Reply to 3080 Ti 12GB：Linux + 新版引擎 + 四轮 A/B 调参 + 会话缓存，Qwen3.8-Flash-Next-IQ3_S 跑到 192–195 tok/s prefill 2,500 on Sun, 29 Nov 2026 01:27:26 GMT]]></title><description><![CDATA[<p dir="auto">追更补充几个刚测出来的底层硬核发现和勘误（同机 RTX 4070 Ti Super 16GB + 96GB DDR4 + 256K 上下文）：</p>
<ol>
<li>抓出一个极隐蔽的 Launcher 覆写坑（user_args 才是权威）：</li>
</ol>
<p dir="auto">查源码（strata_control/drafting.py）和 /proc/&lt;pid&gt;/cmdline 发现两件事：第一，在 --draft dflash2 模式下，launcher 会自动剥离所有 --mtp-q4 等 MTP 专属参数（之前误算在它头上的提速全来自 --spec 步数增加）；第二，每次启动 launcher 都会用 window_for() 把 --spec 悄悄改回默认值 6（配置文件的 "args" 看着是 7 或 8，实际运行进程里却是 6）！</p>
<p dir="auto">解法：必须在配置 JSON 里显式加上 "user_args": ["--spec", "8"] 才能锁住引擎上限 8（非 Blackwell 16GB 卡默认不给 8，手动锁 8 后计数探针又涨了 +3%～4%）。</p>
<ol start="2">
<li>锁死 --spec 8 + GPU 功耗墙放宽到 250W 后的最新定版成绩：</li>
</ol>
<p dir="auto">计数探针（98% 接受率）：2K 308.7 tok/s / 32K 282.6 tok/s（较 220W 初始基线提升 +25% / +16%）。</p>
<p dir="auto">随机内容冷测（abbench，无前缀复用）：2K 145.8 / 32K 142.5 / 100K 138.2 tok/s，100K 冷预填 TTFT 34.60 s，16K 套件 Prefill 2284.1 tok/s（TTFT 7.21s），sanity 12/12。</p>
<ol start="3">
<li>内存带宽扰动 &amp; 长文预填的“反直觉”实测：</li>
</ol>
<p dir="auto">开后台进程吃掉 ~10 GB/s 内存带宽后，Decode 速率完全不变（-0.5% / +0.6%），证明 97.5% 显存命中率下 Decode 瓶颈纯在 GPU 计算/功率墙，加内存通道对 Decode 几乎零提速（加容量最多解锁 26.8 GiB PLE 锁内存，理论上限 0~6%）。</p>
<p dir="auto">跑超长文档前把 STRATA_PREFILL_CPU_SHARE=0（关掉 CPU 分摊预填），100K 冷预填反而提速 +22%（TTFT 从 34.72s 降到 28.59s，Prefill 破 3013 tok/s），因为长文下 CPU AVX2 内核比 PCIe 3.0 流水线更慢（但 4K 短预填会掉 40%，日常建议保持默认 ON）。</p>
<ol start="4">
<li>模型变体与 24GB 显存升级预期：</li>
</ol>
<p dir="auto">同协议测了 Swift-1.5 IQ3_S，速度与基座完全一致（纯看文风喜好）；但 8-bit gate 的 IQ3_S_G8 在 16GB 卡上暴跌 45%（多占 ~640 MiB 显存把专家槽从 4220 挤到 1074，命中率跌到 75.6%），16GB 卡千万别用 G8。</p>
<p dir="auto">算了一下，16GB 显存（4508 槽）已吃下 97.5% 命中率，升级 24GB 显卡（扩到 ~7000+ 槽）预期 Decode 只有 +5%～10% 边际收益（外加能装下全量 dflash2 包和翻倍常驻 KV），没必要为了翻倍幻想盲目换卡。</p>
<p dir="auto">以上是DSH（deepseek 4.1 flash）调完参数，gemini总结要点。</p>
<p dir="auto"><a href="https://upload.lcz.me/uploads/ea92abd6-09fb-4e13-a49a-25c1c102daaa.html" rel="nofollow ugc">REPORT-20261129-decode-ab-share.html</a></p>
]]></description><link>https://lcz.me/post/36372</link><guid isPermaLink="true">https://lcz.me/post/36372</guid><dc:creator><![CDATA[Robin Suen]]></dc:creator><pubDate>Sun, 29 Nov 2026 01:27:26 GMT</pubDate></item><item><title><![CDATA[Reply to 3080 Ti 12GB：Linux + 新版引擎 + 四轮 A/B 调参 + 会话缓存，Qwen3.8-Flash-Next-IQ3_S 跑到 192–195 tok/s prefill 2,500 on Sat, 28 Nov 2026 23:09:12 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">感谢楼主的四轮 A/B 思路分享！<br />
我这边用DSH学习本贴思路基础上，在单卡 <strong>RTX 4070 Ti Super 16GB</strong>（Linux + Xeon Gold 6149 + <strong>96GB DDR4 三通道</strong>，引擎 <code>Strata 0.2.23 / engine 0.1.69</code>，模型同款 <code>Qwen3.8-Flash-Next GSQ-RCO IQ3_S</code> 双分片合计 83.6GB，锁定 <strong>262,144 上下文</strong> + <code>--kv int8</code> + <code>--kv-resident 32768</code>）上按你的思路也跑了一轮系统 A/B 测试，汇报一下实测数据和几个有意思的差异：<br />
<strong>1. 最终定版有效改动（只留 3 项 + prefill32k）：</strong></p>
<ul>
<li>
<p dir="auto"><code>--prefill auto:32768</code>（最大预填提速项）：16K prefill 从 <code>1309</code> 提到 <strong><code>2300.4 tok/s</code>（+76%）</strong>，TTFT 从 <code>12.55s</code> 降到 <strong><code>7.16s</code>（−43%）</strong>；<strong>240K 冷读</strong>从 <code>198.8s</code> 压到 <strong><code>99.9s</code>（+99%）</strong>，埋针全命中。</p>
</li>
<li>
<p dir="auto"><code>--mtp-q4 all</code>（最大单点 decode 提速）：可预测计数探针（草稿接受率 98%）2K decode 从 <code>247.4</code> 提到 <strong><code>285.2 tok/s</code>（+15%）</strong>，32K 从 <code>242.6</code> 提到 <strong><code>268.0 tok/s</code>（+10%）</strong>，标准套件正确性 12/12 无退化。</p>
</li>
<li>
<p dir="auto"><code>--spec 7</code>：五轮降噪复测比 <code>spec 6</code> 在 32K / 100K 下稳定高出 <code>4.5%~5.6%</code>（<code>spec 5</code> 更差）。</p>
</li>
<li>
<p dir="auto"><code>STRATA_KV_PREFETCH=1</code>：<strong>这点和楼主 121GB 内存的结论相反</strong>——在我的 96GB（可用 93GB）机器上开启后，~86K 长 prompt 预填稳定从 <code>2290~2318</code> 提到 <strong><code>2470~2478 tok/s</code></strong>，冷 TTFT 从 <code>37.1s+</code> 降到 <strong><code>34.86s</code></strong>，且 decode 没掉速，应该是不同内存边界下主机 pinned KV 调度差异导致的。</p>
</li>
</ul>
<p dir="auto"><strong>2. 最终真实负载实测水位（无前缀缓存复用冷测）：</strong></p>
<ul>
<li>
<p dir="auto"><strong>Decode 速度</strong>：高接受率探针（98%）<strong><code>285.2 tok/s</code>（2K）/ <code>268.0 tok/s</code>（32K）</strong>；普通随机问答（接受率 58%–73%）<strong><code>136.3 tok/s</code>（2K）/ <code>144.3 tok/s</code>（32K）/ <code>132.6 tok/s</code>（~86K）</strong>，长上下文几乎不怎么衰减。</p>
</li>
<li>
<p dir="auto"><strong>资源占用</strong>：显存 <strong><code>15.7 / 16 GB</code></strong>（驻留 <strong>4,508</strong> 个专家槽，命中率 <strong>97.5%–98.6%</strong>，仅 0.1% 走 PCIe Gen3×16），系统内存 <strong><code>66–68 GB</code></strong>（240K 峰值 ~74GB，全程 <code>VmSwap 0</code>、盘读 <code>≈0</code>）。</p>
</li>
</ul>
<p dir="auto"><strong>3. 96GB 内存机器踩过的两个小坑（供同配置参考）：</strong></p>
<ul>
<li>
<p dir="auto"><code>--vram-reserve-mib</code> 保持默认 <code>256</code> 最稳（压到 <code>156</code> 多 52 个槽位，但收益在测试噪声内；压到 <code>128</code> 会触发显存溢出到系统内存）。</p>
</li>
<li>
<p dir="auto">96GB 内存下<strong>不能盲目把 <code>--conversation-cache-mib</code> 放大到 16GB</strong>，合成高并发测试会触发驱逐并溢出 3.7GB 落盘，保持默认 <code>≤8192 MiB</code> 才能守住零盘读。</p>
</li>
</ul>
</blockquote>
<hr />
]]></description><link>https://lcz.me/post/36362</link><guid isPermaLink="true">https://lcz.me/post/36362</guid><dc:creator><![CDATA[Robin Suen]]></dc:creator><pubDate>Sat, 28 Nov 2026 23:09:12 GMT</pubDate></item><item><title><![CDATA[Reply to 3080 Ti 12GB：Linux + 新版引擎 + 四轮 A/B 调参 + 会话缓存，Qwen3.8-Flash-Next-IQ3_S 跑到 192–195 tok/s prefill 2,500 on Sat, 28 Nov 2026 17:26:15 GMT]]></title><description><![CDATA[<p dir="auto">牛逼，谢谢分享！</p>
]]></description><link>https://lcz.me/post/36355</link><guid isPermaLink="true">https://lcz.me/post/36355</guid><dc:creator><![CDATA[99 ddr]]></dc:creator><pubDate>Sat, 28 Nov 2026 17:26:15 GMT</pubDate></item></channel></rss>