# STRATA 升级 0.2.19 + IQ3_XXS 实跑报告（2026-11-23）

GPU 机：192.168.31.31（RTX 5060 Ti 16GB / 64GB DDR4 / Deepin 25）

---

## 一、升级结果：✅ 已到最新 0.2.19

```
$ ./bin/strata --version
strata 0.2.19 (build 0.1.65; python 3.12.15 at .../term/python/bin/python3.12)
```

| 组件 | 版本 | 位置 |
|---|---|---|
| Terminal（app/CLI） | **0.2.19** | `/home/zyw/strata-0.2.19-install/term` |
| Control | 0.1.65 | 同上（自带 Python 3.12.15 + 全部依赖，无需 venv/pip） |
| 引擎 strata-engine | **0.1.65** cuda-cuda13 | `~/.local/share/strata/components/engine/0.1.65-linux-x86_64-cuda-cuda13` |
| 旧安装（回滚用） | 0.2.13.1 / build 0.1.59.1 | `~/Strata` 原样保留，未动 |

**安装方式**：没用 `strata update`（走签名 feed 要从 GitHub 拉 557MB，而且旧 0.2.13 的 update 通道未必认得 0.2.19），改为官方三件套 + 本地文件安装：

1. `strata-engine-0.1.65-linux-x86_64-cuda-cuda13.tar.gz`（557MB）— 迅雷下载，sha256 与官方 `SHA256SUMS.txt` **一致**
2. `strata-control-0.1.65-linux-x86_64.tar.gz`（90MB）= **Terminal 发行包**，解包即用
3. `strata components install-file <engine.tar.gz>` — 官方命令，它会**签名校验 → 逐个文件校验 → 试启动（加载模型 + 回答一个 token）→ 才切换**

试启动记录（那次真实加载了 IQ3_XXS）：

```
Test-starting engine 0.1.65 linux-x86_64-cuda-cuda13 before switching to it
Engine 0.1.65 has loaded the model; waiting for it to answer one token (128 s)
Switching to engine 0.1.65 ...
Engine  none -> 0.1.65   updated (tested: started, answered one token, stopped)
```

> ⚠️ 11-22 22:21 你自己那次升级失败的原因找到了：`.updates/state.json` 记的是
> `test start failed ... prefill: GEMM scratch does not fit` —— 当时 ComfyUI + 8081 llama-server 占着 12GB 显存，
> 引擎试启动拿不到显存。这次先腾空显存才过。

---

## 二、IQ3_XXS 启动配置（官方 `strata launch`）

```
strata launch --family qwen --model iq3_xxs \
  --model-path /home/zyw/Strata-data/models/IQ3_XXS \
  --context 128k --vision cpu --tune skip \
  --access lan --port 8090 \
  --api-key strata-1140…b616 --yes --no-tui
```

- **模型**：Qwen3.8-Flash-Next IQ3_XXS，75.8 GB 分片，launch 自己做了全量校验
- **上下文 128K**（服务端 `max_model_len: 131072`），KV 用官方默认 int8 + KV streaming（自动）
- **视觉开**：直接复用了 IQ2_XS 目录里的 `mmproj-Qwen3.8-Flash-Next-BF16.gguf`（0.9GB，省一次下载），reader 跑在 CPU（16GB 卡按官方规则用 CPU reader）
- **草稿器 DFlash2**：1.2GB，从 `incoai/Qwen3.8-Flash-Next-DFlash2`（revision 固定）。HF 直连不通，用 `HF_ENDPOINT=https://hf-mirror.com` 让官方 `strata drafting fetch` 自己下（1.29MB/s，约 16 分钟），已 pack 成 `Strata-data/dflash2/*.pack`
- **DFlash2 限制**：官方提示「answers one request at a time」→ 并行度被自动设为 1
- **API key 沿用旧的**（`strata-1140…b616`），DSH 那边不用换 key

服务地址：

```
This computer  http://127.0.0.1:8090/v1
Network        http://192.168.31.31:8090/v1
模型名          qwen3.8-flash-next-iq3_xxs
```

---

## 三、实测数据（2026-11-23 07:0x）

| 指标 | 实测 |
|---|---|
| 模型加载 | 约 160 秒（75.8GB，从 RAM/page cache） |
| **prefill** | **78.6–80.0 tok/s**（69 token 用 863ms） |
| **decode（首轮，缓存冷）** | **14.7 tok/s**（400 token / 27.3s，DFlash2 接受 122/182） |
| **decode（第二轮，缓存热）** | **22.3 tok/s**（137 token / 6.15s，DFlash2 接受 65/88） |
| 专家缓存命中率 | 83.5% → 88.6% → **90.0%**（越聊越高） |
| PCIe 专家补齐 | 7.2–9.3% 经 PCIe/跨卡读取；`pcie_frac` 自动从 0.45 调到 **0.50** |
| KV streaming | 382176 次 block 读中 **99.63% 命中显存**，仅 5.7MiB 走 RAM |
| 显存 | **14661 / 16311 MiB**（几乎顶满，符合「显存越大专家驻留越多」） |
| 系统内存 | 49GB used / 62GB（专家 43GB + 系统） |
| 输出质量 | 中文正常，思考链存在（回复前有 reasoning） |

