main
sh 26 lines 754 Bytes
Raw
1 #!/bin/sh
2
3 if [ -z "${_VLLM_INTERNAL_NUMACTL_ARGS:-}" ]; then
4 echo "_VLLM_INTERNAL_NUMACTL_ARGS is not set" >&2
5 exit 1
6 fi
7
8 if [ -z "${_VLLM_INTERNAL_NUMACTL_PYTHON_EXECUTABLE:-}" ]; then
9 echo "_VLLM_INTERNAL_NUMACTL_PYTHON_EXECUTABLE is not set" >&2
10 exit 1
11 fi
12
13 if ! command -v numactl >/dev/null 2>&1; then
14 echo "numactl is not available on PATH" >&2
15 exit 1
16 fi
17
18 case "${_VLLM_INTERNAL_NUMACTL_ARGS}" in
19 *[![:alnum:]\ _=,./-]*)
20 echo "Invalid characters in _VLLM_INTERNAL_NUMACTL_ARGS" >&2
21 exit 1
22 ;;
23 esac
24
25 # shellcheck disable=SC2086 # word splitting is intentional: this expands into multiple numactl flags
26 exec numactl ${_VLLM_INTERNAL_NUMACTL_ARGS} "${_VLLM_INTERNAL_NUMACTL_PYTHON_EXECUTABLE}" "$@"