<?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[[实测] RX 9070 16G单卡部署strata & qwen 27b gsq 256k经验]]></title><description><![CDATA[<h2>前言</h2>
<p dir="auto">上半年经常看老特的本地llm部署视频，虽然感觉满足了好奇心，但是因为手上没有硬件+没有依靠本地AI来赚钱的需求，一直也只是看看。最近出了strata这个框架，又听说gsq量化的qwen 27b模型不错，依靠手头已经有的硬件很可能可以实现本地token自由，于是画了两个周末调研+折腾了一下。下面就是折腾的成果，希望给同样使用RDNA4消费级显卡的朋友一点信心。如果大家看了这个下面的设置能指点指点就更好了。</p>
<h2>硬件</h2>
<p dir="auto">RX 9070 16 GB / Ryzen 7 5700X / B450m主板 / 64 GB DDR4-3133 / Intel Optane 905P 1.5t<br />
相比各位大神这个配置应该是比较寒酸的，因为这个是我的游戏电脑，没有往里面投钱的动力，是这样的。<br />
为了跑strata，唯一做的改动是内存。原本我用的是一对16g的ddr4 3600内存。看了chiphell的帖子说只要有16g vram+64g ram就可以跑效果几乎无损的iq3_s量化模型，于是从一台当前比较空闲的小主机上抠下了两根32g 3200mhz的内存，然后去pdd花30买了两条笔记本内存转接卡。也因为用了转接卡可能信号有损失，要降频到3133mhz才能亮机。也试过混插原本的32g，结果会进一步拉低内存频率，最多2133mhz。考虑到strata可能对内存带宽比较高，于是就只用64g了。<br />
傲腾是去年存储低位的时候在亚马逊淘的。在我当前的配置下其实它的随机读写性能优势相对一般nvme ssd不能产生什么增益，详见后文。</p>
<h2>系统</h2>
<p dir="auto">Ubuntu Server 24.04.5，内核 6.17.0-42，ROCm 7.2.4（gfx1201）。<br />
这里先声明一下，我的agent跑在我日常使用的mac上。推理机就只做推理，完全不跑任何别的东西。所以同等配置我能用的系统资源会比较多<br />
系统层次的优化主要就是把ubuntu的后台更新服务关掉了，别的也没干什么。</p>
<p dir="auto">下面的内容主要都是deepseek帮我总结的了，有想复现的喂一下agent让它复现就好。<br />
我选用了strata 0.1.45和kvmem分别作为flash next和27b的引擎。我原本以为我的配置只能跑大概96-128k的上下文，但是通过实验，我发现只要牺牲一点点速度，就可以换来更长的上下文，减少触发压缩的频次，提高体验。以下的配置都是基于长对话优先来配的，尽可能利用系统资源。</p>
<hr />
<h2>0. 软件栈版本与构建</h2>
<h3>0.1 基础环境</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>版本</th>
</tr>
</thead>
<tbody>
<tr>
<td>系统</td>
<td>Ubuntu 24.04.5 LTS，内核 6.17.0-42-generic</td>
</tr>
<tr>
<td>GPU</td>
<td>AMD Radeon RX 9070 16 GB（gfx1201）</td>
</tr>
<tr>
<td>ROCm</td>
<td><strong>7.2.4</strong>（<code>rocm-core 7.2.4</code> / <code>hip-runtime-amd 7.2.53211.70204</code>）</td>
</tr>
<tr>
<td>LLVM/编译器</td>
<td>ROCm 自带 clang（<code>/opt/rocm-7.2.4/llvm/bin/clang++</code>）</td>
</tr>
<tr>
<td>磁盘</td>
<td>Intel Optane 905P（<code>/data</code>，ext4 noatime）；WD Elements USB SSD（<code>/</code>，系统盘 + 备份）</td>
</tr>
</tbody>
</table>
<h3>0.2 KVMem（llama.cpp fork，27B 服务）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>值</th>
</tr>
</thead>
<tbody>
<tr>
<td>KVMem 版本</td>
<td><strong>0.18.0</strong>（repo commit <code>faf3c22</code>）</td>
</tr>
<tr>
<td>vendored llama.cpp</td>
<td><strong><code>620d2225c</code></strong>（上游 v0.7.0）</td>
</tr>
<tr>
<td>构建目录</td>
<td><code>/data/src/kvmem/build-hip-linux</code></td>
</tr>
<tr>
<td>CMake</td>
<td><code>-DCMAKE_BUILD_TYPE=Release -DGGML_HIP=ON -DGGML_VULKAN=OFF -DGPU_TARGETS=gfx1201</code>，<code>ROCM_PATH=/opt/rocm-7.2.4</code>，<code>CMAKE_HIP_ARCHITECTURES=gfx1201</code></td>
</tr>
<tr>
<td>入口</td>
<td><code>python3 scripts/build-rocm.py --linux --rocm /opt/rocm --gpu-targets gfx1201 --jobs 8</code></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>本地修复（ROCm 7.2.4 下官方源码不能直接编过，共 4 处）</strong>：</p>
<ol>
<li><strong><code>CMakeLists.txt</code></strong>：<code>kvmem-stagein-hip</code> 目标补 <code>kvmem/include</code>（官方漏了该 include 目录）</li>
<li><strong><code>backends/patches/llamacpp-kvmem.patch</code></strong>：把补丁里新增的 <code>cudaPeekAtLastError()</code> 改为 <code>hipPeekAtLastError()</code>（ROCm 无 CUDA 运行时名），并同步更新 <code>backends/versions.json</code> 的 <code>patch_sha256</code></li>
<li><strong>清理补丁残留</strong>：失败重试会留下未跟踪文件（<code>src/llama-kvmem-factory.h</code>），导致 <code>git apply</code> 报"已存在"</li>
<li><strong><code>compat/cuda_runtime.h</code> 垫片</strong>：两个 adapter TU（<code>llama-memory-kvmem.cpp</code> / <code>-mtp.cpp</code>）以普通 C++ 编译却 <code>#include &lt;cuda_runtime.h&gt;</code>；提供最小垫片（include <code>hip/hip_runtime.h</code> + <code>cuda*</code>→<code>hip*</code> 宏），并在 CMake 给这两个文件加 <code>-I compat -I /opt/rocm/include -D__HIP_PLATFORM_AMD__=1</code></li>
</ol>
<h3>0.3 Strata（125B 服务）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>值</th>
</tr>
</thead>
<tbody>
<tr>
<td>版本</td>
<td><strong>0.1.45</strong>（源码 commit <code>477ac13</code>）</td>
</tr>
<tr>
<td>构建</td>
<td><code>engine/BUILD.json</code>：<code>source: local-hip</code>、<code>backend: hip</code>、<code>archs: [gfx1201]</code>、<code>src b95137167bd9b751</code></td>
</tr>
<tr>
<td>构建目录</td>
<td><code>/data/src/Strata/build-hip</code>，<code>CMAKE_BUILD_TYPE=Release</code></td>
</tr>
<tr>
<td>CMake 开关</td>
<td><code>STRATA_ENABLE_HIP=ON</code>、<code>STRATA_ENABLE_CUDA=OFF</code>、<code>STRATA_ENABLE_SYCL=OFF</code>、<code>STRATA_NATIVE_EXPERTS=ON</code>、<code>STRATA_MMQ_KQUANTS=ON</code>、<code>STRATA_MMQ_TAB=OFF</code>、<code>STRATA_BUILD_TESTS=OFF</code>；<code>CMAKE_HIP_COMPILER=/opt/rocm/llvm/bin/clang++</code>、<code>CMAKE_HIP_ARCHITECTURES=gfx1201</code></td>
</tr>
<tr>
<td>运行时环境</td>
<td><code>STRATA_HIPBLASLT_TUNING=/data/src/Strata/tools/hip/gfx1201-hipblaslt-100202.txt</code>、<code>lib_dirs=/opt/rocm/lib</code>、<code>backend=hip</code></td>
</tr>
<tr>
<td>数据</td>
<td>pack <code>iq3_s</code>（49 GB，experts.bin + dense）、原生长张量 + PLE 分片（GGUF，79 GB）、MTP 草稿层（6.5 GB）</td>
</tr>
</tbody>
</table>
<h2>1. Qwen3.8-27B（KVMem 虚拟化 KV，<code>kvmem.service</code>）</h2>
<h3>1.1 启动命令（systemd <code>ExecStart</code>）</h3>
<pre><code class="language-ini">ExecStart=/data/src/kvmem/build-hip-linux/bin/llama-kvmem-server \
  -m /data/models/gsq/Qwen3.8-27B-GSQ-RCO-IQ3_S-mtp.gguf \
  --mmproj /data/models/mmproj/mmproj-Qwen3.8-27B-Q5_K-MIX.gguf --no-mmproj-offload \
  --device ROCm0 --split-mode layer -ngl 99 -fa on --load-mode auto \
  --host 0.0.0.0 --port 8080 \
  -c 262144 -b 512 -n 16384 \
  --kvmem --kvmem-lrfu --kvmem-budget 32768 --kvmem-gen-reserve 16384 \
  --kvmem-block-tokens 128 --kvmem-query-policy user --kv-dtype q8_0 \
  --kvmem-host-mib 49152 --kvmem-sessions 8 \
  --spec-type draft-mtp --spec-draft-n-max 3 --spec-kv-dtype f16 \
  --kvmem-mtp-state replay --image-max-tokens 512 \
  --enable-thinking --reasoning-budget 4096 \
  --chat-template-file /data/models/templates/chat_template.jinja \
  --temp 1.0 --top-k 20 --top-p 0.95 --min-p 0 --presence-penalty 0.0 --repeat-penalty 1.0
</code></pre>
<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>-m</code></td>
<td><code>Qwen3.8-27B-GSQ-RCO-IQ3_S-mtp.gguf</code>（12.12 GB）</td>
<td>27B 3.5 bpw 权重，自带 MTP 头</td>
</tr>
<tr>
<td><code>--mmproj</code> / <code>--no-mmproj-offload</code></td>
<td>Q5_K_MIX（331 MiB）</td>
<td>视觉投影器；跑在 CPU，不占显存</td>
</tr>
<tr>
<td><code>--device ROCm0</code> / <code>--split-mode layer</code></td>
<td>单卡</td>
<td>全部层上 GPU</td>
</tr>
<tr>
<td><code>-ngl 99</code></td>
<td>99</td>
<td>权重全量 offload</td>
</tr>
<tr>
<td><code>-fa on</code></td>
<td>开</td>
<td>flash attention（显式）</td>
</tr>
<tr>
<td><code>--load-mode auto</code></td>
<td>Linux 默认</td>
<td>自动选加载方式</td>
</tr>
<tr>
<td><code>-c 262144</code></td>
<td>262,144</td>
<td><strong>逻辑上下文</strong>（模型原生窗口）</td>
</tr>
<tr>
<td><code>-b 512</code></td>
<td>512</td>
<td>逻辑 batch</td>
</tr>
<tr>
<td><code>-n 16384</code></td>
<td>16,384</td>
<td>单轮输出上限 = 生成预留</td>
</tr>
<tr>
<td><code>--kvmem</code></td>
<td>开</td>
<td>启用 KV 虚拟化</td>
</tr>
<tr>
<td><code>--kvmem-lrfu</code></td>
<td>开</td>
<td>检索历史按相关度加权（LRFU）</td>
</tr>
<tr>
<td><code>--kvmem-budget 32768</code></td>
<td>32,768 token</td>
<td><strong>GPU 工作集</strong>（sink 12K + recent 1K + 检索块）</td>
</tr>
<tr>
<td><code>--kvmem-gen-reserve 16384</code></td>
<td>16,384 token</td>
<td>生成追加空间（单轮输出被它限制）</td>
</tr>
<tr>
<td><code>--kvmem-block-tokens 128</code></td>
<td>128</td>
<td>检索块粒度</td>
</tr>
<tr>
<td><code>--kvmem-query-policy user</code></td>
<td>user</td>
<td>用最后一条用户消息作为检索查询</td>
</tr>
<tr>
<td><code>--kv-dtype q8_0</code></td>
<td>q8_0</td>
<td>主 KV 格式（≈34 KiB/token）</td>
</tr>
<tr>
<td><code>--kvmem-host-mib 49152</code></td>
<td><strong>48 GiB</strong></td>
<td>主机侧会话 KV 配额</td>
</tr>
<tr>
<td><code>--kvmem-sessions 8</code></td>
<td>8</td>
<td>最多保留 8 个会话</td>
</tr>
<tr>
<td><code>--spec-type draft-mtp</code></td>
<td>draft-mtp</td>
<td>投机解码：用模型自带 MTP 头</td>
</tr>
<tr>
<td><code>--spec-draft-n-max 3</code></td>
<td>3</td>
<td>每步最多 3 个草稿 token</td>
</tr>
<tr>
<td><code>--spec-kv-dtype f16</code></td>
<td>f16</td>
<td>MTP 草稿 KV 精度</td>
</tr>
<tr>
<td><code>--kvmem-mtp-state replay</code></td>
<td>replay</td>
<td>MTP 状态随会话分页/replay</td>
</tr>
<tr>
<td><code>--enable-thinking</code> / <code>--reasoning-budget 4096</code></td>
<td>4,096</td>
<td>开思考，思考预算 4K</td>
</tr>
<tr>
<td><code>--chat-template-file</code></td>
<td>froggeric v22.5</td>
<td>修复版模板（默认 medium 思考）</td>
</tr>
<tr>
<td>采样</td>
<td>官方思考套</td>
<td>temp 1.0 / top_p 0.95 / top_k 20 / min_p 0 / presence 0 / repeat 1.0</td>
</tr>
</tbody>
</table>
<h3>1.3 采用的优化与实测效果</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>优化</th>
<th>做了什么</th>
<th>效果（实测，2026-10-18/19）</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>KV 虚拟化</strong></td>
<td>GPU 只放 32,768 token 工作集，其余历史分页到主机 RAM（48 GiB 配额）</td>
<td>逻辑上下文 <strong>262,144</strong>；<strong>150K needle 命中</strong>（prefill <strong>694 t/s</strong>、decode <strong>42.0 t/s</strong>、冷读 219s）；<strong>253K needle 命中</strong>（prefill <strong>637 t/s</strong>、decode <strong>39.1 t/s</strong>、冷读 401s）</td>
</tr>
<tr>
<td><strong>多轮复用</strong></td>
<td>会话按 token 前缀识别，历史 KV 常驻主机</td>
<td>150K 历史下追问只处理 <strong>34 个新 token、3 秒返回</strong></td>
</tr>
<tr>
<td><strong>多会话保留</strong></td>
<td><code>--kvmem-sessions 8</code></td>
<td>A（150K）→ B（54.5K）→ 回 A：<strong>A 历史保留，34 token / 4 秒</strong></td>
</tr>
<tr>
<td><strong>MTP 投机</strong></td>
<td><code>draft-mtp</code> + <code>n-max 3</code> + replay</td>
<td>代码类 400-token 生成 <strong>62.0 → 66.5 t/s（+7%）</strong>；长文 decode 39–42；自由行文略降（44.5 vs 48.0）</td>
</tr>
<tr>
<td><strong>LRFU 检索</strong></td>
<td>历史块按查询相关度加权</td>
<td>长文召回更稳；150K/253K needle 均命中</td>
</tr>
<tr>
<td><strong>更大工作集</strong></td>
<td>budget 28,672 → <strong>32,768</strong></td>
<td>同时可见历史 +14%；显存 14.0 GB（仍有余量）</td>
</tr>
<tr>
<td><strong>修复版模板</strong></td>
<td>froggeric v22.5</td>
<td><a href="https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates" rel="nofollow ugc">https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates</a>, 默认 medium 思考（官方默认 xhigh）；<code>enable_thinking=false</code> → reasoning <strong>0</strong>；内联 <code>&lt;\|think_off\|&gt;</code> → reasoning <strong>0</strong>；<code>reasoning_effort:low</code> 254 字符 vs <code>xhigh</code> 633 字符</td>
</tr>
<tr>
<td><strong>官方采样</strong></td>
<td>temp 1.0 / top_p 0.95 / top_k 20 / min_p 0 / presence 0</td>
<td>与 Qwen 3.8 模型卡一致（思考模式）</td>
</tr>
<tr>
<td><strong>视觉加速</strong></td>
<td><code>--no-mmproj-offload</code></td>
<td>视觉编码走 CPU，不占显存</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>资源占用</strong>：显存 <strong>14.0–14.7 GiB</strong>（空闲 ~88 MiB 基线），主机内存 15–18 GiB（会话装满后），48 GiB 会话配额。</p>
<h3>1.4 已知上限</h3>
<ul>
<li>单 lane（<code>lanes=1</code>），同一时刻只服务一个请求；会话在内存 park。</li>
<li>decode <strong>39–45 t/s</strong>：dense 27B 的带宽上限（645 GB/s ÷ 12.1 GB ≈ <strong>53 t/s</strong> 理论值），参数调不动。</li>
<li>若要 70+ t/s，必须换 MoE（见 Strata）或更小模型（Bonsai 6.7 GB 实测 51.5 t/s）。</li>
</ul>
<h3>1.5 投机解码调参（<code>--spec-draft-n-max</code> 扫描，2026-10-19）</h3>
<p dir="auto">固定 400 token 生成、temp 0、短 prompt，端到端实测（KVMem 不吐接受率）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>任务</th>
<th style="text-align:right">n-max 2</th>
<th style="text-align:right"><strong>n-max 3（当前）</strong></th>
<th style="text-align:right">n-max 4</th>
<th style="text-align:right">n=3 + p-min 0.6</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>代码生成</strong>（结构可预测）</td>
<td style="text-align:right">62.0</td>
<td style="text-align:right"><strong>66.5（+7.3%）</strong></td>
<td style="text-align:right">66.3（无增益）</td>
<td style="text-align:right">65.6</td>
</tr>
<tr>
<td><strong>自由解释</strong>（中文说明）</td>
<td style="text-align:right"><strong>48.0</strong></td>
<td style="text-align:right">44.5（−7%）</td>
<td style="text-align:right">—</td>
<td style="text-align:right">45.5</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>结论</strong>：</p>
<ul>
<li><strong>n=3 是甜点</strong>；n=4 无收益（带宽受限）；<code>--spec-draft-p-min</code> 反而拖慢（0.75 时掉到 63），<strong>不加 gate</strong></li>
<li><strong>内容强相关</strong>：结构化/代码输出 n=3 更快；自由写作类 n=2 更快</li>
<li>任务映射：<strong>代码/agent/工具调用 → n=3</strong>；<strong>纯自由行文 → 可临时回 n=2</strong>；<strong>调研类（混合）→ 维持 n=3</strong>（工具调用段收益 + 长文 prefill 主导，n-max 影响小）</li>
<li>社区佐证：llama.cpp issue #30568（Strix Halo Vulkan n=4 腰斩）、sudoingX/qwen38-mtp（53 配置，建议 2~4 扫，带宽差加 p-min、快卡不加）</li>
</ul>
<hr />
<h2>2. Qwen3.8-Flash-Next 125B（Strata，<code>strata-256k.service</code>）</h2>
<h3>2.1 启动命令</h3>
<p dir="auto">systemd <code>ExecStart</code>：</p>
<pre><code class="language-ini">ExecStart=/data/src/Strata/.venv/bin/python /data/src/Strata/serve/server.py \
  --engine strata --config /data/src/Strata/strata-iq3_s-256k.json \
  --port 8080 --host 0.0.0.0 --slot-save-path /data/strata-slots
</code></pre>
<p dir="auto">引擎配置 <code>strata-iq3_s-256k.json</code> 的 <code>args</code>：</p>
<pre><code class="language-json">["--pack", "/data/src/Strata-data/packs/iq3_s",
 "--native", "/data/models/strata/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf",
 "--ple-gguf", "/data/models/strata/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf",
 "--expert-profile", "/data/src/Strata/data/expert-profile.bin",
 "--expert-cache", "auto",
 "--prefill", "auto",
 "--spec", "4",
 "--spec-min-p", "0.5",
 "--mtp", "/data/src/Strata-data/mtp/rt",
 "--max-context", "262144",
 "--kv", "k8v4",
 "--resident-experts",
 "--vram-reserve-mib", "1024"]
</code></pre>
<h3>2.2 参数逐条解释</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>参数</th>
<th>值</th>
<th>作用</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--pack</code></td>
<td><code>packs/iq3_s</code>（49 GB）</td>
<td>专家权重包（experts.bin 47 GB + dense 1.5 GB）</td>
</tr>
<tr>
<td><code>--native</code></td>
<td>IQ3_S 分片 1（52 GB）</td>
<td>原生长张量（302 个）从 GGUF 直接读</td>
</tr>
<tr>
<td><code>--ple-gguf</code></td>
<td>IQ3_S 分片 2（27 GB）</td>
<td>PLE 表（51.2 GB FP8 常量表）</td>
</tr>
<tr>
<td><code>--expert-profile</code></td>
<td><code>expert-profile.bin</code></td>
<td>预热专家槽位（启动时 3 秒完成）</td>
</tr>
<tr>
<td><code>--expert-cache auto</code></td>
<td>自动 → <strong>3,512 槽 / 6.72 GiB</strong></td>
<td>GPU 专家缓存；KV 让位后自动缩</td>
</tr>
<tr>
<td><code>--prefill auto</code></td>
<td>自动</td>
<td>预填充调度</td>
</tr>
<tr>
<td><code>--spec 4</code> / <code>--spec-min-p 0.5</code></td>
<td>4 / 0.5</td>
<td>MTP 投机解码（每步 4 草稿，最小概率 0.5）</td>
</tr>
<tr>
<td><code>--mtp</code></td>
<td><code>Strata-data/mtp/rt</code></td>
<td>MTP 草稿层（6.5 GB）</td>
</tr>
<tr>
<td><code>--max-context 262144</code></td>
<td>262,144</td>
<td>上下文上限（模型原生窗口）</td>
</tr>
<tr>
<td><code>--kv k8v4</code></td>
<td>K q8_0 / V q4_0</td>
<td><strong>混合 KV</strong>：13.06 KiB/token（f16 是 64 KiB）</td>
</tr>
<tr>
<td><code>--resident-experts</code></td>
<td>开</td>
<td>GPU 装不下的专家复制进 RAM（pageable，~44 GiB）</td>
</tr>
<tr>
<td><code>--vram-reserve-mib 1024</code></td>
<td>1,024</td>
<td>预留显存</td>
</tr>
<tr>
<td>serve <code>--slot-save-path</code></td>
<td><code>/data/strata-slots</code></td>
<td>会话存盘/恢复 API</td>
</tr>
</tbody>
</table>
<h3>2.3 采用的优化与实测效果</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>优化</th>
<th>做了什么</th>
<th>效果（实测，2026-10-18/19）</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>缩专家缓存换 256K</strong></td>
<td>4,906 → <strong>3,512 槽</strong>（9.34 → 6.72 GiB），KV 全放显存</td>
<td>上下文 <strong>96K → 262,144</strong>；显存 15.5–15.7 GiB（余 602–884 MiB）</td>
</tr>
<tr>
<td><strong>混合 KV（k8v4）</strong></td>
<td>K q8_0 + V q4_0 = 13.06 KiB/token</td>
<td>256K 的 KV 仅 <strong>3.27 GiB</strong>（f16 要 16 GiB）</td>
</tr>
<tr>
<td><strong>MTP 投机</strong></td>
<td><code>--spec 4 --spec-min-p 0.5</code></td>
<td>接收率 <strong>39/46（85%）</strong>；253K 下 decode <strong>56.4 t/s</strong>（dense 27B 的 1.5 倍）</td>
</tr>
<tr>
<td><strong>专家分页</strong></td>
<td><code>--resident-experts</code>（大页 + 8 GiB 守卫）</td>
<td>44 GiB 专家常驻 RAM；RAM 55 GiB / available ~7–9 GiB</td>
</tr>
<tr>
<td><strong>会话槽保存</strong></td>
<td><code>--slot-save-path</code> + <code>/slots/0?action=save\|restore</code></td>
<td>66K 会话：save <strong>0.86s / 1.06 GB</strong>，restore <strong>1.19s</strong>；恢复后追问 <strong>2s</strong>（34 新 token）</td>
</tr>
<tr>
<td><strong>前缀检查点</strong></td>
<td>引擎每 16K token 打检查点</td>
<td>同会话追加几乎 0 重读</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>实测（253,650 token 长文）</strong>：</p>
<ul>
<li>needle <strong>命中</strong>（RED-COMET-77，文本 ~46% 深度）</li>
<li>prefill <strong>1,150 t/s</strong>（253K 冷读约 220 秒）</li>
<li>decode <strong>56.4 t/s</strong></li>
<li>275K 请求 → 干净 HTTP 400（"requests are never truncated"）</li>
</ul>
<h3>2.4 已知上限 / 代价</h3>
<ul>
<li><strong>RAM 贴顶</strong>：55 GiB 常驻专家，available 仅 7–9 GiB；长会话有触发 8 GiB 守卫的风险（要宽裕换 IQ3_XXS，专家省 7 GB）。</li>
<li><strong>decode 比 96K 略降</strong>：256K 下 39–56 t/s（取决任务/命中）；96K + KV streaming 时 45–57。</li>
<li><strong>单会话</strong>：多会话需手动 save/restore（没有 KVMem 的自动多会话）。</li>
</ul>
<hr />
<h2>3. 两套模型对比</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指标</th>
<th>Qwen3.8-27B（KVMem）</th>
<th>Qwen3.8-Flash-Next 125B（Strata）</th>
</tr>
</thead>
<tbody>
<tr>
<td>参数量（激活）</td>
<td>27B dense</td>
<td>125B MoE（~8B 激活）</td>
</tr>
<tr>
<td>上下文</td>
<td><strong>262,144</strong>（虚拟化）</td>
<td><strong>262,144</strong>（全注意力）</td>
</tr>
<tr>
<td>253K 冷读 prefill</td>
<td>637 t/s</td>
<td><strong>1,150 t/s</strong></td>
</tr>
<tr>
<td>253K decode</td>
<td>39.1 t/s</td>
<td><strong>56.4 t/s</strong></td>
</tr>
<tr>
<td>短上下文 decode</td>
<td>40–45 t/s</td>
<td>45–57 t/s</td>
</tr>
<tr>
<td>显存</td>
<td>14.0–14.7 GiB</td>
<td>15.5–15.7 GiB</td>
</tr>
<tr>
<td>主机内存</td>
<td>15–18 GiB（48 GiB 配额）</td>
<td><strong>55 GiB</strong>（专家常驻）</td>
</tr>
<tr>
<td>多会话</td>
<td><strong>8 个自动保留</strong>（4 秒切换）</td>
<td>1 个（手动 save/restore 1–2 秒）</td>
</tr>
<tr>
<td>视觉</td>
<td>有（mmproj，CPU）</td>
<td>无</td>
</tr>
<tr>
<td>质量</td>
<td>27B 级别</td>
<td>125B 级（更强）</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>选型</strong>：</p>
<ul>
<li><strong>多任务/多对话并行、内存敏感</strong> → 27B KVMem</li>
<li><strong>单会话长文、要最强模型</strong> → Strata 125B</li>
<li>两者共用端口 8080，systemd <code>Conflicts=</code> 互斥，切换一条命令。</li>
</ul>
<hr />
<h2>4. 多轮性能与磁盘实测（2026-10-19）</h2>
<h3>4.1 多轮对话：KVMem（27B）</h3>
<p dir="auto"><strong>测试</strong>：66,600 token 文档（4,000 条记录 + 10 个唯一访问代码），同一会话 10 轮问答。</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>轮次</th>
<th style="text-align:right">prompt 处理</th>
<th style="text-align:right">耗时</th>
<th style="text-align:right">decode</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>第 1 轮（冷读）</strong></td>
<td style="text-align:right">66,622 token</td>
<td style="text-align:right"><strong>102.5 秒</strong></td>
<td style="text-align:right">56.7 t/s</td>
</tr>
<tr>
<td>第 2–10 轮</td>
<td style="text-align:right"><strong>28–56 token</strong>（只算新增）</td>
<td style="text-align:right"><strong>4–6 秒/轮</strong></td>
<td style="text-align:right">52–57 t/s</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>准确率</strong>：</p>
<ul>
<li>唯一访问代码：逐个追问 <strong>9/9 全对</strong>；"列出全部" <strong>10/10</strong></li>
<li><strong>细粒度记录值不可靠</strong>：问 record 3400（实际 5800）→ 答 9500（那是 record 3500 的值）；新会话单轮同样错</li>
<li>原因：① KVMem 只可见 32K/66K（中段靠检索，可能漏块）；② 4,000 行近似文本导致注意力抓错相邻行（<strong>sink 区/结尾区都正确，只有中段错</strong>）</li>
</ul>
<p dir="auto"><strong>实操提醒</strong>：多轮场景 <code>max_tokens</code> 要给足（≥1,000），否则会被思考截断误判为"答不出"。</p>
<h3>4.2 多轮对话：Strata（125B）+ DSH 极简模式模拟</h3>
<p dir="auto"><strong>请求结构</strong>：system（DSH 极简提示 + 工具列表）→ user → assistant 工具调用 JSON → user 工具结果（66,800 token）→ 10 轮问答。</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>轮次</th>
<th style="text-align:right">prompt 处理</th>
<th style="text-align:right">缓存命中</th>
<th style="text-align:right">耗时</th>
<th style="text-align:right">decode</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>1（冷读）</strong></td>
<td style="text-align:right">66,802</td>
<td style="text-align:right">0</td>
<td style="text-align:right"><strong>60.2 秒</strong></td>
<td style="text-align:right">56.6 t/s</td>
</tr>
<tr>
<td>2–10</td>
<td style="text-align:right">37–111</td>
<td style="text-align:right"><strong>66.8–67.1K</strong></td>
<td style="text-align:right"><strong>1.4–2.9 秒/轮</strong></td>
<td style="text-align:right">55–69 t/s</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>准确率</strong>：<strong>10/10 全对</strong>，包括 record 3400 → <strong>5800 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=ec85ec55bc1" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✅" alt="✅" /></strong>（KVMem 失败的那题）。</p>
<h3>4.3 两套栈多轮对比</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指标</th>
<th>KVMem（27B）</th>
<th><strong>Strata（125B）</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>首轮冷读（66.6–66.8K）</td>
<td>~102 秒</td>
<td><strong>60.2 秒</strong></td>
</tr>
<tr>
<td>多轮延迟</td>
<td>4–6 秒/轮</td>
<td><strong>1.4–2.9 秒/轮</strong></td>
</tr>
<tr>
<td>唯一信息召回</td>
<td>9/9 + 10/10</td>
<td><strong>10/10</strong></td>
</tr>
<tr>
<td>中段精确查找（record 3400）</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=ec85ec55bc1" class="not-responsive emoji emoji-android emoji--x" style="height:1.4em;width:auto;vertical-align:middle" title="❌" alt="❌" /> 9500</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=ec85ec55bc1" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✅" alt="✅" /> <strong>5800</strong></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>结论</strong>：<strong>单会话 agent 工作（长工具结果 + 多轮追问）Strata 明显更优</strong>（更快、无检索漏块）；KVMem 的价值在<strong>多会话自动保留（8 个）+ 内存省 3 倍</strong>。</p>
<h3>4.4 磁盘敏感性：傲腾 vs USB 移动 SSD（Strata）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指标</th>
<th style="text-align:right">傲腾 905P</th>
<th style="text-align:right">USB 移动 SSD</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>启动（44 GiB 专家拷贝）</strong></td>
<td style="text-align:right">~60–90 秒</td>
<td style="text-align:right"><strong>187 秒</strong></td>
</tr>
<tr>
<td>专家 profile 预热</td>
<td style="text-align:right">3.0 秒（2,399 MB/s）</td>
<td style="text-align:right"><strong>15.2 秒（474 MB/s）</strong></td>
</tr>
<tr>
<td>253K prefill</td>
<td style="text-align:right">1,150 t/s</td>
<td style="text-align:right"><strong>1,155 t/s（持平）</strong></td>
</tr>
<tr>
<td>253K decode</td>
<td style="text-align:right">56.4 t/s</td>
<td style="text-align:right">51.7（MTP 接受率 73% vs 85%，非磁盘因素）</td>
</tr>
<tr>
<td>运行时磁盘读</td>
<td style="text-align:right">PLE 流（顺序）</td>
<td style="text-align:right">51.5 GB / 219 秒 ≈ <strong>235 MB/s</strong></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>结论</strong>：在"专家常驻 RAM（<code>--resident-experts</code>）"的配置下，<strong>只有冷启动（1–3 分钟）明显受磁盘影响</strong>；稳态 prefill/decode 不吃盘（PLE 是顺序流，与计算重叠）。傲腾的随机读优势要到<strong>低内存模式或 SSD 分层</strong>才体现。</p>
]]></description><link>https://lcz.me/topic/2432</link><generator>RSS for Node</generator><lastBuildDate>Mon, 26 Oct 2026 04:29:56 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/2432.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Oct 2026 14:50:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [实测] RX 9070 16G单卡部署strata & qwen 27b gsq 256k经验 on Tue, 20 Oct 2026 01:17:07 GMT]]></title><description><![CDATA[<p dir="auto">挺好的，说明这玩意起码能用，可以试试看<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f602.png?v=ec85ec55bc1" class="not-responsive emoji emoji-android emoji--joy" style="height:1.4em;width:auto;vertical-align:middle" title="😂" alt="😂" /></p>
]]></description><link>https://lcz.me/post/26081</link><guid isPermaLink="true">https://lcz.me/post/26081</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Tue, 20 Oct 2026 01:17:07 GMT</pubDate></item><item><title><![CDATA[Reply to [实测] RX 9070 16G单卡部署strata & qwen 27b gsq 256k经验 on Tue, 20 Oct 2026 00:52:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry" aria-label="Profile: terry">@<bdi>terry</bdi></a> 我是两根台式机和两根笔记本混用（DDR5），自动降到3200Mhz了，实测稳定,但是插法很奇葩，本来正常是13对应24对应，但是如果按这样插无法启动，所以我现在是1234分别是台式台式笔记本笔记本</p>
]]></description><link>https://lcz.me/post/26074</link><guid isPermaLink="true">https://lcz.me/post/26074</guid><dc:creator><![CDATA[Kirin H.]]></dc:creator><pubDate>Tue, 20 Oct 2026 00:52:11 GMT</pubDate></item><item><title><![CDATA[Reply to [实测] RX 9070 16G单卡部署strata & qwen 27b gsq 256k经验 on Mon, 19 Oct 2026 17:58:34 GMT]]></title><description><![CDATA[<p dir="auto">16G能跑效果已经很好了，9070以前什么模型都玩不了，废物的很，现在显存劣势被strata抹掉了，效果居然挺不错的。笔记本内存转接板，这玩意很神奇，工作稳定吗？我也有多个笔记本条子，<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f602.png?v=ec85ec55bc1" class="not-responsive emoji emoji-android emoji--joy" style="height:1.4em;width:auto;vertical-align:middle" title="😂" alt="😂" /></p>
]]></description><link>https://lcz.me/post/26029</link><guid isPermaLink="true">https://lcz.me/post/26029</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Mon, 19 Oct 2026 17:58:34 GMT</pubDate></item><item><title><![CDATA[Reply to [实测] RX 9070 16G单卡部署strata & qwen 27b gsq 256k经验 on Mon, 19 Oct 2026 16:24:56 GMT]]></title><description><![CDATA[<p dir="auto">除了多任务是短板外其他是全面碾压，目前搭配DSH体感良好。</p>
]]></description><link>https://lcz.me/post/26021</link><guid isPermaLink="true">https://lcz.me/post/26021</guid><dc:creator><![CDATA[xiongjie gao]]></dc:creator><pubDate>Mon, 19 Oct 2026 16:24:56 GMT</pubDate></item></channel></rss>