sskj/deploy/profiles/pro6000/kimi3_pro6000_sglang_tp32ep32.env

55 lines
2.8 KiB
Bash
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.

# Kimi-K3 SGLang multi-node TP=32 EP=32 deployment profile (4x RTX 6000D).
# Nodes: 174.1.60.5~8 (rank 0~3), 32x NVIDIA RTX 6000D (85GB, sm_120).
#
# 关键点(实测踩坑,勿随意改):
# - MoE 后端必须 marlinK3 的 MXFP4 缩放因子为 uint8DeepGEMM 只接受 fp32/UE8M0
# - RoCE: NCCL_IB_HCA=mlx5_0..34 张独立卡, 10.100.21-24/24, RoCEv2 GID index 3
# 实测 32-rank 117MB allreduce 2.4ms;勿用 mlx5_bond_0仅 4.5GB/s
# - 容器必须 --ulimit memlock=-1否则 ibv_create_cq 报 Cannot allocate memory
# - 不要设 NCCL_ALGO=TREECUDA graph 捕获报 "NCCL error: invalid usage"
# - 首次请求含 ~110s Triton JIT 编译,属正常现象,预热一次后回落
# - flashkda 可选后端(与 triton prefill 性能等价)见 docs/KIMI_K3_DEPLOY.md 附录
#
# Model-team only. Ops only run `python -m sskj.bench` against the served URL.
PLATFORM=pro6000
EXPERIMENT=kimi3_pro6000_sglang_tp32ep32
MODEL_NAME=Kimi-K3
ENGINE=sglang
RUNTIME=docker
DOCKER_IMAGE=lmsysorg/sglang:kimi-k3
CONTAINER_NAME=${EXPERIMENT}_node${NODE_RANK}
MODEL_PATH=/data/hf_models/Kimi-K3
SERVED_MODEL_NAME=kimi-k3
PORT=30000
HEALTH_PATH=/health
HEALTH_HOST=174.1.60.5
HEALTH_WAIT_S=2400
CONTAINER_PYTHON=python3
# ---- 并行度(固定,勿改)----
TP=32
DP=1
EP_SIZE=32
# ---- Multi-node topology (rank order; rank 0 exposes the HTTP API) ----
NNODES=4
NODE_HOSTS="174.1.60.5 174.1.60.6 174.1.60.7 174.1.60.8"
NODE_SSH_USER=root
LOCAL_NODE_RANK=0
MASTER_IP=174.1.60.5
DIST_PORT=20000
DEVICE_VARS="CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7"
ENGINE_ENV="NCCL_SOCKET_IFNAME=bond0 GLOO_SOCKET_IFNAME=bond0 NCCL_IB_HCA=mlx5_0,mlx5_1,mlx5_2,mlx5_3 NCCL_IB_GID_INDEX=3 NCCL_IB_TIMEOUT=22 NCCL_IB_RETRY_CNT=7 NCCL_CUMEM_ENABLE=1 PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True SGLANG_ENABLE_TP_MEMORY_INBALANCE_CHECK=0 SGLANG_MOE_FUSED_GATE_RADIX=1"
DOCKER_FLAGS="--gpus all --network host --ipc=host --ulimit memlock=-1 --device /dev/infiniband --shm-size 32g --entrypoint ''"
VOLUMES="${MODEL_PATH}:${MODEL_PATH}:ro"
PATCH_MOUNTS="/tmp/patch_k3_sm120.py:/tmp/patch_k3_sm120.py:ro"
# BOOTSTRAP 在容器内执行: 打 sm_120 补丁 → 按节点 rank 计算 SGLANG_HOST_IP → 启动 sglang。
# SGLANG_HOST_IP 必须为本节点实际 IP174.1.60.5~8 = 5 + NODE_RANK
BOOTSTRAP="python3 /tmp/patch_k3_sm120.py && export SGLANG_HOST_IP=\"174.1.60.$((5 + ${NODE_RANK}))\" && exec python3 -m sglang.launch_server ${LAUNCH_ARGS}"
LAUNCH_ARGS="--model-path ${MODEL_PATH} --served-model-name ${SERVED_MODEL_NAME} --tp-size ${TP} --ep-size 32 --nnodes ${NNODES} --node-rank ${NODE_RANK} --dist-init-addr ${MASTER_IP}:${DIST_PORT} --trust-remote-code --moe-runner-backend marlin --mem-fraction-static 0.88 --cuda-graph-max-bs-decode 16 --mamba-radix-cache-strategy extra_buffer_lazy --dist-timeout 3600 --mamba-full-memory-ratio 0.36 --host 0.0.0.0 --port ${PORT}"