Files
vLLM/vllm/utils/numa_wrapper.sh
T
2026-08-20 10:09:59 +00:00

28 lines
866 B
Bash
Executable File

#!/bin/sh
if [ -z "${_VLLM_INTERNAL_NUMACTL_ARGS:-}" ]; then
echo "_VLLM_INTERNAL_NUMACTL_ARGS is not set" >&2
exit 1
fi
if [ -z "${_VLLM_INTERNAL_NUMACTL_PYTHON_EXECUTABLE:-}" ]; then
echo "_VLLM_INTERNAL_NUMACTL_PYTHON_EXECUTABLE is not set" >&2
exit 1
fi
if ! command -v numactl >/dev/null 2>&1; then
echo "numactl is not available on PATH" >&2
exit 1
fi
# shellcheck disable=SC1001 # verified equivalent behavior; TODO: revisit escaping in a follow-up cleanup PR
case "${_VLLM_INTERNAL_NUMACTL_ARGS}" in
*[![:alnum:]\ \-\_=,./]*)
echo "Invalid characters in _VLLM_INTERNAL_NUMACTL_ARGS" >&2
exit 1
;;
esac
# shellcheck disable=SC2086 # word splitting is intentional: this expands into multiple numactl flags
exec numactl ${_VLLM_INTERNAL_NUMACTL_ARGS} "${_VLLM_INTERNAL_NUMACTL_PYTHON_EXECUTABLE}" "$@"