sskj/experiments/pro6000/glm53_nvfp4_pro6000d_sglang_tp4pp2_profile
yy-fighting 5ed30006a5 [Experiment] GLM-5.3-NVFP4 TP4PP2 round-2 optimization: all config-level quick wins refuted (2026-09-07)
- Clean 128k/90% baseline filled (TTFT p50 14.70s, TPOT 51.7ms, hit 0.8999) - prior D-scenario bench was profiler-polluted
- chunk 16384 refuted: flashinfer cutlass MoE workspace scales with chunk -> CUDA OOM (3.08GB needed vs 2.11GB free at mem-frac 0.88);
  physics kills the upside (AR is bandwidth-bound so call-count halving saves ~nothing; indexer q*k work is chunk-invariant)
- AR overlap/quant switch scan: no usable path on TP4+PP2+SM120+PCIe
  (quant-communications is NPU-only via hard ValueError; flashinfer AR fusion auto-enable gated SM90/SM100; symm-mem/NVLS NVLink-oriented)
- indexer direction closed: 28% at 128k is DSA's inherent cost (per-request suffix queries are unique -> no cross-request reuse;
  SM120 has only the deepgemm backend; model already shares topk across layers via index_topk_freq=4; ~219 TFLOPS/rank is reasonable for paged-gather)
- Conclusion: current config (chunk 8192 / mem-frac 0.88 / default NCCL) is config-optimal on this stack;
  remaining gains are dev work: PP+MTP upstreaming (decode) > AR-chunk-overlap/quantized-AR kernel dev (prefill)
- Replaced archived deploy_par_605.sh with the actual /root/deploy_par.sh from 60.5 (md5 cf405176...) - includes sglang_patch mounts
2026-09-08 11:23:59 +08:00
..

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 指标作废

第二轮优化实验2026-09-07配置级方向全部证伪

详见 results/analysis/optimization_round2_findings.md。干净 128k/90% 基线补测TTFT p50 14.70s / TPOT 51.7ms chunk 16384 因 MoE 工作区 OOM3.08GB > 2.11GB 空闲证伪且收益主体不存在AR 带宽受限、indexer 功不变); AR 现成开关扫描全部不适用quant-comm=NPU、AR 融合=SM90/100 门控、symm-mem/NVLS=NVLink 向); indexer 28% 属 DSA 算法固有成本无复用机会、SM120 仅 deepgemm、模型已做 index_topk_freq=4 跨层共享)。 结论现有配置即本栈配置最优剩余提升均为开发投入PP+MTP > AR 重叠/量化内核)。

优化方向(排序见报告 §409-07 更新)

① 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 进程并等显存归零)。