sskj/deploy/PD_CHAIN.md
yy-fighting 5c749cda03 feat(pro6000/GLM-5.3): 方案 D/E/F 部署资产入库(TP2PP4 生产配方 / TP8+DFlash2 / PD 分离四角色链)
- scripts: 11 个服务器原样脚本入库(md5 对照表更新至 README);D=60.1 生产原样配方、
  E=v5 DFlash 底稿、F=PD 链四角色部署+launch+双场景压测驱动
- profiles: 新增 6 个 .env(D/E 单机 + F 四角色,均带镜像 digest
  sha256:28e0d260…,对齐 kimi3 PD 多角色先例)
- deploy/PD_CHAIN.md: 方案 F 编排手册(启动顺序 mc-master→prefill→decode→router、
  基础设施依赖表、质量门口径、拆链恢复、÷2 单机等效判决)
- platforms/patches/pro6000/glm53_pd_chain/: sglang 补丁树 vs 镜像原版 11 文件
  unified diff 快照——宿主树无 .git,此为唯一版本记录(DFlash+PP+PD 解锁全集)
- deploy/manifests/: GLM-5.3-NVFP4(47分片)/GLM-5.3-DFlash2(单分片) 权重 md5 清单
- deploy/CURRENT.md: 全集群现役状态页(2026-09-08 八机实测)
- deploy/verify_profile.sh: 防漂移核验工具(digest+参数 token 比对+端口/health,
  已在 60.1 生产容器实测 PASS)
2026-09-08 16:36:15 +08:00

