From 70c5c57f8fc3518403050e5f82f8fdd36e3361bb Mon Sep 17 00:00:00 2001 From: shishi Date: Wed, 29 Jul 2026 10:59:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(910c/glm52):=20start=5Fvllm=5Fdocker.sh=20?= =?UTF-8?q?=E5=8A=A0per-TP=E5=8F=82=E6=95=B0=E8=A6=86=E7=9B=96=20+=20?= =?UTF-8?q?=E4=BF=AEprintf=E8=BD=AC=E4=B9=89=E7=A0=B4=E5=9D=8FJSON?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题: add16实际启动走start_vllm_docker.sh(用config.env全局MAX_MODEL_LEN=131072), 而非engine_build_server_args(有per-TP覆盖但只写server_cmd.txt不影响启动). TP=8用131072上下文+无per-TP覆盖,且engine_build_server_args的printf %q转义 破坏了JSON(--additional-config的enable_dsa_cp等未生效),致MoE tiling失败. 修复: 1. start_vllm_docker.sh: 加per-TP case覆盖(TP=8:16384/64/0.95, TP=16:131072/256/0.92) 2. run_adaptive_concurrency_add16.sh: engine_build_server_args 用单引号包裹替代 printf %q,避免JSON被反斜杠转义(仅影响server_cmd.txt记录,实际启动走start_vllm_docker.sh) --- .../run_adaptive_concurrency_add16.sh | 18 +++++++++++++++++- .../start_vllm_docker.sh | 15 +++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/experiments/910c/glm52_910c_vllm_tp_dp_matrix/run_adaptive_concurrency_add16.sh b/experiments/910c/glm52_910c_vllm_tp_dp_matrix/run_adaptive_concurrency_add16.sh index 3012a56..dcdaf22 100755 --- a/experiments/910c/glm52_910c_vllm_tp_dp_matrix/run_adaptive_concurrency_add16.sh +++ b/experiments/910c/glm52_910c_vllm_tp_dp_matrix/run_adaptive_concurrency_add16.sh @@ -92,6 +92,12 @@ engine_build_server_args() { ;; esac log "server args tp=${tp} dp=${dp} gpu_mem_util=${mem_util} max_model_len=${max_len} max_num_seqs=${max_seqs}" >&2 + # MoE / DSA-CP args required by GLM-5.2 on vllm-ascend (must match + # start_vllm_docker.sh). --enable-expert-parallel is mandatory for + # FlashComm v1 (VLLM_ASCEND_ENABLE_FLASHCOMM1=1); without it MoE + # MoeDistributeDispatchV2 tiling fails at engine init. + local compilation_config='{"cudagraph_mode": "FULL_DECODE_ONLY"}' + local additional_config='{"enable_dsa_cp": true,"enable_sparse_sfa_c8": false, "enable_sparse_li_c8": true,"enable_balance_scheduling": true,"multistream_overlap_shared_expert":true}' local -a args=( vllm serve "$MODEL_PATH" --served-model-name "$SERVED_MODEL_NAME" @@ -99,16 +105,26 @@ engine_build_server_args() { --kv-cache-dtype "$KV_CACHE_DTYPE" --block-size "$BLOCK_SIZE" --tensor-parallel-size "$tp" + --enable-expert-parallel --gpu-memory-utilization "$mem_util" --max-model-len "$max_len" --max-num-seqs "$max_seqs" + --compilation-config "$compilation_config" + --additional-config "$additional_config" --host 0.0.0.0 --port "$ENGINE_PORT" ) if (( dp > 1 )); then args+=(--data-parallel-size "$dp") fi - printf '%q ' "${args[@]}" + # Emit args space-separated. JSON config strings are single-quoted + # verbatim (not %q-escaped) so the recorded command stays re-runnable. + local out="" + local a + for a in "${args[@]}"; do + out+="'$a' " + done + printf '%s' "$out" } engine_start_server() { diff --git a/experiments/910c/glm52_910c_vllm_tp_dp_matrix/start_vllm_docker.sh b/experiments/910c/glm52_910c_vllm_tp_dp_matrix/start_vllm_docker.sh index 2539627..40ff488 100755 --- a/experiments/910c/glm52_910c_vllm_tp_dp_matrix/start_vllm_docker.sh +++ b/experiments/910c/glm52_910c_vllm_tp_dp_matrix/start_vllm_docker.sh @@ -31,6 +31,21 @@ docker rm -f "$NAME" >/dev/null 2>&1 || true # vLLM-Ascend launch args. Differences vs NVIDIA vLLM: #\n - no --no-enable-flashinfer-autotune (Ascend uses its own attention path) #\n - --kv-cache-dtype may need to be fp16 if the image rejects fp8 on 910C +# Per-TP overrides: TP=8 has tight KV cache on 64GB/die (cap context/seqs), +# TP=16 uses all 16 dies and can serve the full 128K context. +case "$TP" in + 8) + GPU_MEMORY_UTILIZATION="${TP8_GPU_MEMORY_UTILIZATION:-0.95}" + MAX_MODEL_LEN="${TP8_MAX_MODEL_LEN:-16384}" + MAX_NUM_SEQS="${TP8_MAX_NUM_SEQS:-64}" + ;; + 16) + GPU_MEMORY_UTILIZATION="${TP16_GPU_MEMORY_UTILIZATION:-0.92}" + MAX_MODEL_LEN="${TP16_MAX_MODEL_LEN:-131072}" + MAX_NUM_SEQS="${TP16_MAX_NUM_SEQS:-256}" + ;; +esac + SERVER_ARGS=( "$MODEL_PATH" --served-model-name "$SERVED_MODEL_NAME"