vllm-project / vllm

A high-throughput and memory-efficient inference and serving engine for LLMs
https://docs.vllm.ai
Apache License 2.0
31.07k stars 4.72k forks source link

[Usage]: Single-node multi-GPU inference #8257

Open zhentingqi opened 2 months ago

zhentingqi commented 2 months ago

Your current environment

PyTorch version: 2.4.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Red Hat Enterprise Linux 9.4 (Plow) (x86_64)
GCC version: (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3)
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.34

Python version: 3.10.14 (main, May  6 2024, 19:42:50) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.14.0-427.22.1.el9_4.x86_64-x86_64-with-glibc2.34
Is CUDA available: True
CUDA runtime version: 12.5.40
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: NVIDIA H100 80GB HBM3
GPU 1: NVIDIA H100 80GB HBM3
GPU 2: NVIDIA H100 80GB HBM3
GPU 3: NVIDIA H100 80GB HBM3
GPU 4: NVIDIA H100 80GB HBM3
GPU 5: NVIDIA H100 80GB HBM3
GPU 6: NVIDIA H100 80GB HBM3
GPU 7: NVIDIA H100 80GB HBM3

Nvidia driver version: 555.42.02
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      46 bits physical, 57 bits virtual
Byte Order:                         Little Endian
CPU(s):                             96
On-line CPU(s) list:                0-95
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Xeon(R) Platinum 8468
CPU family:                         6
Model:                              143
Thread(s) per core:                 1
Core(s) per socket:                 48
Socket(s):                          2
Stepping:                           8
CPU(s) scaling MHz:                 100%
CPU max MHz:                        3800.0000
CPU min MHz:                        800.0000
BogoMIPS:                           4200.00
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities
L1d cache:                          4.5 MiB (96 instances)
L1i cache:                          3 MiB (96 instances)
L2 cache:                           192 MiB (96 instances)
L3 cache:                           210 MiB (2 instances)
NUMA node(s):                       2
NUMA node0 CPU(s):                  0-47
NUMA node1 CPU(s):                  48-95
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Not affected
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Enhanced / Automatic IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.1.3.1
[pip3] nvidia-cuda-cupti-cu12==12.1.105
[pip3] nvidia-cuda-nvrtc-cu12==12.1.105
[pip3] nvidia-cuda-runtime-cu12==12.1.105
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.0.2.54
[pip3] nvidia-curand-cu12==10.3.2.106
[pip3] nvidia-cusolver-cu12==11.4.5.107
[pip3] nvidia-cusparse-cu12==12.1.0.106
[pip3] nvidia-ml-py==12.560.30
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] nvidia-nvjitlink-cu12==12.6.68
[pip3] nvidia-nvtx-cu12==12.1.105
[pip3] pyzmq==26.2.0
[pip3] torch==2.4.0
[pip3] torchvision==0.19.0
[pip3] transformers==4.44.2
[pip3] triton==3.0.0
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] nvidia-cublas-cu12        12.1.3.1                 pypi_0    pypi
[conda] nvidia-cuda-cupti-cu12    12.1.105                 pypi_0    pypi
[conda] nvidia-cuda-nvrtc-cu12    12.1.105                 pypi_0    pypi
[conda] nvidia-cuda-runtime-cu12  12.1.105                 pypi_0    pypi
[conda] nvidia-cudnn-cu12         9.1.0.70                 pypi_0    pypi
[conda] nvidia-cufft-cu12         11.0.2.54                pypi_0    pypi
[conda] nvidia-curand-cu12        10.3.2.106               pypi_0    pypi
[conda] nvidia-cusolver-cu12      11.4.5.107               pypi_0    pypi
[conda] nvidia-cusparse-cu12      12.1.0.106               pypi_0    pypi
[conda] nvidia-ml-py              12.560.30                pypi_0    pypi
[conda] nvidia-nccl-cu12          2.20.5                   pypi_0    pypi
[conda] nvidia-nvjitlink-cu12     12.6.68                  pypi_0    pypi
[conda] nvidia-nvtx-cu12          12.1.105                 pypi_0    pypi
[conda] pyzmq                     26.2.0                   pypi_0    pypi
[conda] torch                     2.4.0                    pypi_0    pypi
[conda] torchvision               0.19.0                   pypi_0    pypi
[conda] transformers              4.44.2                   pypi_0    pypi
[conda] triton                    3.0.0                    pypi_0    pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.6.0@32e7db25365415841ebc7c4215851743fbb1bad1
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    GPU1    GPU2    GPU3    GPU4    GPU5    GPU6    GPU7    NIC0    NIC1    NIC2    NIC3    NIC4    NIC5    NIC6    NIC7    NIC8    NIC9    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      NV18    NV18    NV18    NV18    NV18    NV18    NV18    PIX     PIX     NODE    NODE    NODE    SYS     SYS     SYS     SYS     SYS     0-47    0               N/A
GPU1    NV18     X      NV18    NV18    NV18    NV18    NV18    NV18    NODE    NODE    PIX     NODE    NODE    SYS     SYS     SYS     SYS     SYS     0-47    0               N/A
GPU2    NV18    NV18     X      NV18    NV18    NV18    NV18    NV18    NODE    NODE    NODE    PIX     NODE    SYS     SYS     SYS     SYS     SYS     0-47    0               N/A
GPU3    NV18    NV18    NV18     X      NV18    NV18    NV18    NV18    NODE    NODE    NODE    NODE    PIX     SYS     SYS     SYS     SYS     SYS     0-47    0               N/A
GPU4    NV18    NV18    NV18    NV18     X      NV18    NV18    NV18    SYS     SYS     SYS     SYS     SYS     PIX     PIX     NODE    NODE    NODE    48-95   1               N/A
GPU5    NV18    NV18    NV18    NV18    NV18     X      NV18    NV18    SYS     SYS     SYS     SYS     SYS     NODE    NODE    PIX     NODE    NODE    48-95   1               N/A
GPU6    NV18    NV18    NV18    NV18    NV18    NV18     X      NV18    SYS     SYS     SYS     SYS     SYS     NODE    NODE    NODE    PIX     NODE    48-95   1               N/A
GPU7    NV18    NV18    NV18    NV18    NV18    NV18    NV18     X      SYS     SYS     SYS     SYS     SYS     NODE    NODE    NODE    NODE    PIX     48-95   1               N/A
NIC0    PIX     NODE    NODE    NODE    SYS     SYS     SYS     SYS      X      PIX     NODE    NODE    NODE    SYS     SYS     SYS     SYS     SYS
NIC1    PIX     NODE    NODE    NODE    SYS     SYS     SYS     SYS     PIX      X      NODE    NODE    NODE    SYS     SYS     SYS     SYS     SYS
NIC2    NODE    PIX     NODE    NODE    SYS     SYS     SYS     SYS     NODE    NODE     X      NODE    NODE    SYS     SYS     SYS     SYS     SYS
NIC3    NODE    NODE    PIX     NODE    SYS     SYS     SYS     SYS     NODE    NODE    NODE     X      NODE    SYS     SYS     SYS     SYS     SYS
NIC4    NODE    NODE    NODE    PIX     SYS     SYS     SYS     SYS     NODE    NODE    NODE    NODE     X      SYS     SYS     SYS     SYS     SYS
NIC5    SYS     SYS     SYS     SYS     PIX     NODE    NODE    NODE    SYS     SYS     SYS     SYS     SYS      X      PIX     NODE    NODE    NODE
NIC6    SYS     SYS     SYS     SYS     PIX     NODE    NODE    NODE    SYS     SYS     SYS     SYS     SYS     PIX      X      NODE    NODE    NODE
NIC7    SYS     SYS     SYS     SYS     NODE    PIX     NODE    NODE    SYS     SYS     SYS     SYS     SYS     NODE    NODE     X      NODE    NODE
NIC8    SYS     SYS     SYS     SYS     NODE    NODE    PIX     NODE    SYS     SYS     SYS     SYS     SYS     NODE    NODE    NODE     X      NODE
NIC9    SYS     SYS     SYS     SYS     NODE    NODE    NODE    PIX     SYS     SYS     SYS     SYS     SYS     NODE    NODE    NODE    NODE     X 

