sglang tp_dp_matrix: fix timeout calling bash function (rc=127)
timeout(1) cannot execute shell functions directly; it needs a standalone command. Export run_bench_serving via export -f and wrap both warmup and scenario runs in bash -c so the function is visible in the subshell.
This commit is contained in:
parent
938b2f1e88
commit
4ea6e92b42
@ -132,26 +132,29 @@ run_bench_serving() {
|
|||||||
"$PYTHON" -m sglang.bench_serving "$@"
|
"$PYTHON" -m sglang.bench_serving "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
export -f run_bench_serving
|
||||||
|
|
||||||
run_warmup() {
|
run_warmup() {
|
||||||
local input_len="$1"
|
local input_len="$1"
|
||||||
local output_len="$2"
|
local output_len="$2"
|
||||||
|
|
||||||
log "warming up (input=${input_len}, output=${output_len}, num=1)"
|
log "warming up (input=${input_len}, output=${output_len}, num=1)"
|
||||||
run_bench_serving \
|
bash -c '
|
||||||
--backend sglang \
|
run_bench_serving \
|
||||||
--host 127.0.0.1 \
|
--backend sglang \
|
||||||
--port "$SGLANG_PORT" \
|
--host 127.0.0.1 \
|
||||||
--dataset-name random \
|
--port "'"$SGLANG_PORT"'" \
|
||||||
--dataset-path "$DATASET_PATH" \
|
--dataset-name random \
|
||||||
--random-input-len "$input_len" \
|
--dataset-path "'"$DATASET_PATH"'" \
|
||||||
--random-output-len "$output_len" \
|
--random-input-len "'"$input_len"'" \
|
||||||
--num-prompts 1 \
|
--random-output-len "'"$output_len"'" \
|
||||||
--max-concurrency 1 \
|
--num-prompts 1 \
|
||||||
--request-rate 10000 \
|
--max-concurrency 1 \
|
||||||
--output-file /dev/null \
|
--request-rate 10000 \
|
||||||
--output-details \
|
--output-file /dev/null \
|
||||||
>> "${log_dir_global}/warmup.log" 2>&1
|
--output-details \
|
||||||
|
>> "'"${log_dir_global}/warmup.log"'" 2>&1
|
||||||
|
'
|
||||||
log "warmup completed"
|
log "warmup completed"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,21 +418,22 @@ run_parallel_config() {
|
|||||||
gpu_pid="$(start_gpu_monitor "$gpu_csv")"
|
gpu_pid="$(start_gpu_monitor "$gpu_csv")"
|
||||||
|
|
||||||
bench_rc=0
|
bench_rc=0
|
||||||
timeout "$SCENARIO_TIMEOUT_S" \
|
timeout "$SCENARIO_TIMEOUT_S" bash -c '
|
||||||
run_bench_serving \
|
run_bench_serving \
|
||||||
--backend sglang \
|
--backend sglang \
|
||||||
--host 127.0.0.1 \
|
--host 127.0.0.1 \
|
||||||
--port "$SGLANG_PORT" \
|
--port "'"$SGLANG_PORT"'" \
|
||||||
--dataset-name random \
|
--dataset-name random \
|
||||||
--dataset-path "$DATASET_PATH" \
|
--dataset-path "'"$DATASET_PATH"'" \
|
||||||
--random-input-len "$isl" \
|
--random-input-len "'"$isl"'" \
|
||||||
--random-output-len "$dsl" \
|
--random-output-len "'"$dsl"'" \
|
||||||
--num-prompts "$num" \
|
--num-prompts "'"$num"'" \
|
||||||
--max-concurrency "$conc" \
|
--max-concurrency "'"$conc"'" \
|
||||||
--request-rate 10000 \
|
--request-rate 10000 \
|
||||||
--output-file "$output_file" \
|
--output-file "'"$output_file"'" \
|
||||||
--output-details \
|
--output-details \
|
||||||
> "$detail_log" 2>&1 || bench_rc=$?
|
> "'"$detail_log"'" 2>&1
|
||||||
|
' || bench_rc=$?
|
||||||
|
|
||||||
stop_gpu_monitor "$gpu_pid"
|
stop_gpu_monitor "$gpu_pid"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user