mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-27 20:57:27 +08:00
Signed-off-by: youkaichao <youkaichao@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
24 lines
798 B
Python
24 lines
798 B
Python
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
import os
|
|
|
|
import torch
|
|
|
|
from vllm.logger import init_logger
|
|
|
|
logger = init_logger(__name__)
|
|
|
|
# set some common config/environment variables that should be set
|
|
# for all processes created by vllm and all processes
|
|
# that interact with vllm workers.
|
|
# they are executed whenever `import vllm` is called.
|
|
|
|
# see https://github.com/vllm-project/vllm/pull/15951
|
|
# it avoids unintentional cuda initialization from torch.cuda.is_available()
|
|
os.environ['PYTORCH_NVML_BASED_CUDA_CHECK'] = '1'
|
|
|
|
# see https://github.com/vllm-project/vllm/issues/10480
|
|
os.environ['TORCHINDUCTOR_COMPILE_THREADS'] = '1'
|
|
# see https://github.com/vllm-project/vllm/issues/10619
|
|
torch._inductor.config.compile_threads = 1
|