<?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[strata优化个人总结]]></title><description><![CDATA[<p dir="auto">我是ai小白，主要就是装着玩，也不玩生产力，偶尔打开就是让ai帮我升级和优化，当中也读了一些论坛里的帖子作为参考。今天就让AI帮我总结了下之前优化的内容，供坛友参考，新接触strata的可以让ai读一读。（其实我也不知道它说的都是啥，对不对，让自己的ai判断吧……）</p>
<h1>32G 显存 + 128G 内存跑 Strata：一份实测过的调优清单</h1>
<blockquote>
<p dir="auto">硬件：RTX 4080 SUPER 32 GB（sm_89）/ i7-11700K 8C16T / 128 GB DDR4-3200 / PCIe 4.0 ×16 / NVMe / Win11 / 驱动 616.92（CUDA 13）<br />
软件：Strata 源码 <strong>v0.2.5</strong> + 引擎 <strong>0.1.50</strong><br />
模型：Qwen3.8-Flash-Next（Swift 1.5）<strong>IQ3_S</strong>，专家表 46.84 GiB 常驻主机内存<br />
口径：官方 <code>bench/results/2026-09-30-community-rtx-5090/benchmark.py</code>，<code>--targets 131072 --runs 3</code>，256 输出、greedy、每次全新 prompt（<code>cached_tokens</code> 全 0）</p>
</blockquote>
<h2>0 先给结论</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指标</th>
<th>数值</th>
</tr>
</thead>
<tbody>
<tr>
<td>decode @131K</td>
<td><strong>116–127 tok/s</strong>（预热后两跑，会话间有波动），冷启第一跑 ~95–99</td>
</tr>
<tr>
<td>prefill @131K</td>
<td><strong>3,186–3,209 tok/s</strong></td>
</tr>
<tr>
<td>TTFT @131K</td>
<td><strong>41 s</strong></td>
</tr>
<tr>
<td>专家 arena</td>
<td>46.84 GiB（pinned 主机内存）</td>
</tr>
<tr>
<td>VRAM 里的专家缓存</td>
<td>~21.1 GiB / <strong>11.1k 槽（总 24,576 槽的 45%）</strong></td>
</tr>
<tr>
<td>实测专家命中率</td>
<td><strong>95% → 99%</strong>（第一跑 → 第三跑）</td>
</tr>
<tr>
<td>引擎自报 <code>VRAM free with everything loaded</code></td>
<td><strong>2,600–2,684 MiB</strong></td>
</tr>
</tbody>
</table>
<p dir="auto">核心认知一句话：<strong>这个框架的速度不由 GPU 算力决定，而由「专家命中率 × PCIe 带宽 × prompt 复用率」决定。</strong></p>
<p dir="auto">证据（老机器 i5 上实测，机制不变）：两次 agent 请求 <code>prompt_n</code> 71,856 / 61,105，<code>cache_n</code> <strong>两次都恰好 7,630</strong><br />
（复用仅 10.6% / 12.5%），<code>prompt_ms</code> 28.2 / 26.6 s vs 纯 decode 应付的 7.6 / 5.5 s ⇒ <strong>prefill 占 79–81%</strong>。<br />
而 <code>/v1/status</code> 的 <code>concurrency.serving</code> <strong>恒为 1</strong>、GPU util 96–100%、功耗 150–293 W ⇒ 单序列串行，<strong>加并发/加子智能体/换更强卡都不提吞吐</strong>。<br />
要快只有两条路：<strong>少读 prompt</strong>、<strong>少走 PCIe</strong>。</p>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 还有一条必须知道的前提：<strong>专家缓存只救 decode，救不了 prefill</strong>。官方 <code>tools/calibrate.py</code> 原文：</p>
<blockquote>
<p dir="auto">Decode speed only: the prompt path streams every expert whatever these settings say.</p>
</blockquote>
<p dir="auto">即 <strong>prefill 阶段永远把专家全量流给 GPU</strong>，命中率 99% 也一样。⇒ 想在 prefill 上省钱，只能靠 §2（少读 prompt），调任何缓存参数都没用。</p>
<hr />
<h2>1 配置层</h2>
<h3>1.1 专家放哪：resident arena 是前提</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>值</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>专家驻留</td>
<td><strong>默认 resident arena</strong>（不要 <code>--mmap-experts</code>）</td>
<td>46.84 GiB 用 <code>cudaHostRegister PORTABLE</code> 锁成大页 pinned 内存，miss 走 PCIe，实测有效带宽 12.6 GB/s</td>
</tr>
<tr>
<td>显存只放缓存</td>
<td><code>--expert-cache auto</code></td>
<td>VRAM 里只留 ~21 GiB 专家缓存，命中 95–99% 时几乎不碰 PCIe</td>
</tr>
<tr>
<td>128 GB 内存的意义</td>
<td>—</td>
<td>arena 46.84 + page cache + 桌面 ≈ 60 GiB，正好装得下。<strong>内存不够别照抄这套</strong>（<code>--mmap-experts</code>、<code>--ple-row-cache 0</code> 是 32 GB 机器的活命取舍）</td>
</tr>
</tbody>
</table>
<h3>1.2 显存分配</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>值</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--vram-reserve-mib</code></td>
<td><strong>3072</strong></td>
<td>稳态空闲 ≈ reserve − 250~640 MiB ⇒ 3072 是「能稳定留 ≥2 GB」的最小值。试过 3328：更宽，代价约 <strong>−110 个专家槽</strong></td>
</tr>
<tr>
<td><code>--kv int8</code></td>
<td>开</td>
<td>KV 8 bit，省显存，质量无感</td>
</tr>
<tr>
<td><code>--kv-resident 32768</code></td>
<td>32K</td>
<td>最近 32K 的 KV 常驻显存，长上下文不反复搬运</td>
</tr>
<tr>
<td><code>--max-context 262144</code></td>
<td>262144</td>
<td>这就是 <strong>native context，不需要 YaRN</strong>。实测 131072 → 262144 <strong>几乎不花 VRAM</strong>（槽位差全由 reserve 解释）</td>
</tr>
</tbody>
</table>
<h3>1.3 投机解码（MTP）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>值</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--spec 4</code></td>
<td>4 个草稿</td>
<td>配 <code>--mtp &lt;模型&gt;/mtp/rt</code>。实测每 256 token 派出 204–234 个草稿、接受 153–158 个</td>
</tr>
<tr>
<td><code>--spec-min-p 0.5</code></td>
<td>0.5</td>
<td>低于这概率就不猜，避免白跑</td>
</tr>
</tbody>
</table>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ <code>--spec 0</code>（关掉）只在 <strong>16 GB 显存</strong>上划算（拿草稿的显存换专家槽）。32 GB 上关掉是纯亏。<code>--spec 8</code> 实测全面差于 4。</p>
<h3>1.4 缓存与 prompt 路径</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>值</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--prompt-cache 16</code></td>
<td>16 个检查点</td>
<td>长对话复用基础。<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 名额有限，新的会顶掉旧的</td>
</tr>
<tr>
<td><code>--prompt-cache-tail</code></td>
<td>开</td>
<td>尾部也留检查点，配「只改最后一句」的场景</td>
</tr>
<tr>
<td><code>--conversation-cache-mib 8192</code></td>
<td>8 GiB / 4 槽 / 最小 4096 token</td>
<td>多会话切换不必整段重 prefill。<strong>默认是 0=关闭</strong>；成本 ≈118 MB 固定 + 17–19 KB/token，262144 下大约只放得下 1 条，且是从 page cache 抢 RAM ⇒ 内存紧的机器别开</td>
</tr>
<tr>
<td><code>--prefill auto</code></td>
<td>8,192 块</td>
<td>0.1.45 起 auto 取到 8192（比 4096 快，代价 ~646 个专家槽）。显存小就写死 <code>--prefill 4096</code></td>
</tr>
<tr>
<td><code>vision.elastic: true</code></td>
<td>开</td>
<td><strong>视觉模型平时不加载，来图才起，空闲 120 秒退还</strong>。纯文本时等于无视觉，发图功能还在。实测 <strong>+597 个专家槽</strong>，第一张图约 +5 秒</td>
</tr>
<tr>
<td><code>--host-core last</code></td>
<td>开</td>
<td>见 1.6，单独说</td>
</tr>
</tbody>
</table>
<h3>1.5 其余已知默认值（别乱关）</h3>
<ul>
<li><strong>NaN 守卫默认开</strong>：某窗 logits 全 NaN 时不发出、丢缓存、重读重试一次；无 NaN 时输出 <strong>byte-identical</strong>，成本 ≤0.2% decode。不建议关。</li>
<li><strong>route tail skip</strong>：命中率 ≥90% 时自动关（太高时跳过反而损草稿接受率），低于就默认开。不用管。</li>
<li><strong><code>--expert-profile</code></strong>：留着。启动时 1 秒预填 11k 槽（22 GB/s），比冷启动慢慢学快。<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 落盘只在 QUIT 或每 N 分钟，<strong>强杀进程不写</strong>。</li>
</ul>
<h3>1.6 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--star" style="height:1.4em;width:auto;vertical-align:middle" title="⭐" alt="⭐" /> <code>--host-core last</code>：Windows 专属、零答案风险、白捡 3%/8%</h3>
<p dir="auto">引擎 help 原文：</p>
<blockquote>
<p dir="auto"><code>--host-core WHERE</code> … Windows sends a GPU's interrupts to one logical processor, <strong>usually the first</strong>, and every copy that lands raises one: a spinning host there waits for them. <strong>Moves threads only, never a result.</strong></p>
</blockquote>
<p dir="auto">默认 <code>first</code> 把 host 自旋线程摆在 <strong>core 0</strong>，而 Windows 恰好把 GPU 中断也丢给 CPU 0 ⇒ <strong>每份 PCIe 拷贝完成都在打断它</strong>。改成 <code>last</code>：</p>
<ul>
<li>改前：<code>7 pool workers on logical processors 2,4,6,8,10,12,14, the host thread on 0</code></li>
<li>改后：<code>7 pool workers on logical processors 0,2,4,6,8,10,12, the host thread on 14</code></li>
</ul>
<p dir="auto">131K×3、两个独立会话实测（对照 = 同引擎、同配置、13 分钟前跑的另一组）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th></th>
<th>run-1（冷）</th>
<th>run-2</th>
<th>run-3</th>
<th>预热后均值</th>
<th>prefill 中位</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--host-core first</code></td>
<td>94.2</td>
<td>114.8</td>
<td>110.9</td>
<td>112.9</td>
<td>3,101.7</td>
</tr>
<tr>
<td><code>last</code> 会话 A</td>
<td>94.1</td>
<td>125.5</td>
<td>127.2</td>
<td><strong>126.4（+11.9%）</strong></td>
<td>3,208.7（+3.5%）</td>
</tr>
<tr>
<td><code>last</code> 会话 B</td>
<td>99.4</td>
<td>127.0</td>
<td>116.2</td>
<td><strong>121.6（+7.7%）</strong></td>
<td>3,186.0（+2.7%）</td>
</tr>
</tbody>
</table>
<ul>
<li><strong>prefill 两个会话的区间与基线完全不重叠</strong>（新最小 3,185.0 &gt; 旧最大 3,177.6），这条最硬。</li>
<li>TTFT −1.1 ~ −1.4 s；冷启第一跑基本不变（PCIe 主导，没余量）。</li>
<li>显存指纹一点没变（arena 46.84 GiB / 槽位 11,141 vs 11,149 / <code>VRAM free</code> 差 15 MiB）⇒ <strong>纯调度收益</strong>。</li>
</ul>
<h3>1.7 完整参数（改路径即可抄）</h3>
<pre><code class="language-json">{
  "args": [
    "--pack", "&lt;packs&gt;/swift-iq3_s",
    "--native", "&lt;models&gt;/swift-IQ3_S-00001-of-00002.gguf",
    "--ple-gguf", "&lt;models&gt;/swift-IQ3_S-00001-of-00002.gguf",
    "--expert-profile", "&lt;Strata&gt;/data/expert-profile.bin",
    "--expert-cache", "auto",
    "--prefill", "auto",
    "--spec", "4",
    "--mtp", "&lt;models&gt;/mtp/rt",
    "--max-context", "262144",
    "--kv", "int8",
    "--kv-resident", "32768",
    "--vision",
    "--vram-reserve-mib", "3072",
    "--spec-min-p", "0.5",
    "--prompt-cache", "16",
    "--prompt-cache-tail",
    "--conversation-cache-mib", "8192",
    "--conversation-cache-slots", "4",
    "--conversation-cache-min-tokens", "4096",
    "--host-core", "last"
  ],
  "env": { "STRATA_CACHE_MESSAGE_BOUNDARY": "1" },
  "vision": { "elastic": true }
}
</code></pre>
<blockquote>
<p dir="auto"><code>strata.exe</code> 直接吃这份 <code>args</code>，不用额外拼命令。<strong>没有 <code>--pool-workers</code></strong>（原因见 §3）。</p>
</blockquote>
<hr />
<h2>2 请求侧：收益比调参更大</h2>
<h3>2.1 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--star" style="height:1.4em;width:auto;vertical-align:middle" title="⭐" alt="⭐" /> <code>STRATA_CACHE_MESSAGE_BOUNDARY=1</code></h3>
<p dir="auto">agent 类客户端（DSH / Cline / 自研）的典型形态是「<strong>长历史不动，只换最后一条 user 消息</strong>」。默认检查点对不上，引擎会把读过的历史重读一遍。这个开关在上一轮消息边界多存一个检查点：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th></th>
<th>新读 token</th>
<th>读 prompt 耗时</th>
</tr>
</thead>
<tbody>
<tr>
<td>关</td>
<td>919</td>
<td>968 ms</td>
</tr>
<tr>
<td><strong>开</strong></td>
<td><strong>20</strong></td>
<td><strong>374 ms</strong></td>
</tr>
</tbody>
</table>
<p dir="auto">代价：每个新请求约 +5.9% 开销。<strong>全套优化里性价比最高的一行配置。</strong></p>
<h3>2.2 保住 prompt 前缀稳定</h3>
<p dir="auto">同一份 1,239 token 上下文，只改发送方式：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>情况</th>
<th>新读</th>
<th>复用率</th>
<th>耗时</th>
</tr>
</thead>
<tbody>
<tr>
<td>首轮</td>
<td>1,239</td>
<td>0%</td>
<td>2,096 ms</td>
</tr>
<tr>
<td>追加一轮</td>
<td><strong>26</strong></td>
<td><strong>97.9%</strong></td>
<td><strong>298 ms（快 7 倍）</strong></td>
</tr>
<tr>
<td>同上但开头插一句 <code>Session start 21:20:03.</code></td>
<td>1,272</td>
<td><strong>0%</strong></td>
<td>1,442 ms</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>开头改一个字 = 全部重算。</strong> 所以：system prompt 里别放时间戳、日期、会话 ID、随机串；工具定义别每轮重排。<br />
另外 <code>--prompt-cache 16</code> 是<strong>有限名额</strong>——重复发一个稍改过的版本会把上一个检查点顶掉。</p>
<h3>2.3 压上下文比什么都有效</h3>
<p dir="auto">prefill 占 79–81% 的条件下，<strong>每轮 70K → 15K 能把该轮 ~36 s 压到 ~14 s（≈2.6×）</strong>。<br />
比任何参数都划算：该截断的历史截断，别指望靠调参把 70K 读快。</p>
<hr />
<h2>3 测过、结论是「不要做」的</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>我们测到的</th>
<th>为什么不要</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--pool-workers N</code></td>
<td>6 核 CPU 上 <code>3</code> 最优（+10.6%）；<strong>换到 8 核 i7 上 <code>3</code> 变 −3.9%，默认（7 worker）最好</strong>；<code>11</code>（想用上闲置 SMT 兄弟）<strong>−15.6%</strong></td>
<td><strong>结论是 CPU 拓扑的函数</strong>，抄别人的数必翻车；官方 sweep 只往低调，从没测过 <code>&gt; 默认</code> 且实测更差。它<strong>只影响 decode、不影响 prefill</strong></td>
</tr>
<tr>
<td><code>--ple-io ram</code></td>
<td>128 GB 上 <strong>−0.56%，中性</strong>，已删</td>
<td>帖子说 3 倍收益的场景是「表住不进页缓存」；内存够就没收益</td>
</tr>
<tr>
<td><code>--pcie-frac 0.55</code></td>
<td>本机自动 0.34–0.35 更好，<code>pcie_share</code> 仅 0.3–2.8%</td>
<td><strong>命中率越高 PCIe 越不划算</strong>，别抄高 miss 场景的值</td>
</tr>
<tr>
<td><code>--aux-cpus auto</code></td>
<td><code>strata aux cpus: not available on this system</code>（<code>first</code>/<code>last</code> 都一样）</td>
<td>0.1.50 在 <strong>Windows 上是 no-op</strong>，白重启一次</td>
</tr>
<tr>
<td><code>--batch N</code></td>
<td>12 GB 卡上单请求 2 槽 −11%、4 槽 −24%</td>
<td>要求专家缓存 ≥ 一半专家（本机 45% 不够），且<strong>批量槽不带 MTP 草稿</strong>，而速度全靠草稿。单用户<strong>恒不要开</strong></td>
</tr>
<tr>
<td><code>--spec 8</code></td>
<td>全面差于 4</td>
<td>草稿越多越容易被拒，白算</td>
</tr>
<tr>
<td><code>--kv q4_0</code> / <code>--kv k8v4</code></td>
<td>prefill −18% / 后者与 <code>--kv-resident</code> 不能共存</td>
<td>别为省显存放弃 KV 质量与常驻</td>
</tr>
<tr>
<td>加第二张卡</td>
<td>实测 <strong>136.7 → 120.7 → 98.9 tok/s</strong>（越多越慢）</td>
<td>这框架的问题是 PCIe/命中率，不是算力；多卡反而拆了专家缓存</td>
</tr>
<tr>
<td><code>--expert-cache-per-layer</code></td>
<td>是给<strong>低命中率</strong>机器救命的</td>
<td>本机命中 96–97%，分了反而碎</td>
</tr>
<tr>
<td><code>--mmap-experts</code></td>
<td>要求 page cache 装得下 34 GB；装不下走冷分支 <strong>71.97 vs 34.78 ms/token</strong></td>
<td>内存够就是自废武功</td>
</tr>
<tr>
<td><code>--shared-expert-arena</code></td>
<td>Linux-only</td>
<td>—</td>
</tr>
<tr>
<td>YaRN / rope scaling 到 512K</td>
<td>needle 8/8 过，但 mscale <strong>每个位置都生效</strong> ⇒ 等于换了个模型</td>
<td>262144 已 native，别开</td>
</tr>
<tr>
<td><code>STRATA_ADAPT_OVERLAP</code></td>
<td>CUDA 在 Linux 默认开；Windows 要 <code>=1</code>。官方实测 Windows + RTX 5070：Q2_0 <strong>慢 2.6%</strong>、IQ3_XXS"no faster"</td>
<td>Windows 上不必试</td>
</tr>
<tr>
<td><code>STRATA_PREFILL_CPU_SHARE</code> / <code>STRATA_ROUTE_TAIL_SKIP</code> / PCIe 自校准</td>
<td>前两个<strong>会改输出</strong>；自校准本机收敛回原值</td>
<td>想要确定性就别碰</td>
</tr>
<tr>
<td><code>setup.py --calibrate</code></td>
<td>会重写配置</td>
<td>别跑</td>
</tr>
</tbody>
</table>
<hr />
<h2>4 选模型/选档位：下载前先花 5 分钟</h2>
<h3>4.1 零下载判定器</h3>
<pre><code class="language-bash">python setup.py --inspect hf:&lt;owner&gt;/&lt;repo&gt; &lt;VARIANT&gt;
</code></pre>
<p dir="auto">只读 GGUF header，直接给<strong>分组位宽表</strong>（各专家类型占比）和一句「Strata 能不能跑」。<br />
三种判词：① 官方已知文件；② <code>the routed experts are stored exactly as in qwen/&lt;V&gt;</code>（配方相同、能跑但没测过）；③ 明确跑不了。<br />
<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 仓库名连字符要准（<code>GSQ-RCO</code> 不是 <code>GSQRCO</code>），错的直接 404。</p>
<h3>4.2 槽位公式（下 80 GB 之前就能预判）</h3>
<pre><code>expert_cache_slots = 专家缓存显存 ÷ (arena_bytes ÷ 24576)      # 24576 = 48 层 × 512 专家
</code></pre>
<p dir="auto">代入本机：<code>21.65 GiB ÷ (50.3e9 ÷ 24576) ≈ 11.3k</code>，日志实测 <strong>11,141</strong>（误差 1 槽量级）。<br />
<code>setup.py:201-233</code> 的 <code>MODELS[q]["arena_gb"]</code> 与引擎日志的 <code>expert arena … B</code> 是同一个数（十进制 GB）。</p>
<p dir="auto">已登记档位的 arena 占用（十进制）：<code>IQ1_M 23.4 / Q2_0 34.0 / IQ2_XS 35.5 / IQ3_XXS 42.9 / IQ3_S 50.3 / UD-IQ4_XS 59.5 / UD-Q4_K_XL 77.0</code> GB<br />
⇒ <strong>先拿这张表算「我的内存装得下吗、显存能放多少槽」，再决定要不要下 80 GB。</strong></p>
<h3>4.3 换档的经验</h3>
<ul>
<li>我们自己的选型：IQ3_XXS → <strong>IQ3_S</strong>（更高质量，arena 42.9 → 50.3 GB），代价是显存槽变少、decode 略降，<strong>必须自己实测</strong>。</li>
<li>想大幅提质量就换更大的骨干（如 UD-Q4_K_XL），但 arena 会到 77 GB ⇒ 槽位掉到 ~7k（29%），<strong>decode 预计腰斩到 55–85 tok/s</strong>。不是"更强模型=更好体验"。</li>
<li>同一仓库里有时是<strong>镜像</strong>：换之前抽样比对几处 1 MiB，字节全同就说明是同一个文件改了名。</li>
</ul>
<hr />
<h2>5 运维坑（Windows + 源码安装）</h2>
<ol>
<li><strong>源码安装的「自动升引擎」是坏的</strong>：<code>setup.py</code> 里 <code>MIN_ENGINE</code> 没跟上版本，<code>UPDATE.bat</code> 只 <code>git pull</code> 代码、<strong>引擎还是老的</strong>。正确做法：手工把 <code>strata-engine-&lt;ver&gt;-windows-x86_64-cuda-cuda13.tar.gz</code> 解到 <code>engine\</code>（包内 7 个文件平铺），再按 <code>engine-component.json</code> 逐文件 sha256 校验。</li>
<li><strong>别用 <code>UPDATE.bat</code> / <code>setup.py --update</code></strong>：会重写配置，手写的长参数全没。</li>
<li><strong>停服务要杀两个进程</strong>：监听端口的是 <strong>Python</strong>（<code>serve/server.py</code>），<code>strata.exe --serve</code> 是它的子进程。没有 <code>/v1/shutdown</code>，<code>/v1/unload</code> 只卸模型。姿势：<code>netstat -ano | findstr :8080</code> 取 PID → <code>taskkill /PID &lt;pid&gt; /F /T</code>，<strong>不带 <code>/F</code> 一定失败</strong>。</li>
<li><strong>启动时 CPU 占用会很高</strong>：池线程是<strong>自旋忙等</strong>，decode 段 CPU 占用 ≈ 参与线程数 ÷ 逻辑核数（我们 8 worker / 16 线程 ≈ <strong>51%</strong>）。正常现象，不是卡死。prefill 段各核差别不大。</li>
<li><strong>大页需要权限</strong>：日志出现 <code>VirtualAlloc error 1314</code>（<code>ERROR_PRIVILEGE_NOT_HELD</code>）说明拿不到大页 ⇒ 用「计划任务 + 最高权限」启动。<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 但见 §7：<strong>计划任务别用 BelowNormal 优先级</strong>，否则会掉到 2–3 tok/s。</li>
<li><strong>上游会重写历史</strong>：升级前先 <code>git merge-base --is-ancestor HEAD origin/main</code>，是祖先后才 <code>--ff-only</code>；<strong>钉 tag，别跟 main</strong>。</li>
<li><strong><code>--vram-elastic</code> 释放后回不满</strong>：让出 6144 MiB 后槽位 13,289 → 11,393，<code>reset</code> 只回到 12,916 ⇒ <strong>要回满只能重启</strong>。</li>
</ol>
<h3>冷启动：换 NVMe 前后实测（这条常被问到）</h3>
<p dir="auto">冷启动曾经有两个<strong>叠加</strong>的慢因，现在两个都解决了：</p>
<ol>
<li><strong>盘慢</strong>：SATA 时代日志 <code>loaded 39.97 GiB at 0.51 GiB/s</code> —— 正好是 870 EVO 的接口上限（≈550 MB/s）。</li>
<li><strong>拿不到大页</strong>：<code>VirtualAlloc error 1314</code>（<code>ERROR_PRIVILEGE_NOT_HELD</code>，缺「锁定内存页」权限）。现在日志里是<br />
<code>cudaHostRegister PORTABLE ok; large pages (2097152 B)</code>，已正常。</li>
</ol>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th></th>
<th>SATA 870 EVO（SATA 6 Gb/s）</th>
<th>990 PRO NVMe（PCIe 4.0 ×4）</th>
</tr>
</thead>
<tbody>
<tr>
<td>引擎自报载入速率</td>
<td><strong>0.51 GiB/s</strong>（≈548 MB/s ≈ 标称 560 的 98%）</td>
<td><strong>6.51 GiB/s</strong>（≈6.99 GB/s ≈ 标称 7,450 的 94%）</td>
</tr>
<tr>
<td>专家表载入</td>
<td>39.97 GiB ≈ <strong>78 s</strong>（另一次实测 95 s）</td>
<td>46.84 GiB ≈ <strong>17 s</strong>（墙上 15 s）</td>
</tr>
<tr>
<td>到 ready</td>
<td><strong>78–95 s</strong></td>
<td><strong>24.1 s</strong>（数据量还多 17%）</td>
</tr>
</tbody>
</table>
<p dir="auto">⇒ <strong>载入段快 12.8×，端到端快约 3.5–4×</strong>。差距比 12.8 小，是因为端到端里有<strong>跟盘无关的固定段</strong>：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>阶段</th>
<th>耗时</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>① Python / 服务层起来</td>
<td>5.1 s</td>
<td>不读盘</td>
</tr>
<tr>
<td>② 读专家表进 pinned RAM</td>
<td>15.0 s</td>
<td>唯一被换盘影响的段</td>
</tr>
<tr>
<td>③ 算槽位、注册 arena</td>
<td>1.4 s</td>
<td>—</td>
</tr>
<tr>
<td>④ 填 21 GiB 显存专家缓存</td>
<td>1.3 s</td>
<td>其中 1.0 s 是 <code>--expert-profile</code> 预填 11k 槽（<strong>22 GB/s</strong>）</td>
</tr>
<tr>
<td>⑤ 收尾到 ready</td>
<td>1.3 s</td>
<td>—</td>
</tr>
<tr>
<td><strong>合计</strong></td>
<td><strong>24.1 s</strong></td>
<td>读盘只占 62%</td>
</tr>
</tbody>
</table>
<p dir="auto">结论：<strong>两块盘都已经把接口打满了</strong>（SATA 98% / NVMe 94%），想再快只能上 PCIe 5.0 平台，换"更好的 PCIe 4.0 盘"没有意义。<br />
剩下的固定段里，唯一能省的是换更小的档位（arena 越小读得越少），但那要拿质量/槽位去换。<br />
另外：<code>--expert-profile</code> 已经保证缓存按 22 GB/s 预填，<strong>它不是冷启动瓶颈，别删</strong>。</p>
<hr />
<h2>6 测量方法论：不看这条，前面的数字全会骗你</h2>
<ol>
<li><strong>decode 会在连续几跑之间单调爬升</strong>（实测 94 → 115 → 111，命中率 0.95 → 0.99），原因是专家缓存跨 run 预热。<br />
⇒ <strong>只比 run-1<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2194.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--left_right_arrow" style="height:1.4em;width:auto;vertical-align:middle" title="↔" alt="↔" />run-1、run-3<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2194.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--left_right_arrow" style="height:1.4em;width:auto;vertical-align:middle" title="↔" alt="↔" />run-3，别看中位、更别看单次。</strong></li>
<li><strong>prefill 相对稳（±2%）</strong> ⇒ 用 prefill 判「有没有变慢」，用预热后的 decode 判「稳态快不快」。</li>
<li><strong>长 prompt 的 prefill 波动极大</strong>：同一版本见过 499 到 2,831 tok/s（5.7×）。1–2 个样本不能下任何结论。</li>
<li><strong>一次只改一个变量</strong>，改前先跑旧基线——不要改完再想办法"换回去补基线"。</li>
<li><strong>显存别用 <code>total − used</code> 反推</strong>（WDDM 恒差 ~392 MiB）。可信的只有
<ul>
<li>跨版本比较：引擎自报的 <code>NNNN MiB of VRAM free with everything loaded</code>（这是<strong>引擎自己的账</strong>，比驱动视角高约 800 MiB，两者不能混比）</li>
<li>单次排查：<code>nvidia-smi --query-gpu=memory.free</code></li>
</ul>
</li>
<li><strong>验收别盯死专家槽位数</strong>：桌面占用会直接改变自动缓存大小。要看 <strong>arena 大小 + <code>VRAM free</code></strong> 两个锚点。</li>
<li><strong>0.1.43 起 <code>timings.prompt_n</code> 口径变了</strong>：只计引擎<strong>真正读过</strong>的 token，其余进 <code>cache_n</code>。跟老版本数据对比要注意。</li>
<li>判断某开关是否被引擎支持：<code>strata.exe &lt;flag&gt; --tokens 1 --pack Z:/nope</code>，出现 <code>unknown argument: X</code> 才是真不支持。</li>
<li><strong>想快速出可比数据就用官方套件</strong>：<code>BENCH.bat</code>（= <code>tools/strata_bench.py</code>），3–10 分钟跑完短聊 / 4K / 16K / 五轮 agent 会话，产出<strong>社区基准格式</strong>并自动脱敏，<code>--compare</code> 可并排两次运行。比自拼脚本省事。</li>
</ol>
<hr />
<h2>7 排障小抄</h2>
<ul>
<li><strong>GPU 忙但功耗低 = 在等数据</strong>。这个架构 <code>utilization.gpu</code> 天生不高（大部分时间在等 PCIe），要看功耗：<pre><code class="language-bash">nvidia-smi --query-gpu=power.draw,power.limit,utilization.gpu,clocks.sm --format=csv,noheader
</code></pre>
我们空闲 <code>55 W / 320 W / 0%</code>，先记一条自己 decode 时的值当基线，以后说"变慢了"先比这一步。</li>
<li><strong>别用计划任务以低优先级启动</strong>：论坛上有案例是同模型同参数，速度从 20–30 tok/s 掉到 <strong>2–3 tok/s</strong>，根因是 Windows 计划任务以 <strong>BelowNormal 优先级</strong>拉起进程；改 WMI / 直接双击（Normal）即恢复。这个坑很隐蔽，但和 §1.6 的「中断落点」是同一个机制的两面。</li>
</ul>
<hr />
<h2>8 还没试、但值得试的（附已知数据，供你踩在我们肩上）</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>候选</th>
<th>已知数据</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><code>--mtp-window N</code></strong></td>
<td>默认 32768；论坛同款模型实测 decode <strong>+32% @32K / +4% @128K / +7% @256K</strong></td>
<td>context 262144 下默认窗口只覆盖 12.5%。<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ <strong>真正的代价在 prefill</strong>：草稿层只 prefill 最后 <code>window+64</code> 个 cell，所以调大窗口 = 多花 prefill。必须按 §6 的方法 A/B</td>
</tr>
<tr>
<td><strong><code>STRATA_KV_PREFETCH=1</code></strong></td>
<td>prefill <strong>−5.3% @32K / −4.1% @64K</strong>，decode 不变；官方自称草案</td>
<td>零答案风险，成本一行 env</td>
</tr>
<tr>
<td><strong><code>STRATA_ROUTE_RESIDENT=1</code></strong></td>
<td>官方：32 GB 缓存 <strong>+2% decode</strong>、16 GB 卡 +6–8%，<strong>答案同前</strong></td>
<td>收益随命中率升高而减小，本机 96–97% ⇒ 预期 &lt;2%</td>
</tr>
<tr>
<td><strong><code>--kv-grow</code></strong></td>
<td>K/V 只按实际触及的 cell 占显存</td>
<td>要求先关掉 KV streaming（去掉 <code>--kv-resident</code>），结构性改动，最后再试</td>
</tr>
<tr>
<td><strong><code>--native-qsa</code> / <code>-qsa-indexer</code> / <code>-rope</code> 等</strong></td>
<td>把 QSA/GDN/rope 的 host 侧计算挪到 GPU</td>
<td>默认关、无公开实测。核少的机器理论收益更大，<strong>先测基线再开</strong></td>
</tr>
</tbody>
</table>
<hr />
<h2>9 版本收益参考</h2>
<p dir="auto">0.1.46 → 0.1.50（源码 v0.2.1.4 → v0.2.5），同配置同口径 131K×3：</p>
<ul>
<li>prefill <strong>+1.9% / +3.7%</strong>（三跑区间完全不重叠）</li>
<li>预热后 decode <strong>107.6 → 110.9 / 118.5 → 122.3</strong>（+3.1% / +3.2%）</li>
<li>TTFT −0.8 / −1.6 s</li>
<li>启动指纹一点没变：arena 46.84 GiB、<code>prefill_cap 8192</code>、控制向量 300 张</li>
</ul>
<p dir="auto">⇒ <strong>引擎升级是稳的正收益，但量级在 2–4%，别期待翻倍。真正的大头在 §1.6、§2 和 §8 的 <code>--mtp-window</code>。</strong></p>
<hr />
<p dir="auto"><em>所有数字都来自本机重复实测。不同显卡/CPU/内存组合请按 §6 自己复现一遍再落地，尤其 <code>--pool-workers</code> 与 <code>--vram-reserve-mib</code> 这两个跟硬件强相关的项。</em></p>
]]></description><link>https://lcz.me/topic/2578</link><generator>RSS for Node</generator><lastBuildDate>Mon, 23 Nov 2026 20:15:03 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/2578.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Oct 2026 13:49:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to strata优化个人总结 on Tue, 27 Oct 2026 15:56:52 GMT]]></title><description><![CDATA[<p dir="auto">强，我也是4080S+同款模型和框架，学习下</p>
]]></description><link>https://lcz.me/post/28423</link><guid isPermaLink="true">https://lcz.me/post/28423</guid><dc:creator><![CDATA[jingy yi]]></dc:creator><pubDate>Tue, 27 Oct 2026 15:56:52 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Tue, 27 Oct 2026 13:27:51 GMT]]></title><description><![CDATA[<p dir="auto">已经让我的AI仔细认真的学习了</p>
]]></description><link>https://lcz.me/post/28384</link><guid isPermaLink="true">https://lcz.me/post/28384</guid><dc:creator><![CDATA[九门奇人]]></dc:creator><pubDate>Tue, 27 Oct 2026 13:27:51 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Tue, 27 Oct 2026 12:24:04 GMT]]></title><description><![CDATA[<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f525.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--fire" style="height:1.4em;width:auto;vertical-align:middle" title="🔥" alt="🔥" /> 本帖参与讨论人数已达 <strong>10+</strong>，入选<strong>热议</strong>，作者 <strong>+3 积分</strong>奖励，感谢分享！</p>
<blockquote>
<p dir="auto">奖励凭证：热议 +3 分 · 编号 h2578-1730-1（系统自动发放，显示稍有延迟）</p>
</blockquote>
]]></description><link>https://lcz.me/post/28364</link><guid isPermaLink="true">https://lcz.me/post/28364</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Tue, 27 Oct 2026 12:24:04 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Tue, 27 Oct 2026 12:22:57 GMT]]></title><description><![CDATA[<p dir="auto">谢谢分享，我也有一张4080S，抽空优化下</p>
]]></description><link>https://lcz.me/post/28363</link><guid isPermaLink="true">https://lcz.me/post/28363</guid><dc:creator><![CDATA[Enigma]]></dc:creator><pubDate>Tue, 27 Oct 2026 12:22:57 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Tue, 27 Oct 2026 06:50:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/applejuice" aria-label="Profile: applejuice">@<bdi>applejuice</bdi></a></p>
<p dir="auto">谢谢，有收获，让ai读了一下你的数据，它回复我（具体的太多，就抽了几个重点发，感谢   <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60a.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--blush" style="height:1.4em;width:auto;vertical-align:middle" title=":blush:" alt="😊" /> ）：</p>
<p dir="auto">但里面有 <strong>3 个值得试的东西</strong> 和 <strong>2 个校准我们判断的数据点</strong>：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>类型</th>
<th>内容</th>
<th>处置</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--star" style="height:1.4em;width:auto;vertical-align:middle" title="⭐" alt="⭐" /> 该试</td>
<td><code>--prompt-cache-spread</code>（0.1.50 新开关，他没开，但正是他描述的痛点的解药）</td>
<td>单独 A/B</td>
</tr>
<tr>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--star" style="height:1.4em;width:auto;vertical-align:middle" title="⭐" alt="⭐" /> 该试</td>
<td><code>STRATA_HC_Q8=1</code>（他开了；NVIDIA 上是精度项，官方 opt-in "until decided"）</td>
<td>质量向，单独验</td>
</tr>
<tr>
<td>可选</td>
<td><code>--conversation-cache-park-gain N</code></td>
<td>与上一条一起试更省事</td>
</tr>
<tr>
<td>校准</td>
<td>prefill 3,646 tok/s @122K（八通道 EPYC）vs 我们 3,186–3,209 ⇒ <strong>我们已贴着单机上限</strong></td>
<td>不必再找 prefill 参数</td>
</tr>
<tr>
<td>校准</td>
<td>双 3090（48G 显存）只拿到 52% 缓存、decode 110–117 &lt; 我们 <strong>116–127</strong></td>
<td>再次确认「多卡不加分」</td>
</tr>
</tbody>
</table>
<h2>0 结论</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>开关</th>
<th>结论</th>
<th>量级</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--conversation-cache-park-gain 1024</code></td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✅" alt="✅" /> <strong>主力收益</strong></td>
<td>短追加耗时 <strong>−33%~−50%</strong> 且不再随轮数爬升；改写靠后内容 <strong>4.57 s → 2.02 s（−56%）</strong>；park 写入 <strong>≈6.5 GB → 0.63 GB</strong></td>
</tr>
<tr>
<td><code>--prompt-cache-spread</code></td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✅" alt="✅" /> 可上，收益窄</td>
<td>只在「检查点多到被挤爆 + 深改写」时成立：复用 4.7% → 17.1%、5.50 s → 5.05 s（<strong>−8%</strong>）；其余场景逐位相同</td>
</tr>
<tr>
<td><code>STRATA_HC_Q8=1</code></td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 质量/内存项，非速度项</td>
<td>少加载 <strong>1.2 GiB</strong> 稠密权重、<strong>+108~134 槽</strong>；4 个质量用例输出<strong>逐字节相同</strong>；decode +3~4%（噪声大）</td>
</tr>
<tr>
<td>三项合并</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✅" alt="✅" /> 无互相干扰</td>
<td>冷读 14.03→14.15 s、追加 715→690 ms（均在噪声内）；4 个质量用例仍逐字节相同</td>
</tr>
</tbody>
</table>
<h2>4 park 抖动（18K 会话，连续 6 个短追加）</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>步</th>
<th>base prompt_ms</th>
<th>parkgain</th>
<th>combo</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>394</td>
<td>489</td>
<td>429</td>
</tr>
<tr>
<td>2</td>
<td>523</td>
<td>351</td>
<td>259</td>
</tr>
<tr>
<td>3</td>
<td>579</td>
<td>356</td>
<td>262</td>
</tr>
<tr>
<td>4</td>
<td>636</td>
<td>407</td>
<td>275</td>
</tr>
<tr>
<td>5</td>
<td>641</td>
<td>376</td>
<td>275</td>
</tr>
<tr>
<td>6</td>
<td><strong>753</strong></td>
<td><strong>379</strong></td>
<td><strong>277</strong></td>
</tr>
<tr>
<td>均值</td>
<td><strong>588</strong></td>
<td>393（−33%）</td>
<td>296（−50%）</td>
</tr>
</tbody>
</table>
<p dir="auto">日志（<code>logs/base.log</code>）：<strong>每一轮都写一整份快照，再把上一份丢掉</strong> ——</p>
<p dir="auto">6 轮累计写入 ≈ <strong>6.5 GB</strong>，且每轮耗时单调爬升（394→753 ms，纯 I/O 抖动）。<br />
<code>--conversation-cache-park-gain 1024</code> 后：<strong>只 park 一次 632,821,052 字节（0.63 GB）</strong>，耗时 170 ms，后续轮次不再写。</p>
<p dir="auto">代价（官方口径）：从旧快照 resume 时最多重读 1024 token ≈ 0.3 s，可接受。</p>
<h2>5 <code>STRATA_HC_Q8=1</code></h2>
<p dir="auto">启动指纹：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th></th>
<th>base</th>
<th>hcq8</th>
</tr>
</thead>
<tbody>
<tr>
<td>稠密权重加载</td>
<td><strong>1,466 MiB</strong>（302 张走了 native）</td>
<td><strong>266 MiB</strong>（494 张走 native）</td>
</tr>
<tr>
<td>专家缓存槽位</td>
<td>11,122</td>
<td><strong>11,256（+134）</strong></td>
</tr>
<tr>
<td><code>VRAM free with everything loaded</code></td>
<td>2,656 MiB</td>
<td>2,562 MiB</td>
</tr>
</tbody>
</table>
<ul>
<li>机制：默认 pack 里 <code>--compat-bf16</code> 的 Q8_0 HC 投影被舍成 BF16（字节翻倍），<code>=1</code> 直读文件自带 Q8_0 ⇒ <strong>少搬 1.2 GiB 稠密权重</strong>，多出 100+ 槽。</li>
<li>质量：4 个用例（物理计算 / 代码 / 4K needle 检索 / 中文指令遵循）输出 <strong>4/4 逐字节相同</strong>（base vs hcq8、base vs combo 都比过）。</li>
<li>decode（4K prompt、256 token、3 跑）：base <code>91.9 / 122.0 / 123.8</code>，hcq8 <code>95.2 / 121.3 / 136.6</code>，combo <code>95.1 / 126.8 / 127.5</code> ⇒ 同向偏高 3~4%，但<strong>样本太少、不能当结论</strong>。</li>
<li>官方状态仍是 "opt-in until decided"，且明确<strong>会改输出</strong>（精度更高：KL 0.0562→0.0526）。我们的 4 个用例没照出来，不等于永不改。</li>
</ul>
<h2>6 建议</h2>
<ol>
<li><strong><code>--conversation-cache-park-gain 1024</code> 直接上</strong> —— 收益最大、风险最低（只影响「哪份快照保留」，不改答案、不加内存）。</li>
<li><strong><code>--prompt-cache-spread</code> 一起上</strong> —— 零成本，改写场景 8%~20%，深上下文会话收益更大。</li>
<li><strong><code>STRATA_HC_Q8=1</code> 由用户决定</strong> —— 它是精度/内存项而不是速度项；本机 4 用例无差异、多 100+ 槽、少搬 1.2 GiB，但上游仍标 opt-in。</li>
<li>三项都<strong>不动冷读与普通追加</strong>：prefill 仍贴着 3,300 tok/s 的内存带宽上限，别再找参数。</li>
</ol>
]]></description><link>https://lcz.me/post/28220</link><guid isPermaLink="true">https://lcz.me/post/28220</guid><dc:creator><![CDATA[marsempire]]></dc:creator><pubDate>Tue, 27 Oct 2026 06:50:46 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Tue, 27 Oct 2026 06:12:38 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peace-love" aria-label="Profile: Peace-Love">@<bdi>Peace-Love</bdi></a> <a href="/post/28088">说</a>:</p>
</blockquote>
<blockquote>
<p dir="auto">還是說這種事也能丟給AI 去自動跑測試分析?</p>
</blockquote>
<p dir="auto">之前刚用的时候挺上头的，每天看到strata更新，就让ai帮我更新，坛里有帖子也让ai读了做参考，它要确认升级后提升多少，或者参数是否值得改，都要前后跑三轮做对比，我也就随便它，加上电脑升级内存硬盘cpu，都要折腾几次，慢慢就累积了这些。三分钟热度过去后这次更新隔了好多个版本，就想着让它总结下，顺便发上来。<br />
当中工作区移动过，我总感觉它总结时漏了些什么，应该还不止这些，但我技术小白，实在想不起来了…… <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f602.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--joy" style="height:1.4em;width:auto;vertical-align:middle" title=":joy:" alt="😂" /></p>
]]></description><link>https://lcz.me/post/28203</link><guid isPermaLink="true">https://lcz.me/post/28203</guid><dc:creator><![CDATA[marsempire]]></dc:creator><pubDate>Tue, 27 Oct 2026 06:12:38 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Tue, 27 Oct 2026 04:07:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/x%E4%B8%80%E6%A3%B5%E6%A0%91" aria-label="Profile: X一棵树">@<bdi>X一棵树</bdi></a> 之前用vllm sglang 留下来的</p>
]]></description><link>https://lcz.me/post/28152</link><guid isPermaLink="true">https://lcz.me/post/28152</guid><dc:creator><![CDATA[applejuice]]></dc:creator><pubDate>Tue, 27 Oct 2026 04:07:15 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Tue, 27 Oct 2026 03:50:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/applejuice" aria-label="Profile: applejuice">@<bdi>applejuice</bdi></a> p2p在starta 里面没有收益呀</p>
]]></description><link>https://lcz.me/post/28137</link><guid isPermaLink="true">https://lcz.me/post/28137</guid><dc:creator><![CDATA[X一棵树]]></dc:creator><pubDate>Tue, 27 Oct 2026 03:50:39 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Tue, 27 Oct 2026 03:00:13 GMT]]></title><description><![CDATA[<p dir="auto">刚好 我也转用swift 1.5<br />
叫ai总结的</p>
<h2>1. 硬件与软件</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项目</th>
<th>我</th>
<th>楼主</th>
</tr>
</thead>
<tbody>
<tr>
<td>GPU</td>
<td>2 × RTX 3090 24GB（每张限 250 W；已用 gpu-unlock 解锁全速 FP16/BF16）</td>
<td>1 × RTX 4080 SUPER 32GB</td>
</tr>
<tr>
<td>CPU</td>
<td>AMD EPYC 7452（32 核）</td>
<td>i7-11700K（8 核 16 线程）</td>
</tr>
<tr>
<td>内存</td>
<td>256 GB DDR4-2666（8 通道）</td>
<td>128 GB DDR4-3200</td>
</tr>
<tr>
<td>总线</td>
<td>每张卡 PCIe 4.0 x16，两卡之间开启 P2P（约 26 GB/s）</td>
<td>PCIe 4.0 x16</td>
</tr>
<tr>
<td>模型盘</td>
<td>NVMe（载入速度 4.07 GiB/s）</td>
<td>Samsung 990 PRO（6.51 GiB/s）</td>
</tr>
<tr>
<td>系统</td>
<td>Linux（Docker）</td>
<td>Windows 11</td>
</tr>
<tr>
<td>Strata 版本</td>
<td>sergqwer 的 fork <strong>0.1.44.1-nvfp4.2</strong>（引擎 0.1.44.1）</td>
<td>官方 <strong>v0.2.5</strong>（引擎 0.1.50）</td>
</tr>
<tr>
<td>模型</td>
<td>Swift 1.5 Flash-Next <strong>IQ4_XS</strong>（UkisAI 官方 GGUF，97.7 GB；专家 gate/up 为 IQ4_XS，down 为 IQ4_NL）</td>
<td>Swift 1.5 Flash-Next <strong>IQ3_S</strong>（GSQ-RCO）</td>
</tr>
<tr>
<td>专家表大小（在内存中）</td>
<td>60.94 GiB</td>
<td>46.84 GiB</td>
</tr>
<tr>
<td>显存里的专家缓存</td>
<td><strong>两张卡合计 12,668 个专家，31.4 GiB，约占全部 24,576 个的 52 %</strong>（GPU 0 负责第 0–23 层，6,485 个 / 16.08 GiB；GPU 1 负责第 24–47 层，6,183 个 / 15.33 GiB）</td>
<td>约 11.1k 个，21.1 GiB（约 45 %）</td>
</tr>
<tr>
<td>上下文</td>
<td><strong>512K</strong>（YaRN ×2）</td>
<td>262K（原生）</td>
</tr>
</tbody>
</table>
<h2>2. 参数逐项对比</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>参数</th>
<th>我</th>
<th>楼主</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--expert-cache</code> / <code>--prefill</code></td>
<td>auto / auto</td>
<td>auto / auto</td>
</tr>
<tr>
<td><code>--spec</code> / <code>--spec-min-p</code></td>
<td>4 / 0.5</td>
<td>4 / 0.5</td>
</tr>
<tr>
<td><code>--mtp</code></td>
<td>原版模型的 MTP 草稿层（rt）</td>
<td>同</td>
</tr>
<tr>
<td><code>--max-context</code></td>
<td>524288 + <code>--rope-scaling yarn --rope-scale 2</code></td>
<td>262144</td>
</tr>
<tr>
<td><code>--kv</code> / <code>--kv-resident</code></td>
<td>int8 / 32768</td>
<td>int8 / 32768</td>
</tr>
<tr>
<td><code>--vision</code></td>
<td>开启，图像编码器放在 GPU 上并常驻</td>
<td>开启，<code>vision.elastic: true</code>（按需加载，空闲 120 秒后卸载）</td>
</tr>
<tr>
<td><code>--vram-reserve-mib</code></td>
<td>700，另加 <code>--vram-reserve-later-mib 1221</code></td>
<td>3072</td>
</tr>
<tr>
<td><code>--conversation-cache-mib</code></td>
<td><strong>65536（64 GiB 内存）</strong></td>
<td>8192</td>
</tr>
<tr>
<td><code>--conversation-cache-slots</code></td>
<td>8</td>
<td>4</td>
</tr>
<tr>
<td><code>--conversation-cache-min-tokens</code></td>
<td>8192</td>
<td>4096</td>
</tr>
<tr>
<td><code>--prompt-cache</code> / <code>--prompt-cache-tail</code></td>
<td>未设（用默认值）</td>
<td>16 / 开启</td>
</tr>
<tr>
<td><code>--pipeline-windows</code> / <code>--pcie-frac</code></td>
<td>2 / 0</td>
<td>无</td>
</tr>
<tr>
<td><code>--host-core</code></td>
<td>未设</td>
<td><code>last</code></td>
</tr>
<tr>
<td>卡与分层</td>
<td><code>gpu: [0,1]</code>，<code>layer_split: auto</code></td>
<td>单卡</td>
</tr>
<tr>
<td><code>STRATA_HC_Q8</code></td>
<td>1</td>
<td>未提</td>
</tr>
<tr>
<td><code>STRATA_ROUTE_TAIL_SKIP</code></td>
<td>0（关闭）</td>
<td>不建议开</td>
</tr>
<tr>
<td><code>STRATA_CACHE_MESSAGE_BOUNDARY</code></td>
<td>未设</td>
<td>1</td>
</tr>
<tr>
<td>默认思考强度</td>
<td><strong>xhigh</strong>（shared-settings 里的 <code>reasoning_effort</code>）</td>
<td>未提</td>
</tr>
<tr>
<td>思考上限</td>
<td><code>reasoning_budget_tokens</code> 32768，<code>fit_max_tokens</code> 开启</td>
<td>未提</td>
</tr>
<tr>
<td>采样</td>
<td>temperature 1.0 / top_p 0.95 / top_k 20</td>
<td>未提</td>
</tr>
<tr>
<td>思考死循环处理</td>
<td><code>reasoning_loop_recovery: "stop"</code></td>
<td>未提</td>
</tr>
</tbody>
</table>
<h2>3. 性能</h2>
<p dir="auto">两边的测法不同。楼主用的是官方 benchmark，131K 上下文、输出 256 个 token。我用自己的脚本：解码在短上下文下测，prefill 测 19K 到 122K。所以下表只能做大致比较。</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指标</th>
<th>我（双 3090，IQ4_XS）</th>
<th>楼主（4080S 32GB，IQ3_S）</th>
</tr>
</thead>
<tbody>
<tr>
<td>解码</td>
<td>短上下文：中文散文 110、中文对话 117、英文 116、代码 195 tok/s</td>
<td>131K 上下文：116–127 tok/s（预热后）；冷启动首轮 95–99</td>
</tr>
<tr>
<td>Prefill</td>
<td>19K：3,319；43K：3,853；89K：3,781；122K：3,646 tok/s</td>
<td>131K：3,186–3,209 tok/s</td>
</tr>
<tr>
<td>首字延迟（TTFT）</td>
<td>122K：33.6 s</td>
<td>131K：41 s</td>
</tr>
<tr>
<td>冷启动到可用</td>
<td>约 60 s</td>
<td>24.1 s</td>
</tr>
<tr>
<td>专家缓存命中率</td>
<td>日常实际使用（agent、中英文混合、看图）：88–95 %</td>
<td>同一个 benchmark 连跑 3 次：95 % → 99 %</td>
</tr>
</tbody>
</table>
<p dir="auto">我这台机器上，Swift IQ4_XS 和之前用的 UD-Q4_K_XL 对比：</p>
<ul>
<li>解码快 14–22 %，19K 的 prefill 快 26 %；</li>
<li>同样用 xhigh，思考 token 少约 59 %；</li>
<li>整机内存占用少约 40 GB。</li>
</ul>
<h2>4. 质量快测（我，Swift IQ4_XS，默认 xhigh）</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>测试</th>
<th>结果</th>
</tr>
</thead>
<tbody>
<tr>
<td>指令遵循：15 项中英文格式要求 × 2 个种子（JSON、条目数、字数、全小写、表格、只输出中文等）</td>
<td>30/30</td>
</tr>
<tr>
<td>较难推理：15 题 × 2 个种子（数学、逻辑谜题，以及两道用单元测试判分的代码题）</td>
<td>30/30，平均每题约 650 token、5 秒</td>
</tr>
<tr>
<td>长文检索：64K–512K，每个长度 9 题</td>
<td>37/45（之前的 IQ3_S 为 34/45）</td>
</tr>
</tbody>
</table>
]]></description><link>https://lcz.me/post/28120</link><guid isPermaLink="true">https://lcz.me/post/28120</guid><dc:creator><![CDATA[applejuice]]></dc:creator><pubDate>Tue, 27 Oct 2026 03:00:13 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Mon, 26 Oct 2026 21:08:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peace-love" aria-label="Profile: Peace-Love">@<bdi>Peace-Love</bdi></a> 我都用我家的工業辣雞3060裝上iq3_s去測我主力電腦模型...找出最佳參數，然後我就去睡了，起來收報告，當然嫌慢的話ds也很好用</p>
]]></description><link>https://lcz.me/post/28089</link><guid isPermaLink="true">https://lcz.me/post/28089</guid><dc:creator><![CDATA[David Chen]]></dc:creator><pubDate>Mon, 26 Oct 2026 21:08:42 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Mon, 26 Oct 2026 20:52:55 GMT]]></title><description><![CDATA[<p dir="auto">我竟是第一個給樓主按讚的?</p>
<p dir="auto">這樓主太強了, 竟把一大堆參數扒了一遍  , 還測試分析了關鍵參數, 令人頭皮發麻   <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f44d.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--+1" style="height:1.4em;width:auto;vertical-align:middle" title="👍" alt="👍" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f44d.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--+1" style="height:1.4em;width:auto;vertical-align:middle" title="👍" alt="👍" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f44d.png?v=b5f8626d144" class="not-responsive emoji emoji-android emoji--+1" style="height:1.4em;width:auto;vertical-align:middle" title="👍" alt="👍" /></p>
<p dir="auto">還是說這種事也能丟給AI 去自動跑測試分析?</p>
]]></description><link>https://lcz.me/post/28088</link><guid isPermaLink="true">https://lcz.me/post/28088</guid><dc:creator><![CDATA[Peace Love]]></dc:creator><pubDate>Mon, 26 Oct 2026 20:52:55 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Mon, 26 Oct 2026 16:59:58 GMT]]></title><description><![CDATA[<p dir="auto">好帖子，感谢老大分享。</p>
]]></description><link>https://lcz.me/post/28073</link><guid isPermaLink="true">https://lcz.me/post/28073</guid><dc:creator><![CDATA[tom23]]></dc:creator><pubDate>Mon, 26 Oct 2026 16:59:58 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Sun, 25 Oct 2026 16:02:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/xiunan-zhi" aria-label="Profile: XIUNAN-ZHI">@<bdi>XIUNAN-ZHI</bdi></a></p>
<p dir="auto">我觉得他是在不断 dram &amp; vram 里面的数据交换</p>
]]></description><link>https://lcz.me/post/27738</link><guid isPermaLink="true">https://lcz.me/post/27738</guid><dc:creator><![CDATA[imbiplaza ASUS]]></dc:creator><pubDate>Sun, 25 Oct 2026 16:02:02 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Sun, 25 Oct 2026 15:50:23 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a href="/user/imbiplaza-asus">@imbiplaza ASUS</a> <a href="/post/27733">说</a>:</p>
<p dir="auto">我比较在意他的pcie 传输速度，得益于gen5 x16, 50g/s - 60g/s</p>
</blockquote>
<p dir="auto">满速率的gen5 x16？prefill快一点？</p>
]]></description><link>https://lcz.me/post/27735</link><guid isPermaLink="true">https://lcz.me/post/27735</guid><dc:creator><![CDATA[XIUNAN ZHI]]></dc:creator><pubDate>Sun, 25 Oct 2026 15:50:23 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Sun, 25 Oct 2026 15:10:26 GMT]]></title><description><![CDATA[<p dir="auto">我比较在意他的pcie 传输速度，得益于gen5 x16,</p>
<p dir="auto">50g/s - 60g/s</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/1a6d3744-0217-46de-93a5-c162ae2be430.png" alt="Screenshot 2026-10-24 231012.png" class="img-markdown  img-fluid" /></p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/6e9029c4-42b1-4651-9e6c-c57e0ec884a3.jpeg" alt="image.jpeg" class="img-markdown  img-fluid" /></p>
]]></description><link>https://lcz.me/post/27733</link><guid isPermaLink="true">https://lcz.me/post/27733</guid><dc:creator><![CDATA[imbiplaza ASUS]]></dc:creator><pubDate>Sun, 25 Oct 2026 15:10:26 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Sun, 25 Oct 2026 14:36:48 GMT]]></title><description><![CDATA[<p dir="auto">很詳細<br />
Strata的小缺點就是太多參數了，版本越更新加越多<br />
小寫參數跟大寫參數滿天飛</p>
]]></description><link>https://lcz.me/post/27730</link><guid isPermaLink="true">https://lcz.me/post/27730</guid><dc:creator><![CDATA[he wanga]]></dc:creator><pubDate>Sun, 25 Oct 2026 14:36:48 GMT</pubDate></item><item><title><![CDATA[Reply to strata优化个人总结 on Sun, 25 Oct 2026 14:10:58 GMT]]></title><description><![CDATA[<p dir="auto">多谢分享，刚买了一张4080，有时间抄作业试一下</p>
]]></description><link>https://lcz.me/post/27725</link><guid isPermaLink="true">https://lcz.me/post/27725</guid><dc:creator><![CDATA[XIUNAN ZHI]]></dc:creator><pubDate>Sun, 25 Oct 2026 14:10:58 GMT</pubDate></item></channel></rss>