Legend:

  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks

NIC Legend:

  NIC0: mlx5_0
  NIC1: mlx5_1
  NIC2: mlx5_2
  NIC3: mlx5_3
  NIC4: mlx5_4
  NIC5: mlx5_5
  NIC6: mlx5_6
  NIC7: mlx5_7
  NIC8: mlx5_8
  NIC9: mlx5_9

How would you like to use vllm

I want to run inference of a "Qwen/Qwen1.5-72B-Chat".

code:

from vllm import LLM
import torch
import os

num_gpus = torch.cuda.device_count()

llm = LLM(
    model="Qwen/Qwen1.5-72B-Chat",
    tensor_parallel_size=num_gpus,
    max_model_len=4096,
)

output = llm.generate("San Franciso is a")
print(output)

error:

Number of GPUs: 8
Creating LLM model...
INFO 09-07 02:33:37 config.py:890] Defaulting to use mp for distributed inference
INFO 09-07 02:33:37 llm_engine.py:213] Initializing an LLM engine (v0.6.0) with config: model='Qwen/Qwen1.5-72B-Chat', speculative_config=None, tokenizer='Qwen/Qwen1.5-72B-Chat', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, override_neuron_config=None, rope_scaling=None, rope_theta=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.bfloat16, max_seq_len=4096, download_dir='/xxx/model_ckpts_hf', load_format=LoadFormat.AUTO, tensor_parallel_size=8, pipeline_parallel_size=1, disable_custom_all_reduce=False, quantization=None, enforce_eager=False, kv_cache_dtype=auto, quantization_param_path=None, device_config=cuda, decoding_config=DecodingConfig(guided_decoding_backend='outlines'), observability_config=ObservabilityConfig(otlp_traces_endpoint=None, collect_model_forward_time=False, collect_model_execute_time=False), seed=0, served_model_name=Qwen/Qwen1.5-72B-Chat, use_v2_block_manager=False, num_scheduler_steps=1, enable_prefix_caching=False, use_async_output_proc=True)
WARNING 09-07 02:33:37 multiproc_gpu_executor.py:56] Reducing Torch parallelism from 96 threads to 1 to avoid unnecessary CPU contention. Set OMP_NUM_THREADS in the external environment to tune this value as needed.
INFO 09-07 02:33:37 custom_cache_manager.py:17] Setting Triton cache manager to: vllm.triton_utils.custom_cache_manager:CustomCacheManager
(VllmWorkerProcess pid=1254317) INFO 09-07 02:33:38 multiproc_worker_utils.py:215] Worker ready; awaiting tasks
(VllmWorkerProcess pid=1254319) INFO 09-07 02:33:38 multiproc_worker_utils.py:215] Worker ready; awaiting tasks
(VllmWorkerProcess pid=1254322) INFO 09-07 02:33:38 multiproc_worker_utils.py:215] Worker ready; awaiting tasks
(VllmWorkerProcess pid=1254318) INFO 09-07 02:33:38 multiproc_worker_utils.py:215] Worker ready; awaiting tasks
(VllmWorkerProcess pid=1254321) INFO 09-07 02:33:38 multiproc_worker_utils.py:215] Worker ready; awaiting tasks
(VllmWorkerProcess pid=1254320) INFO 09-07 02:33:38 multiproc_worker_utils.py:215] Worker ready; awaiting tasks
(VllmWorkerProcess pid=1254316) INFO 09-07 02:33:38 multiproc_worker_utils.py:215] Worker ready; awaiting tasks
INFO 09-07 02:33:53 utils.py:977] Found nccl from library libnccl.so.2
(VllmWorkerProcess pid=1254317) INFO 09-07 02:33:53 utils.py:977] Found nccl from library libnccl.so.2
(VllmWorkerProcess pid=1254316) INFO 09-07 02:33:53 utils.py:977] Found nccl from library libnccl.so.2
INFO 09-07 02:33:53 pynccl.py:63] vLLM is using nccl==2.20.5
(VllmWorkerProcess pid=1254317) INFO 09-07 02:33:53 pynccl.py:63] vLLM is using nccl==2.20.5
(VllmWorkerProcess pid=1254316) INFO 09-07 02:33:53 pynccl.py:63] vLLM is using nccl==2.20.5
(VllmWorkerProcess pid=1254319) INFO 09-07 02:33:53 utils.py:977] Found nccl from library libnccl.so.2
(VllmWorkerProcess pid=1254318) INFO 09-07 02:33:53 utils.py:977] Found nccl from library libnccl.so.2
(VllmWorkerProcess pid=1254319) INFO 09-07 02:33:53 pynccl.py:63] vLLM is using nccl==2.20.5
(VllmWorkerProcess pid=1254320) INFO 09-07 02:33:53 utils.py:977] Found nccl from library libnccl.so.2
(VllmWorkerProcess pid=1254322) INFO 09-07 02:33:53 utils.py:977] Found nccl from library libnccl.so.2
(VllmWorkerProcess pid=1254318) INFO 09-07 02:33:53 pynccl.py:63] vLLM is using nccl==2.20.5
(VllmWorkerProcess pid=1254320) INFO 09-07 02:33:53 pynccl.py:63] vLLM is using nccl==2.20.5
(VllmWorkerProcess pid=1254321) INFO 09-07 02:33:53 utils.py:977] Found nccl from library libnccl.so.2
(VllmWorkerProcess pid=1254322) INFO 09-07 02:33:53 pynccl.py:63] vLLM is using nccl==2.20.5
(VllmWorkerProcess pid=1254321) INFO 09-07 02:33:53 pynccl.py:63] vLLM is using nccl==2.20.5
INFO 09-07 02:34:03 custom_all_reduce_utils.py:204] generating GPU P2P access cache in /xxx/model_ckpts_hf/vllm/gpu_p2p_access_cache_for_0,1,2,3,4,5,6,7.json
[rank0]: Traceback (most recent call last):
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/custom_all_reduce_utils.py", line 227, in gpu_p2p_access_check
[rank0]:     returned.check_returncode()
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/subprocess.py", line 457, in check_returncode
[rank0]:     raise CalledProcessError(self.returncode, self.args, self.stdout,
[rank0]: subprocess.CalledProcessError: Command '['/xxx/miniconda3/envs/math/bin/python', '/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/custom_all_reduce_utils.py']' returned non-zero exit status 1.

[rank0]: The above exception was the direct cause of the following exception:

[rank0]: Traceback (most recent call last):
[rank0]:   File "/xxx/MetaMath/test/vllm_multigpu.py", line 10, in <module>
[rank0]:     llm = LLM(
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/entrypoints/llm.py", line 177, in __init__
[rank0]:     self.llm_engine = LLMEngine.from_engine_args(
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/engine/llm_engine.py", line 538, in from_engine_args
[rank0]:     engine = cls(
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/engine/llm_engine.py", line 305, in __init__
[rank0]:     self.model_executor = executor_class(
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/executor/distributed_gpu_executor.py", line 26, in __init__
[rank0]:     super().__init__(*args, **kwargs)
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/executor/executor_base.py", line 47, in __init__
[rank0]:     self._init_executor()
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/executor/multiproc_gpu_executor.py", line 124, in _init_executor
[rank0]:     self._run_workers("init_device")
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/executor/multiproc_gpu_executor.py", line 199, in _run_workers
[rank0]:     driver_worker_output = driver_worker_method(*args, **kwargs)
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/worker/worker.py", line 175, in init_device
[rank0]:     init_worker_distributed_environment(self.parallel_config, self.rank,
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/worker/worker.py", line 450, in init_worker_distributed_environment
[rank0]:     ensure_model_parallel_initialized(parallel_config.tensor_parallel_size,
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/parallel_state.py", line 965, in ensure_model_parallel_initialized
[rank0]:     initialize_model_parallel(tensor_model_parallel_size,
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/parallel_state.py", line 931, in initialize_model_parallel
[rank0]:     _TP = init_model_parallel_group(group_ranks,
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/parallel_state.py", line 773, in init_model_parallel_group
[rank0]:     return GroupCoordinator(
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/parallel_state.py", line 164, in __init__
[rank0]:     self.ca_comm = CustomAllreduce(
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/custom_all_reduce.py", line 130, in __init__
[rank0]:     if not _can_p2p(rank, world_size):
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/custom_all_reduce.py", line 31, in _can_p2p
[rank0]:     if not gpu_p2p_access_check(rank, i):
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/custom_all_reduce_utils.py", line 230, in gpu_p2p_access_check
[rank0]:     raise RuntimeError(
[rank0]: RuntimeError: Error happened when batch testing peer-to-peer access from (0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7) to (0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7):
[rank0]: Process SpawnProcess-2:
[rank0]: Traceback (most recent call last):
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
[rank0]:     self.run()
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/multiprocessing/process.py", line 108, in run
[rank0]:     self._target(*self._args, **self._kwargs)
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/custom_all_reduce_utils.py", line 67, in consumer
[rank0]:     lib.cudaSetDevice(j)
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/cuda_wrapper.py", line 133, in cudaSetDevice
[rank0]:     self.CUDART_CHECK(self.funcs["cudaSetDevice"](device))
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/cuda_wrapper.py", line 127, in CUDART_CHECK
[rank0]:     raise RuntimeError(f"CUDART error: {error_str}")
[rank0]: RuntimeError: CUDART error: CUDA-capable device(s) is/are busy or unavailable
[rank0]: Process SpawnProcess-1:
[rank0]: Traceback (most recent call last):
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
[rank0]:     self.run()
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/multiprocessing/process.py", line 108, in run
[rank0]:     self._target(*self._args, **self._kwargs)
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/custom_all_reduce_utils.py", line 34, in producer
[rank0]:     lib.cudaSetDevice(i)
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/cuda_wrapper.py", line 133, in cudaSetDevice
[rank0]:     self.CUDART_CHECK(self.funcs["cudaSetDevice"](device))
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/cuda_wrapper.py", line 127, in CUDART_CHECK
[rank0]:     raise RuntimeError(f"CUDART error: {error_str}")
[rank0]: RuntimeError: CUDART error: CUDA-capable device(s) is/are busy or unavailable
[rank0]: Traceback (most recent call last):
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/custom_all_reduce_utils.py", line 253, in <module>
[rank0]:     result = can_actually_p2p(batch_src, batch_tgt)
[rank0]:   File "/xxx/miniconda3/envs/math/lib/python3.10/site-packages/vllm/distributed/device_communicators/custom_all_reduce_utils.py", line 149, in can_actually_p2p
[rank0]:     assert p_src.exitcode == 0 and p_tgt.exitcode == 0
[rank0]: AssertionError

ERROR 09-07 02:34:11 multiproc_worker_utils.py:120] Worker VllmWorkerProcess pid 1254319 died, exit code: -15
INFO 09-07 02:34:11 multiproc_worker_utils.py:123] Killing local vLLM worker processes

Before submitting a new issue...

youkaichao commented 2 months ago

the root cause should be:

[rank0]: RuntimeError: CUDART error: CUDA-capable device(s) is/are busy or unavailable

please contact your admin, or try to reboot the machine.

aurianer commented 1 month ago

We encountered the same problem when several processes try to access the same GPU (like in the vllm peer to peer check) and with a nvidia configuration only allowing 1 process per GPU. @teojgo found a workaround to just skip the peer to peer check: export VLLM_SKIP_P2P_CHECK=1, another one is to enable cuda MPS

ChaosCodes commented 4 weeks ago

I have also encounted the same problem in my cluster, looking forward to the solution.