97 lines
5.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 方案FGLM-5.3-NVFP4 PD 分离完整链(双机 6000D编排手册
> 2026-09-08 实测终态。四角色、两台机、启动顺序强制。吞吐换算口径:**链合计 ÷2 = 单机等效**(与单机方案 A-E 可比)。
> 完整压测数据见飞书《GLM-5.3-NVFP4 双场景压测报告》方案 F 行(文档 `SZUSdEqY1oRVxGxgILBcHqPJnEc` / wiki `NzbMwzmKviYidRkZYRrc8GYQnrf`)。
## 拓扑
| 角色 | 机器 | 容器 | 端口 | profile |
|---|---|---|---|---|
| 1. mc-masterMooncake 元数据) | 174.1.60.1 | `mc-master` | 50051 | `profiles/pro6000/glm53_nvfp4_pro6000_pd_master.env` |
| 2. prefillTP4 PP2 + DFLASH 草稿) | 174.1.60.1 | `glm53-pd-smoke-prefill` | 30000 | `profiles/pro6000/glm53_nvfp4_pro6000_pd_prefill.env` |
| 3. decodeTP8 + DFLASH v5 配方) | 174.1.60.2 | `glm53-s1-decode` | 30000 | `profiles/pro6000/glm53_nvfp4_pro6000_pd_decode.env` |
| 4. routerMiniLB | 174.1.60.2 | `pd-smoke-router` | 31000 | `profiles/pro6000/glm53_nvfp4_pro6000_pd_router.env` |
镜像统一:`lmsysorg/sglang:nightly-dev-20260828-daf63171`
digest `sha256:28e0d26073161e49ca56eba808d264a4223804a212020f1dfe1b2405b9f8a399`)。
## 启动顺序(强制)
```
mc-master (60.1) → prefill (60.1) → decode (60.2) → router (60.2)
```
对应脚本(`experiments/pro6000/glm53_nvfp4_pro6000d_sglang_dual_scenario_bench/scripts/`
```bash
# 60.1注意60.1 日常跑生产容器 glm53-pp4先停它见下节
bash /tmp/deploy_pd_smoke_master.sh # 判据 ss :50051
bash /tmp/deploy_pd_probe.sh p1b_prefill_tp4pp2_cps8k_radix_launch.sh # 判据 :30000/health 200~10-15min
# 60.2
bash /tmp/deploy_s1_decode.sh # 判据 :30000/health 200~10min
bash /tmp/deploy_pd_smoke_router.sh # 判据 ss :31000
```
场景一90% 命中)必须用 **radix 变体** launch`p1b_prefill_tp4pp2_cps8k_radix_launch.sh`
与基线唯一差异 = 无 `--disable-radix-cache`)。场景二 0 命中radix 开销可忽略,两场景共用同一部署。
## 基础设施依赖(缺一不可)
| 依赖 | 位置 | 说明 |
|---|---|---|
| sglang 补丁树 | `/data/sglang_patch_glm53` → 容器 `/sgl-workspace/sglang` | 与镜像原版差 **11 个文件**10 改 + 1 新增 `dflash_pp.py`),清单与 diff 见 `platforms/patches/pro6000/glm53_pd_chain/`。无补丁则 DFlash+PD 冷启动接线缺失decode 首请求 400 |
| mooncake wheel | `/data/flashkda_deploy/wheels/mooncake_transfer_engine_cuda13-0.3.12.post1-cp312-cp312-manylinux_2_28_x86_64.whl` | 容器内 launch 脚本 `pip install --no-deps` 自装 |
| DFlash2 草稿权重 | `/data/hf_models/GLM-5.3-DFlash2` | 两角色都要挂 |
| IB 设备 | mlx5_0mlx5_3 + `--device /dev/infiniband` + `--ulimit memlock=-1` | RDMA KV 传输通道 |
| 环境变量 | `MOONCAKE_MASTER=174.1.60.1:50051` `MOONCAKE_PROTOCOL=rdma` | prefill/decode 容器都要 |
## 质量门(经 router :31000全链路含 KV transfer + 草稿)
60.2 上生成 router 口径的 gate 副本:
```bash
sed 's/PORT=30000/PORT=31000/' /root/quality_gate_605.sh > /tmp/quality_gate_31000.sh
```
判据GSM8K×5 + 中文推理必须过。tool call 预期不过(链配方无 parser与方案 B/D 同口径的已知配置缺口,记录放行)。
2026-09-08 实测 **6/7**核心项全过DFlash 草稿无质量损失)。
## 压测
驱动脚本:`run_pd_s1.sh` / `run_pd_s2.sh`(同 scripts 目录),跑在 60.1(语料本地,
`--url http://174.1.60.2:31000/generate` 走 router`--container glm53-pd-smoke-prefill` 读 prefill 日志核命中率)。
- **场景一**128k/64k × cc1-4nreq8shared-frac 0.9canonical 窗口 9301-9308
- **场景二**cc8/16/32 canonical 9311-9313nreq 16/32/32cc40/64 全新窗口 pool-override
16,384,000 / 17,203,200nreq 40/64 单轮满波)
- 指标读取:命中率读 prefill 容器日志PP2 日志计数 ×2不影响比值accept 从 decode 日志读
router 转发后 usage 字段可能缺失)
- 每点核验ok/failed=0、retractions、s1 hit≈0.90、s2 hit=0
### 2026-09-08 实测判决13/13 干净点)
- **场景一**128k cc1 TTFT 3.91s = 六方案最低(跨机重叠把 prefill 与 RDMA 传输完全藏住),
但 cc≥2 时 decode 侧排队TTFT 堆到 31.0s÷2 输出吞吐 21.2-23.5 tok/s仅为 A 的 30-57%。
根因decode KV 池 214,336 token 按 16k 场景定容 → 128k 仅 1 驻留、64k 仅 3。
- **场景二**÷2 单机等效 74-85 tok/s = A 的 75-96%,但 TTFT 较 A 减半。
判决:**两机买 TTFT、不买吞吐**。decode MRR12 在 cc16+ 饱和DFlash accept 在 12-batch
verify 下掉到 1.8(单机 EAGLE 2.84)。
- **PD 机制验证**:跨机 prefill/decode 重叠成立、mooncake RDMA 传输被吸收——机制无罪,
容量配置decode 池按 16k 定容)是判决主因。
## 拆链与生产恢复(顺序固定)
```bash
# 1. 拆链
# 60.1: docker rm -f mc-master glm53-pd-smoke-prefill
# 60.2: docker rm -f glm53-s1-decode pd-smoke-router
# 2. 等双机显存排空60.1 <2000MiB60.2 GPU7 常有外部裸金属任务 main_v2.py核实归属勿清
# 3. 恢复 60.1 生产bash /tmp/deploy_glm53_pp4.sh → health 200 + docker inspect Args 核对
```
## 60.1 生产停机窗口提示
60.1 日常跑生产 `glm53-pp4`(方案 DTP2PP48 卡满载)。拉 prefill 角色前必须停生产;
`deploy_glm53_pp4.sh` 生成的参数与生产容器 `docker inspect` Args 已核对逐字一致,
恢复即完全复现。全程停机 ~2-2.5h(部署+13 点压测+质量门+恢复)。