**关于速度**：首轮 14.7 → 热缓存 22.3 tok/s 的差别来自专家缓存预热与 pcie_frac 自学习。这个数字明显低于 0.2.13 时代 IQ2_XS 的 86–101 tok/s，原因是：
1. IQ3_XXS 专家更大（43GB vs 36GB），16GB 显存能驻留的比例更低；
2. 这次是**默认档未 tuning**（见下）；
3. DFlash2 只允许单请求。

---

## 四、关于「官方最优设置」：为什么最后没用 `--tune thorough`

**如实说明**：我先按 `--tune thorough` 跑了官方调优器，它确实在工作，但成本极高——

- 它的每一个候选（"Keep more of the conversation in graphics memory"、"Allocate the conversation memory as it grows" 等）**都要重启引擎并重新加载 75.8GB 模型**；
- 实测 **1 项 ≈ 7–8 分钟**，两个参数各有 round 1~3，全套下来 **1 小时以上**；
- 跑了约 25 分钟只走完 2 项，你催进度，我把它停了（进程已干净退出），改用 **`--tune skip` 官方自动自适应档**启动，先把服务给你。

当前跑的就是官方默认自适应（这些本来就是自动的）：`expert-cache auto`、`prefill auto`、`pcie-frac` 自学习、`route-tail-skip=7`（CUDA 默认开）、KV streaming 自动、DFlash2 草稿自动。

**想补做官方最优调优**（建议挂夜间，别占白天）：

```bash
cd /home/zyw/strata-0.2.19-install/term
./bin/strata tune thorough --config ~/Strata-data/strata-iq3_xxs.json   # 或 strata tune --help 看目标参数
./bin/strata presets list        # 调完的结果会存成 preset，可 apply/undo
```

调优期间别开 ComfyUI / 其他吃显存的程序。

---

## 五、副作用与恢复

为了给引擎腾显存，停了两个服务：

| 服务 | 端口 | 恢复命令 |
|---|---|---|
| ComfyUI | 8189 | `~/start_comfy_C_64g.sh`（64G C 档） |
| Inkling 2 Mini (llama.cpp) | 8081 | `echo yueling408 \| sudo -S systemctl start inkling` |

⚠️ Strata 跑着时两者**不要同时起**（显存会争到 12GB 以上，专家缓存掉一半，速度腰斩）。

DSH 侧已同步：`~/.dsh/profiles/web/cordis.patch.yml` 的 strata provider 模型 id 改为
`qwen3.8-flash-next-iq3_xxs`、上下文 131072（patch 是热加载，无需重启 DSH）。

---

## 六、常用运维

```bash
cd /home/zyw/strata-0.2.19-install/term
./bin/strata launch --status                    # 状态
./bin/strata launch --stop                      # 停服务
./bin/strata launch --show-key                  # 看 API key
./bin/strata logs --follow                      # 引擎日志
tail -f /home/zyw/.local/state/strata/launch/iq3_xxs-128k.engine.log
./bin/strata doctor --live                      # 体检
```

**回滚到 0.2.13**（旧安装原样在 `~/Strata`，引擎 0.1.59 也还在）：

```bash
cd /home/zyw/strata-0.2.19-install/term && ./bin/strata launch --stop
./bin/strata components engines                 # 若 0.1.59 还在，components use 切回
cd ~/Strata && ./run-iq2_xs.sh                  # 旧 8090（模型名 qwen3.8-flash-next-iq2_xs）
```

---

## 七、本次用到的下载（含哈希校验）

| 文件 | 大小 | 来源 | 校验 |
|---|---:|---|---|
| strata-engine-0.1.65-linux-x86_64-cuda-cuda13.tar.gz | 557 MB | GitHub release v0.2.19，迅雷 | sha256 `77a6fd93…7fbf49` ✅ 与官方清单一致 |
| strata-control-0.1.65-linux-x86_64.tar.gz | 90 MB | 同上（前一日已下） | ✅ |
| Strata-0.2.19-src.zip | 47 MB | 同上（前一日已下） | ✅ |
| incoai/Qwen3.8-Flash-Next-DFlash2 `model.safetensors` | 1.2 GB | hf-mirror（HF 直连不通） | 引擎自校验 |
