dsv4_h200_sglang_tp_dp_matrix: sample only low/high concurrency, use RUNTIME_BASE for self-contained runtime files
This commit is contained in:
parent
90d1738605
commit
db419e17b8
@ -23,6 +23,10 @@ USE_DOCKER_CLIENT="${USE_DOCKER_CLIENT:-1}"
|
||||
|
||||
export CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES:-0,1,2,3,4,5,6,7}"
|
||||
|
||||
# Runtime working directory for logs, pid files, and tmp. Defaults to a local
|
||||
# directory under this experiment so the benchmark is self-contained.
|
||||
RUNTIME_BASE="${RUNTIME_BASE:-${SCRIPT_DIR}/runtime}"
|
||||
|
||||
# Parallel configurations to test. Format: "TP DP"
|
||||
declare -a PARALLEL_CONFIGS=(
|
||||
"2 4"
|
||||
|
||||
@ -15,23 +15,16 @@ from pathlib import Path
|
||||
|
||||
|
||||
def sample_concurrency(low: int, high: int, target: int) -> list[int]:
|
||||
"""Return a sorted list of concurrency values in [low, high].
|
||||
"""Return only the low and high concurrency values in [low, high].
|
||||
|
||||
If the range is small, return every integer. Otherwise sample roughly
|
||||
`target` points linearly between low and high (inclusive).
|
||||
For the TP×DP matrix we only need the two endpoints of the concurrency
|
||||
range (e.g. 1 and 128 for ISL=1024). The `target` argument is kept for
|
||||
API compatibility but is ignored.
|
||||
"""
|
||||
assert 1 <= low <= high, f"invalid concurrency range: {low}-{high}"
|
||||
if high - low + 1 <= target:
|
||||
return list(range(low, high + 1))
|
||||
|
||||
points = set()
|
||||
points.add(low)
|
||||
points.add(high)
|
||||
step = (high - low) / (target - 1)
|
||||
for i in range(1, target - 1):
|
||||
v = low + round(step * i)
|
||||
points.add(max(low, min(high, v)))
|
||||
return sorted(points)
|
||||
if low == high:
|
||||
return [low]
|
||||
return [low, high]
|
||||
|
||||
|
||||
def generate_scenarios(matrix_path: Path, mode: str, target_samples: int) -> list[dict]:
|
||||
|
||||
@ -48,7 +48,7 @@ stop_server() {
|
||||
local tp="$1"
|
||||
local dp="$2"
|
||||
|
||||
local pid_file="/data/user1/yy/${EXPERIMENT}_sglang_tp${tp}_dp${dp}.pid"
|
||||
local pid_file="${RUNTIME_BASE}/${EXPERIMENT}_sglang_tp${tp}_dp${dp}.pid"
|
||||
if [[ -f "$pid_file" ]]; then
|
||||
local pid
|
||||
pid="$(cat "$pid_file")"
|
||||
|
||||
@ -13,15 +13,15 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# shellcheck source=/dev/null
|
||||
source "${SCRIPT_DIR}/config.env"
|
||||
|
||||
cd /data/user1/yy
|
||||
mkdir -p logs
|
||||
RUNTIME_BASE="${RUNTIME_BASE:-${SCRIPT_DIR}/runtime}"
|
||||
mkdir -p "${RUNTIME_BASE}/logs" "${RUNTIME_BASE}/tmp"
|
||||
|
||||
IMAGE="${DOCKER_IMAGE:-lmsysorg/sglang:latest}"
|
||||
PORT="${SGLANG_PORT:-30031}"
|
||||
NAME="${EXPERIMENT}_sglang_tp${TP}_dp${DP}"
|
||||
PID_FILE="/data/user1/yy/${EXPERIMENT}_sglang_tp${TP}_dp${DP}.pid"
|
||||
PID_FILE="${RUNTIME_BASE}/${EXPERIMENT}_sglang_tp${TP}_dp${DP}.pid"
|
||||
|
||||
LOG="/data/user1/yy/logs/${EXPERIMENT}_sglang_docker_tp${TP}_dp${DP}_$(date +%Y%m%d_%H%M%S).log"
|
||||
LOG="${RUNTIME_BASE}/logs/${EXPERIMENT}_sglang_docker_tp${TP}_dp${DP}_$(date +%Y%m%d_%H%M%S).log"
|
||||
rm -f "$PID_FILE"
|
||||
|
||||
# Clean up any stale container with the same name.
|
||||
@ -64,7 +64,7 @@ nohup docker run --rm \
|
||||
--entrypoint sglang \
|
||||
-p "${PORT}:${PORT}" \
|
||||
-v "${MODEL_PATH}:${MODEL_PATH}:ro" \
|
||||
-v /data/user1/yy/tmp:/tmp \
|
||||
-v "${RUNTIME_BASE}/tmp:/tmp" \
|
||||
-e CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES}" \
|
||||
-e PYTHONUNBUFFERED=1 \
|
||||
"$IMAGE" \
|
||||
|
||||
@ -18,17 +18,17 @@ if [[ "${USE_DOCKER:-1}" == "1" ]]; then
|
||||
exec "${SCRIPT_DIR}/start_sglang_docker.sh" "$@"
|
||||
fi
|
||||
|
||||
cd /data/user1/yy
|
||||
mkdir -p logs
|
||||
RUNTIME_BASE="${RUNTIME_BASE:-${SCRIPT_DIR}/runtime}"
|
||||
mkdir -p "${RUNTIME_BASE}/logs" "${RUNTIME_BASE}/tmp"
|
||||
|
||||
VENV="${VENV_CLIENT}"
|
||||
export PATH="$VENV/bin:$PATH"
|
||||
export PYTHONUNBUFFERED=1
|
||||
export TMPDIR=/data/user1/yy/tmp
|
||||
export TMPDIR="${RUNTIME_BASE}/tmp"
|
||||
export CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES}"
|
||||
|
||||
LOG="/data/user1/yy/logs/${EXPERIMENT}_sglang_tp${TP}_dp${DP}_$(date +%Y%m%d_%H%M%S).log"
|
||||
PID_FILE="/data/user1/yy/${EXPERIMENT}_sglang_tp${TP}_dp${DP}.pid"
|
||||
LOG="${RUNTIME_BASE}/logs/${EXPERIMENT}_sglang_tp${TP}_dp${DP}_$(date +%Y%m%d_%H%M%S).log"
|
||||
PID_FILE="${RUNTIME_BASE}/${EXPERIMENT}_sglang_tp${TP}_dp${DP}.pid"
|
||||
|
||||
rm -f "$PID_FILE"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user