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}"
|
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"
|
# Parallel configurations to test. Format: "TP DP"
|
||||||
declare -a PARALLEL_CONFIGS=(
|
declare -a PARALLEL_CONFIGS=(
|
||||||
"2 4"
|
"2 4"
|
||||||
|
|||||||
@ -15,23 +15,16 @@ from pathlib import Path
|
|||||||
|
|
||||||
|
|
||||||
def sample_concurrency(low: int, high: int, target: int) -> list[int]:
|
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
|
For the TP×DP matrix we only need the two endpoints of the concurrency
|
||||||
`target` points linearly between low and high (inclusive).
|
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}"
|
assert 1 <= low <= high, f"invalid concurrency range: {low}-{high}"
|
||||||
if high - low + 1 <= target:
|
if low == high:
|
||||||
return list(range(low, high + 1))
|
return [low]
|
||||||
|
return [low, high]
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
||||||
def generate_scenarios(matrix_path: Path, mode: str, target_samples: int) -> list[dict]:
|
def generate_scenarios(matrix_path: Path, mode: str, target_samples: int) -> list[dict]:
|
||||||
|
|||||||
@ -48,7 +48,7 @@ stop_server() {
|
|||||||
local tp="$1"
|
local tp="$1"
|
||||||
local dp="$2"
|
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
|
if [[ -f "$pid_file" ]]; then
|
||||||
local pid
|
local pid
|
||||||
pid="$(cat "$pid_file")"
|
pid="$(cat "$pid_file")"
|
||||||
|
|||||||
@ -13,15 +13,15 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
source "${SCRIPT_DIR}/config.env"
|
source "${SCRIPT_DIR}/config.env"
|
||||||
|
|
||||||
cd /data/user1/yy
|
RUNTIME_BASE="${RUNTIME_BASE:-${SCRIPT_DIR}/runtime}"
|
||||||
mkdir -p logs
|
mkdir -p "${RUNTIME_BASE}/logs" "${RUNTIME_BASE}/tmp"
|
||||||
|
|
||||||
IMAGE="${DOCKER_IMAGE:-lmsysorg/sglang:latest}"
|
IMAGE="${DOCKER_IMAGE:-lmsysorg/sglang:latest}"
|
||||||
PORT="${SGLANG_PORT:-30031}"
|
PORT="${SGLANG_PORT:-30031}"
|
||||||
NAME="${EXPERIMENT}_sglang_tp${TP}_dp${DP}"
|
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"
|
rm -f "$PID_FILE"
|
||||||
|
|
||||||
# Clean up any stale container with the same name.
|
# Clean up any stale container with the same name.
|
||||||
@ -64,7 +64,7 @@ nohup docker run --rm \
|
|||||||
--entrypoint sglang \
|
--entrypoint sglang \
|
||||||
-p "${PORT}:${PORT}" \
|
-p "${PORT}:${PORT}" \
|
||||||
-v "${MODEL_PATH}:${MODEL_PATH}:ro" \
|
-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 CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES}" \
|
||||||
-e PYTHONUNBUFFERED=1 \
|
-e PYTHONUNBUFFERED=1 \
|
||||||
"$IMAGE" \
|
"$IMAGE" \
|
||||||
|
|||||||
@ -18,17 +18,17 @@ if [[ "${USE_DOCKER:-1}" == "1" ]]; then
|
|||||||
exec "${SCRIPT_DIR}/start_sglang_docker.sh" "$@"
|
exec "${SCRIPT_DIR}/start_sglang_docker.sh" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /data/user1/yy
|
RUNTIME_BASE="${RUNTIME_BASE:-${SCRIPT_DIR}/runtime}"
|
||||||
mkdir -p logs
|
mkdir -p "${RUNTIME_BASE}/logs" "${RUNTIME_BASE}/tmp"
|
||||||
|
|
||||||
VENV="${VENV_CLIENT}"
|
VENV="${VENV_CLIENT}"
|
||||||
export PATH="$VENV/bin:$PATH"
|
export PATH="$VENV/bin:$PATH"
|
||||||
export PYTHONUNBUFFERED=1
|
export PYTHONUNBUFFERED=1
|
||||||
export TMPDIR=/data/user1/yy/tmp
|
export TMPDIR="${RUNTIME_BASE}/tmp"
|
||||||
export CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES}"
|
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"
|
LOG="${RUNTIME_BASE}/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"
|
PID_FILE="${RUNTIME_BASE}/${EXPERIMENT}_sglang_tp${TP}_dp${DP}.pid"
|
||||||
|
|
||||||
rm -f "$PID_FILE"
|
rm -f "$PID_FILE"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user