yy-fighting 1e8c36b7d1 [Experiment] GLM-5.3-NVFP4 TP4PP2 torch-profiler profile on 174.1.60.5 (2026-09-06)
- Scenarios: A prefill 16k/1 cc16, B decode 16k/512 cc16, D 128k/90% prefix-hit cc8, E NCCL_PROTO=Simple protocol control
- Key findings: PP bubble disproven (96% both-stage busy, chunked prefill = natural microbatch pipeline);
  prefill wall = PP0 chain compute 22.8s(65%) + TP4 AllReduce 10.4s(30%);
  AR 96MB/3.7ms => busbw ~39GB/s ~ 75% of practical PCIe Gen5 (near-optimal, RING_LL kernel name is NCCL 2.28 mixed-plan naming);
  NCCL_PROTO forcing refuted: docker -e never reaches scheduler ranks (sglang worker spawn drops NCCL env);
  decode step 21-26ms (MoE GEMM 35%, SendRecv 18%, PP1 AllGather 273 launches outside cuda graph);
  128k/90%: DSA indexer sm120_fp8_mqa_logits 28%/23% = 1.6x the sparse attention it serves;
  with_stack pathological on this nightly (2 repros) - flush wedges server
- Full report: D:\sskj\reports\GLM53_TP4PP2_Profile与优化方向_2026-09-06.md
- Raw traces remain on 60.5:/data/hf_models/pp2tp4_profiles/{A_prefill,B_decode,D_128k,E_nccl_simple}/
2026-09-08 11:23:59 +08:00

4.6 KiB
Raw Blame History

GLM-5.3-NVFP4 (Pro6000D×8) SGLang TP4PP2 Torch-Profiler Profile 与优化方向

  • 日期2026-09-06 机器174.1.60.58×RTX 6000D 85.6GB, SM120, PCIe Gen5, 无 NVLink
  • 完整报告:D:\sskj\reports\GLM53_TP4PP2_Profile与优化方向_2026-09-06.md结论、排名表、NCCL 验证实验全在该文件)
  • 上游依据09-05 并行方案对比TP8 / TP4PP2 / EP8 / DP确认 TP4PP2 为最优配置

目的

对获胜配置 TP4PP2 做 prefill / decode / 128k 前缀命中三场景 torch profiler 采集, 量化 kernel 热点、PP 流水线气泡、NCCL 通信占比、CPU 调度空隙,产出优化方向排序; 并用对照实验检验 profile 提出的第一假设NCCL LL 协议误选)。

部署(与 09-05 获胜配置逐字一致)

bash /root/deploy_par.sh "--tp 4 --pp-size 2 --disable-overlap-schedule --max-prefill-tokens 16384" nomtp

镜像 lmsysorg/sglang:nightly-dev-20260828-daf63171;容器 glm53-nvfp4:30000 KV fp8_e4m3 自动SM120 三件套(--disable-shared-experts-fusion --moe-runner-backend flashinfer_cutlass --disable-flashinfer-autotune hicache-ratio 3mem-frac 0.88chunked-prefill 8192。忠实性干净复测 cc16 16k/512 输出 104.7 tok/s / TPOT 50.87ms,与 09-05 基准103.3 / 55.4)一致。

采集协议

场景 负载 说明
A prefill 16×(16384→1) cc16 ~34 个 8192-token chunk 前向
B decode 16×(16384→512) cc16 TTFT 过后 arm 60 步
D 128k/90% 8×131072 cc8 共享前缀 117968后缀 prefill 窗口 arm 16 前向
E 协议对照 16k probe ×2 前向 NCCL_PROTO=Simple 变体下的 AR kernel 取证
  • POST /start_profileCPU+GPU activities无 stack采集前 flush + 微量预热 + 再 flushbench 每轮换 seed
  • with_stack 在本 nightly 病态两次复现16k 直接 OOM 僵尸2k probe flush 挂死)——禁用

关键结论(详见报告)

  1. PP 气泡证伪chunked prefill 形成天然微批流水,两 stage 同忙 96.0%,经典气泡仅 ~4%
  2. prefill 墙 = PP0 链路:计算 22.8s(65%) + TP4 AR 10.4s(30%)35.2s 墙钟
  3. AR 已近带宽极限96MB/3.7ms ⇒ busbw≈39GB/s ≈ PCIe Gen5 实际峰值 ~75%"_RING_LL" 内核名是 NCCL 2.28 混合 plan 命名,非半带宽 LL 线格式
  4. NCCL_PROTO 强制实验证伪快赢docker -e 到不了 rank 进程sglang worker spawn 丢弃 NCCL envAR p50 3.69→3.70ms 不变e2e 噪声内
  5. decode:步长 21-26msMoE GEMM 35% + SendRecv 18%),无 MTPPP1 AllGather 273 次不在 cuda graph 内
  6. 128k/90%DSA indexer sm120_fp8_mqa_logits 占 28%PP0/23%PP1是其服务的稀疏注意力本体17%)的 1.6×;后缀有效速率 5.2k tok/s
  7. profiler 工程发现flush 阻塞全流水线 11s带 profiler 的 bench 指标作废

优化方向(排序见报告 §4

① prefill AR 通信-计算重叠 / 量化 AR协议红利已排除② PP+MTPdecode 最大杠杆); ③ 128k 场景 DSA indexer 前缀复用/调优;④ chunk 8192→16384 重测;⑤ MoE 胶水融合 + PP1 AG 入图;⑥ decode 尾部。

目录

scripts/   deploy_par_605.sh部署、profile_cap.shA/B/C 编排、run_phase2.sh冒烟+干净bench+D+C、
           bench_128k_hit90_prof.pyD 驱动+arm、probe_c*.py小探针、
           pp_align.py跨rank墙钟对齐+分箱、nccl_forensics.py / nccl_names.pyNCCL 取证、census.py事件普查
results/   analysis/pp_align/triage/forensics/census 输出、bench/(干净 bench 与采集期 bench 日志、ops/(部署与采集日志)

trace 原始文件(体积大,不入库):60.5:/data/hf_models/pp2tp4_profiles/{A_prefill,B_decode,D_128k,E_nccl_simple}/ 8 rank × 4 场景A 的 PP0 ~70-77MB gz其余 ~2-9.5MB)。

复现

  1. bash scripts/deploy_par_605.sh "<同上参数>" nomtp60.5 上原路径 /root/deploy_par.sh
  2. 等 /health=200GSM8K 冒烟
  3. bash scripts/profile_cap.shA/Bpython3 scripts/bench_128k_hit90_prof.py --concurrency 8 --num-requests 8 --run-id <新> --arm-profile <dir> --profile-steps 16D
  4. python3 scripts/pp_align.py <trace_dir>python3 scripts/nccl_forensics.py <trace>python3 scripts/nccl_names.py <trace>
  5. triage 三表用 zcode skill llm-torch-profiler-analysis 的 analyze 脚本docker cp 进容器跑)

事后状态

60.5 当前运行原样 TP4PP2glm53-nvfp4:30000。恢复 GLM-5.3-Flash kt bash /root/deploy_glm53_flash_kt_gpu_graphs.sh(先 kill -9 本容器 sglang 进程并等显存归零)。