Skip to content

Commit d3e2ac2

Browse files
authored
Refactor GPU count to use _gpus_per_node in vllm and env validation (#657)
1 parent 9061cc1 commit d3e2ac2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cloudai/workloads/ai_dynamo/ai_dynamo.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ _compute_worker_allocation_sglang() {
277277
_compute_worker_allocation_vllm() {
278278
local tp_arg_name="--${dynamo_args["tp-arg-name"]}"
279279
local pp_arg_name="--${dynamo_args["pp-arg-name"]}"
280-
local num_gpus=$(echo "${CUDA_VISIBLE_DEVICES:-}" | tr ',' '\n' | grep -c .)
280+
local num_gpus="$(_gpus_per_node)"
281281

282282
if [[ $num_gpus -eq 0 ]]; then
283283
log "ERROR: No GPUs found in CUDA_VISIBLE_DEVICES"
@@ -569,8 +569,7 @@ validate_environment() {
569569
fi
570570

571571
# GPU count sanity
572-
local num_gpus
573-
num_gpus=$(echo "${CUDA_VISIBLE_DEVICES}" | tr ',' '\n' | grep -c . || true)
572+
local num_gpus="$(_gpus_per_node)"
574573
if [[ "$num_gpus" -le 0 ]]; then
575574
log "ERROR: Parsed zero GPUs from CUDA_VISIBLE_DEVICES='${CUDA_VISIBLE_DEVICES}'"
576575
exit 1

0 commit comments

Comments
 (0)