sglang tp_dp_matrix: fix empty DATASET_PATH causing docker invalid spec
When DATASET_PATH is empty, -v ::ro is passed to docker run, which produces 'invalid spec: ::ro: empty section between colons'. Build the volume args dynamically and only add the dataset mount when the path is non-empty.
This commit is contained in:
parent
4ea6e92b42
commit
605b976fb8
@ -120,11 +120,15 @@ restart_server() {
|
|||||||
run_bench_serving() {
|
run_bench_serving() {
|
||||||
# Run sglang.bench_serving either natively or inside the SGLang Docker image.
|
# Run sglang.bench_serving either natively or inside the SGLang Docker image.
|
||||||
if [[ "${USE_DOCKER_CLIENT:-1}" == "1" ]]; then
|
if [[ "${USE_DOCKER_CLIENT:-1}" == "1" ]]; then
|
||||||
|
local vol_args=()
|
||||||
|
vol_args+=("-v" "${MODEL_PATH}:${MODEL_PATH}:ro")
|
||||||
|
if [[ -n "${DATASET_PATH:-}" ]]; then
|
||||||
|
vol_args+=("-v" "${DATASET_PATH}:${DATASET_PATH}:ro")
|
||||||
|
fi
|
||||||
|
vol_args+=("-v" "${RESULT_BASE}:${RESULT_BASE}")
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
--network host \
|
--network host \
|
||||||
-v "${MODEL_PATH}:${MODEL_PATH}:ro" \
|
"${vol_args[@]}" \
|
||||||
-v "${DATASET_PATH}:${DATASET_PATH}:ro" \
|
|
||||||
-v "${RESULT_BASE}:${RESULT_BASE}" \
|
|
||||||
-e PYTHONUNBUFFERED=1 \
|
-e PYTHONUNBUFFERED=1 \
|
||||||
"${DOCKER_IMAGE}" \
|
"${DOCKER_IMAGE}" \
|
||||||
python -m sglang.bench_serving "$@"
|
python -m sglang.bench_serving "$@"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user