shishi 46e79d63e7 feat(platform): add Ascend 910C NPU platform support
- platforms/ascend_910c.env: 8-card 910C config (16 dies, 64GB HBM/die),
  Ascend Docker Runtime, ASCEND_VISIBLE_DEVICES device selection
- scripts/common/platform.sh: auto-detect 910C via npu-smi + Huawei PCI IDs
- scripts/common/npu_smi_sampler.py: standalone npu-smi -> nvidia-smi CSV
  sampler so parse_backend.py needs no changes
- experiments/910c/glm52_910c_vllm_tp_dp_matrix/: GLM-5.2 (w4a8c8) experiment,
  model present on host, ready for smoke after image load
- experiments/910c/dsv4_910c_vllm_tp_dp_matrix/: DSV4-Flash experiment
  (placeholder MODEL_PATH, weights not yet downloaded)
- envs/ASCEND_910C_ENV_SETUP.md: full onboarding guide (permissions, image
  load, Ascend Docker Runtime, NPU monitor, known pitfalls)
- Both experiments: TP2/DP4 + TP4/DP2 + TP8/DP1, matrix.json capped at 128K
  context per 64GB HBM/die
2026-07-27 22:00:05 +08:00

89 lines
3.6 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.

# TP×DP matrix experiment for DeepSeek-V4-Flash on Ascend 910C (8 NPUs / 16 dies)
# using vLLM-Ascend.
# Tests vLLM with three parallel configurations:
# TP=2, DP=4 -> 2 dies per replica, 4 replicas
# TP=4, DP=2 -> 4 dies per replica, 2 replicas
# TP=8, DP=1 -> 8 dies, no data parallelism
#
# Platform: ascend_910c (see platforms/ascend_910c.env).
# Host: 910c.1 / NPU-NODE61, openEuler 22.03 SP4 aarch64, driver 25.5.2, CANN 9.0.0.
#
# ⚠️ PLACEHOLDER: DeepSeek-V4-Flash weights are NOT yet present on this host
# (only GLM-5.2-{w4a8c8,w8a8} under /mnt/models). Download DSV4-Flash first,
# then fix MODEL_PATH below. Smoke run will fail until the model exists.
# Recommended host path: /mnt/models/DeepSeek-V4-Flash (FP8)
# /mnt/models/DeepSeek-V4-Flash-INT8 (INT8)
EXPERIMENT="dsv4_910c_vllm_tp_dp_matrix"
MODEL_NAME="DeepSeek-V4-Flash"
# TODO: point this at the real DSV4-Flash directory once downloaded.
MODEL_PATH="${MODEL_PATH:-/mnt/models/DeepSeek-V4-Flash}"
SERVED_MODEL_NAME="deepseek-v4-flash"
VLLM_PORT="${VLLM_PORT:-30052}"
# Dedicated container name so this experiment never touches other 910c runs.
CONTAINER_NAME="${CONTAINER_NAME:-vllm-ascend-dsv4-910c}"
# Python interpreter for the benchmark client inside the vllm-ascend container.
CONTAINER_PYTHON="${CONTAINER_PYTHON:-/usr/local/bin/python}"
# vllm-ascend image. Use the general v0.23 image for DSV4 (the GLM5.2-tuned
# variant may carry GLM-specific patches). Load from:
# /mnt/models/vllm-ascend-v0.23.0rc1-a3-openeuler.tar
USE_DOCKER="${USE_DOCKER:-1}"
DOCKER_IMAGE="${DOCKER_IMAGE:-vllm-ascend:v0.23.0rc1-a3-openeuler}"
DOCKER_CLIENT_IMAGE="${DOCKER_CLIENT_IMAGE:-lmsysorg/sglang:latest}"
USE_DOCKER_CLIENT="${USE_DOCKER_CLIENT:-0}"
export ASCEND_VISIBLE_DEVICES="${ASCEND_VISIBLE_DEVICES:-0,1,2,3,4,5,6,7}"
export CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES:-0,1,2,3,4,5,6,7}"
RUNTIME_BASE="${RUNTIME_BASE:-${SCRIPT_DIR}/runtime}"
# Parallel configurations to test. Format: "TP DP"
# DSV4-Flash FP8 routed-expert weights ~264 GiB total. Per-die load = 264/TP GiB.
# TP=2 -> 132 GiB/die > 64 GiB HBM ❌ OOM expected (kept but will fail)
# TP=4 -> 66 GiB/die > 64 GiB HBM ❌ borderline OOM (KV cache leaves no room)
# TP=8 -> 33 GiB/die < 64 GiB HBM ✅ fits with room for KV cache
# TP=2/DP=4 and TP=4/DP=2 are likely infeasible for FP8 on 64GB dies; they are
# kept here so the smoke run records the OOM boundary explicitly. Switch to
# INT8 weights (MODEL_PATH=...-INT8, ~132 GiB total) to make TP=4 viable.
if [[ -n "${PARALLEL_CONFIGS_STR:-}" ]]; then
declare -a PARALLEL_CONFIGS=()
for pair in $PARALLEL_CONFIGS_STR; do
PARALLEL_CONFIGS+=("${pair//,/ }")
done
else
declare -a PARALLEL_CONFIGS=(
"2 4"
"4 2"
"8 1"
)
fi
# vLLM-Ascend server settings for DSV4-Flash.
GPU_MEMORY_UTILIZATION="${GPU_MEMORY_UTILIZATION:-0.9}"
KV_CACHE_DTYPE="${KV_CACHE_DTYPE:-fp8}"
BLOCK_SIZE="${BLOCK_SIZE:-128}"
# DSV4-Flash supports up to 1M context, but 64GB HBM/die caps realistic ISL.
# Start at 128K; extend via matrix.json once TP=8 is verified.
MAX_MODEL_LEN="${MAX_MODEL_LEN:-131072}"
MAX_NUM_SEQS="${MAX_NUM_SEQS:-256}"
VLLM_ASCEND_ATTENTION_BACKEND="${VLLM_ASCEND_ATTENTION_BACKEND:-atb}"
DATASET_PATH="${DATASET_PATH:-${ROOT_DIR}/datasets/ShareGPT_V3_unfiltered_cleaned_split.json}"
MATRIX_FILE="${MATRIX_FILE:-${SCRIPT_DIR:-.}/matrix.json}"
MATRIX_MODE="${MATRIX_MODE:-Y}"
export CONCURRENCY_SAMPLES="${CONCURRENCY_SAMPLES:-2}"
SCENARIO_TIMEOUT_S="${SCENARIO_TIMEOUT_S:-1800}"
GPU_MEM_SAMPLE_INTERVAL_S="${GPU_MEM_SAMPLE_INTERVAL_S:-1}"
DRY_RUN="${DRY_RUN:-0}"
GRID_LIMIT="${GRID_LIMIT:-0}"