Files
aituner/runs/frontier-tp2-prefill-serving-v0/experiment-card.md

110 lines
6.2 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.

# 实验 EXP-TP2-PREFILL-SERVINGTP2 base-prefill residual 是否来自 serving-path MoE
> **状态:** 完成;机制 PASSglobal constant injection FAIL
>
> Parent campaign[`../frontier-simulator-gap-campaign-v0/README.md`](../frontier-simulator-gap-campaign-v0/README.md)
## Claim 与决策
- **Parent claim** structured predictor 后,单请求 q8k/ctx0 的 TP2 sim chunk
仍为 356 ms而 real anchor 为 410 ms13.1%TP4 为 231.3 vs
231 ms。剩余量是 TP2 独有的 base serving-path residual。
- **目的:** 判断约 54 ms/chunk 是否可由 TP2 prefill MoE 的
tactic/warmup/routing/serving composition 工程修复。
- **Competing hypotheses**
- H1standalone grouped-GEMM 在 TP2 的 q8k expert shape 上过于乐观;
warm real-routing 或 serving-path trace 会比当前 171.1 ms/chunk 高 ≥10%。
- H2MoE 三臂接近,残差位于其它 whole-layer/host/event path。
- **事前预测:** 若 H1 成立serving-path MoE 增量接近 54 ms并且只注入
TP2 row 后 chunk0 residual 降至 ≤5%;若 H2 成立,三臂差异 <10%。
- **判定规则**
- 先用一个 TP2 q8k smoke 验证 prefill execute annotation kernel
component 可提取
- B/C 相对 A 都无稳定 10% shift 停止 profile 注入 whole-layer
- C 解释 70% 54 ms residual 注入 TP2重放两个 TP2 trace cell
## Setup
- **自变量**
- A当前 Frontier standalone profile/predictorTP2 q8k/ctx0
`moe_grouped_gemm=171.118 ms/chunk`
- B相同 expert GEMM shapes充分 warmup/autotune使用 serving trace
抽取的 routing allocation
- CvLLM 0.20 graph-aligned serving path q8k prefill execute按最慢
TP rank 汇总 MoE kernels
- **控制变量** Qwen3-30B-A3B BF16H20TP2/EP1q8k/ctx0同模型
runtimeFlashInfer workspaceCUDA/driverTP4 仅作 control anchor
- **Hardware** 只用 `dash1`--`dash4`运行前要求目标主机 8×H20 全部
idle/healthy每个 arm fresh process避免 profiler one-shot tactic cache
交叉污染
- **Smoke contract** q81922TP28192 max batched tokens同一 fresh
process 先执行 2 profiler-off warmup profile 1 次请求每个 rank
选择 duration 最大的 `execute_*` annotation 作为 prefill windowcritical
path wall 最大的 rank
- **Metrics** chunk execute wallMoE/attention/collective/other kernel ms
最慢 rank独立 process repeat注入后的 chunk residual TTFT/E2E
## 预期产物与 review
- **预期数据** `results/entry-audit.json`三臂 trace/provenancecomponent
对照TP2 counterfactual replay
- **Figure prototype** `figure-prototype.png`左图为 TP2/TP4 q8k chunk
real vs sim右图为三臂 MoE 事前预测
- **人工 review** campaign 已批准entry gate 已通过
- **Review 意见** 先单 TP2 smoke只有 annotation component contract
通过才扩为 repeat/control不先铺满 GPU 网格
## 复现信息
- **Code** 当前 aituner worktreeserving profiler 复用
`runs/frontier-component-residual-v0` vLLM/Kineto harness
- **Environment** vLLM 0.20.0H20remote repo
`/home/admin/cpfs/wjh/aituner/aituner`
- **产物路径** 本目录
- **已知 deviation** real 410/231 ms 是已冻结的 pure-prefill chunk anchor
本实验不重新声称它来自当前 1h trace 的在线 batch
- **远端 checkout deviation** dash1 canonical checkout `main`
存在大量无关 dirty/staged changes不能安全 pull正式 job 使用同一 Git
repository `origin/feature/sim` commit 建立的相邻 detached worktree
`/home/admin/cpfs/wjh/aituner/aituner-frontier-tp2-prefill-serving-v0`
不修改 canonical checkout
- **Fleet sync deviation** dash1 未安装 `rsync`fleet mandatory sync 使用
`scp` 一个已校验为空的 `/tmp/frontier-tp2-prefill-serving-v0-empty-sync`
目录实验代码仍只来自上述 Git worktree
- **FlashInfer cache deviation** v0 使用空 workspace 冷构建
`fused_moe_90` 8 分钟仅完成 4/181 objects且尚未发请求因此主动
终止exit 141)。v1 改用此前 component profile 在同一 dash1同一
FlashInfer `0.6.8.post1/sm90a` 构建的
`/tmp/frontier-component-flashinfer-v4`仍保留 2 profiler-off serving
warmup所有计时发生在 warmup
## 结果
- **Entry audit** PASSTP2 q8k/ctx0 structured sim=`356.25 ms`
real=`410 ms`bias=`13.11%`TP4=`231.33 vs 231 ms`。TP2
component ledger MoE=`171.12 ms`,若单独解释 residual 需增至约
`224.9 ms`+31.4%)。
- **观察事实**
- TP2 q8192 profile execute=`408.19 ms`,冻结 real anchor=`410 ms`
两个 TP rank 分别为 `408.19/407.34 ms`
- critical-rank attention=`99.67 ms`sim attention execution=`100.24 ms`
serving MoE=`214.52 ms`sim MoE=`171.12 ms`
- MoE delta=`43.41 ms`,解释 total residual `80.75%`MoE-only
counterfactual total=`399.65 ms`(相对 real `2.52%`)。三个事前 smoke
gate 全部 PASS
- 但把 q8k ratio `1.25366×` 用作所有 TP2 prefill shape 的常数 scale
ρ=0.0025 TTFT mean `4.54%→+5.23%`p99
`7.67%→+0.89%`E2E mean `+12.70%→+15.55%`ρ=0.005
TTFT mean `7.08%→+3.13%`E2E mean `+5.02%→+9.14%`
- **Fleet preflight2026-07-23** dash1--dash4 均为 8×H2032 张卡
`memory.used=0 MiB``utilization=0%` compute processdry-run 选择
`dash1:[0,1]`正式 job pin dash1
- **含义** TP2 base residual 的主要机制确实是 serving-path MoE而不是
attention real-anchor 噪声但单个 q8k 点不能外推成全 prefill-domain
constant calibration
- **Claim update** TP2 prefill MoE 尚有明显工程可优化 gap得到支持
用一个 TP2 常数 scale 即可修复 trace fidelity被否定
- **下一步** 将后续工程项收窄为 TP2 token/routing-conditioned serving
MoE curve至少 q2k/q4k/q8k 与真实 routing allocation不合入当前
global scalecampaign 继续实验 3