# TP×DP matrix experiment for DeepSeek-V4-Flash on H200 (8 GPUs) using SGLang Docker. # Tests SGLang with three parallel configurations: # TP=2, DP=4 -> 2 GPUs per replica, 4 replicas # TP=4, DP=2 -> 4 GPUs per replica, 2 replicas # TP=8, DP=1 -> 8 GPUs, no data parallelism EXPERIMENT="dsv4_h200_sglang_tp_dp_matrix" MODEL_NAME="DeepSeek-V4-Flash" MODEL_PATH="/data3/hf_models/DeepSeek-V4-Flash" SERVED_MODEL_NAME="deepseek-v4-flash" SGLANG_PORT="${SGLANG_PORT:-30031}" # Python interpreter for orchestration scripts (parse_backend.py, compare.py, etc.) # and the benchmark client. Defaults to the system python3 if the sglang venv # does not exist on the host. VENV_CLIENT="${VENV_CLIENT:-/data/user1/yy/envs/sglang}" # When USE_DOCKER_CLIENT=1, the benchmark client (sglang.bench_serving) is run # inside the same SGLang Docker image used for the server. This avoids requiring # a native sglang installation on the host. USE_DOCKER_CLIENT="${USE_DOCKER_CLIENT:-1}" export CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES:-0,1,2,3,4,5,6,7}" # Parallel configurations to test. Format: "TP DP" declare -a PARALLEL_CONFIGS=( "2 4" "4 2" "8 1" ) # SGLang server settings CONTEXT_LENGTH="${CONTEXT_LENGTH:-65536}" MAX_RUNNING_REQUESTS="${MAX_RUNNING_REQUESTS:-64}" MEM_FRACTION_STATIC="${MEM_FRACTION_STATIC:-0.88}" MOE_RUNNER_BACKEND="${MOE_RUNNER_BACKEND:-marlin}" # Docker deployment switch. SGLang is launched via Docker using the image below. USE_DOCKER="${USE_DOCKER:-1}" DOCKER_IMAGE="${DOCKER_IMAGE:-lmsysorg/sglang:latest}" # Matrix and concurrency rules are defined in matrix.json by default. MATRIX_FILE="${MATRIX_FILE:-${SCRIPT_DIR:-.}/matrix.json}" MATRIX_MODE="${MATRIX_MODE:-Y}" # Sampling density for concurrency. 0 means use the default heuristic in # generate_scenarios.py (6-8 points, or all integers when range is small). CONCURRENCY_SAMPLES="${CONCURRENCY_SAMPLES:-0}" # Per-scenario timeout to avoid hangs (seconds). SCENARIO_TIMEOUT_S="${SCENARIO_TIMEOUT_S:-1800}" # GPU memory sampling interval (seconds). GPU_MEM_SAMPLE_INTERVAL_S="${GPU_MEM_SAMPLE_INTERVAL_S:-1}" # Dry-run mode: if 1, only log the server args and scenario plan without starting # any server or sending requests. DRY_RUN="${DRY_RUN:-0}" # Per-config scenario limit for quick smoke tests. 0 = run all generated scenarios. GRID_LIMIT="${GRID_LIMIT:-0}"