shishi c69831f258 feat(pd): PD 长上下文 adaptive concurrency bench(SLO 方案 A,并发 +16)
- matrix.json: 3 个 shape(64k/128, 16k/1k, 1k/4k)
- run_adaptive_concurrency_pd.sh: PD 专用 adaptive 脚本
  - 复用 adaptive_bench_lib.sh(并发搜索/SLO 停止/OOM 检测/完整产物)
  - server 生命周期函数 no-op(PD 服务常驻,不启停)
  - 加 --flush-cache(配合 --disable-radix-cache 测纯净 TTFT/TPOT)
  - 离线环境变量 + 本地 tokenizer(避免 HF 在线下载)
- adaptive_config.env: SEARCH_ADDEND=16 +16 递增,上限 64,回退 8/1
- config.env: 新增 get_ttft_slo_ms 分层 SLO(1k->4s, 16k->15s, 64k->30s)
2026-08-11 14:45:36 +08:00

60 lines
2.6 KiB
Bash
Executable File
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.

#!/usr/bin/env bash
# Kimi-K3 PD 分离部署MoonCake RDMA实验配置。
# 服务器生命周期走 deploy_pd.sh 编排脚本 + deploy profiles
# - P 组 profile: pro6000/kimi3_pro6000_pd_prefill
# - D 组 profile: pro6000/kimi3_pro6000_pd_decode
# - 编排: experiments/pro6000/kimi3_pro6000_pd_rdma/deploy_pd.sh
# 部署参数以 profile / deploy_pd.sh 为准,勿在此重复。
EXPERIMENT="kimi3_pro6000_pd_rdma"
MODEL_NAME="Kimi-K3"
MODEL_PATH="/data/hf_models/Kimi-K3"
SERVED_MODEL_NAME="kimi-k3"
# Router (MiniLB) 入口端口。
SGLANG_PORT="${SGLANG_PORT:-31000}"
# MoonCake master 地址P 组头节点)。
MOONCAKE_MASTER="${MOONCAKE_MASTER:-174.1.60.1:50051}"
# Python interpreter for orchestration scripts.
# VENV_CLIENT: 不用 native client本环境无 sglang.bench_serving改用 docker client
# Run the benchmark client natively (0) or inside Docker (1).
USE_DOCKER_CLIENT="${USE_DOCKER_CLIENT:-1}"
# Benchmark client: 复用 kimi-k3 镜像(内含 sglang.bench_serving
DOCKER_CLIENT_IMAGE="${DOCKER_CLIENT_IMAGE:-lmsysorg/sglang:kimi-k3}"
# Deployment profiles used by deploy_pd.sh.
P_DEPLOY_PROFILE="${P_DEPLOY_PROFILE:-pro6000/kimi3_pro6000_pd_prefill}"
D_DEPLOY_PROFILE="${D_DEPLOY_PROFILE:-pro6000/kimi3_pro6000_pd_decode}"
# ---- Bench client 配置(供 run_adaptive_concurrency_pd.sh 使用)----
# 长上下文用 random-ids整数 token避免 ShareGPT 前缀干扰测量。
BENCH_DATASET_NAME="${BENCH_DATASET_NAME:-random-ids}"
DATASET_PATH="${DATASET_PATH:-}"
SGLANG_BENCH_MODULE="${SGLANG_BENCH_MODULE:-sglang.bench_serving}"
GPU_MEM_SAMPLE_INTERVAL_S="${GPU_MEM_SAMPLE_INTERVAL_S:-1}"
# Per-scenario timeout to avoid hangs (seconds).
SCENARIO_TIMEOUT_S="${SCENARIO_TIMEOUT_S:-3600}"
# ---------------------------------------------------------------------------
# Tiered TTFT SLO by input sequence length (方案 A).
# 长上下文场景 SLO 随 ISL 递增prefill 有固有计算成本TTFT 必须随输入放宽。
# Kimi-K3 混合线性注意力在 RTX 6000D 上 prefill 较慢,阈值比 glm52 略宽。
# 对应三个 shape: 1k->4s, 16k->15s, 64k->30s。
# 由 adaptive_bench_lib.sh 的并发扫描调用ttft_p95 超阈值即停止该 shape。
# ---------------------------------------------------------------------------
get_ttft_slo_ms() {
local isl="$1"
if (( isl <= 2048 )); then echo 4000
elif (( isl <= 8192 )); then echo 8000
elif (( isl <= 32768 )); then echo 15000
elif (( isl <= 131072 )); then echo 30000
else echo 50000
fi
}
TTFT_SLO_TIERS_DESC="≤2k:4s, ≤8k:8s, ≤32k:15s, ≤128k:30s, >128k:50s"