Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: vllm 0.4.1 crashing after checking P2P status on single GPU #4587

Open
alexandergagliano opened this issue May 3, 2024 · 13 comments
Open
Labels
bug Something isn't working stale

Comments

@alexandergagliano
Copy link

alexandergagliano commented May 3, 2024

Your current environment

Collecting environment information...
PyTorch version: 2.2.1+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.4 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.29.2
Libc version: glibc-2.35

Python version: 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-105-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.3.52
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: GRID A100X-40C
Nvidia driver version: 535.129.03
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:                      40 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             32
On-line CPU(s) list:                0-31
Vendor ID:                          AuthenticAMD
Model name:                         AMD EPYC-Milan Processor
CPU family:                         25
Model:                              1
Thread(s) per core:                 1
Core(s) per socket:                 1
Socket(s):                          32
Stepping:                           1
BogoMIPS:                           3992.50
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core invpcid_single ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr wbnoinvd arat npt lbrv nrip_save tsc_scale vmcb_clean pausefilter pfthreshold umip pku ospke vaes vpclmulqdq rdpid arch_capabilities
Virtualization:                     AMD-V
Hypervisor vendor:                  KVM
Virtualization type:                full
L1d cache:                          1 MiB (32 instances)
L1i cache:                          1 MiB (32 instances)
L2 cache:                           16 MiB (32 instances)
L3 cache:                           1 GiB (32 instances)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0-31
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: Mitigation; safe RET
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.26.4
[pip3] nvidia-nccl-cu12==2.19.3
[pip3] torch==2.2.1
[pip3] torchaudio==2.2.1
[pip3] torchvision==0.17.1
[pip3] triton==2.2.0
[pip3] vllm-nccl-cu12==2.18.1.0.4.0
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] nvidia-nccl-cu12          2.19.3                   pypi_0    pypi
[conda] torch                     2.2.1                    pypi_0    pypi
[conda] torchaudio                2.2.1                    pypi_0    pypi
[conda] torchvision               0.17.1                   pypi_0    pypi
[conda] triton                    2.2.0                    pypi_0    pypi
[conda] vllm-nccl-cu12            2.18.1.0.4.0             pypi_0    pypiROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.4.1
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
^[[4mGPU0       CPU Affinity    NUMA Affinity   GPU NUMA ID^[[0m
GPU0     X      0-31    0               N/A

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

🐛 Describe the bug

Thanks for the great code!

I'm getting a strange nccl issue in the latest version of vllm (0.4.1). I had no problems with earlier releases (just confirmed that v0.3.0 runs without issue. From what I can tell of the error message, the code is attempting a peer-to-peer connection, but I'm only running on a single GPU. Running the minimal example above, I get:

(speakYSE) ubuntu@speakyse:/mnt/vol_llm$ python test.py
/mnt/vol_llm/packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
INFO 05-03 16:50:14 llm_engine.py:98] Initializing an LLM engine (v0.4.1) with config: model='facebook/opt-125m', speculative_config=None, tokenizer='facebook/opt-125m', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.float16, max_seq_len=2048, download_dir=None, load_format=auto, tensor_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'), seed=0)


INFO 05-03 16:50:15 utils.py:608] Found nccl from library /home/ubuntu/.config/vllm/nccl/cu12/libnccl.so.2.18.1
INFO 05-03 16:50:15 selector.py:28] Using FlashAttention backend.
speakyse:3688:3688 [0] NCCL INFO Bootstrap : Using enp1s0:10.1.1.23<0>
speakyse:3688:3688 [0] NCCL INFO NET/Plugin : dlerror=libnccl-net.so: cannot open shared object file: No such file or directory No plugin found (libnccl-net.so), using internal implementation
speakyse:3688:3688 [0] NCCL INFO cudaDriverVersion 12020
NCCL version 2.19.3+cuda12.3
speakyse:3688:3861 [0] NCCL INFO NET/IB : No device found.
speakyse:3688:3861 [0] NCCL INFO NET/Socket : Using [0]enp1s0:10.1.1.23<0> [1]br-febe132fd1d0:172.18.0.1<0>
speakyse:3688:3861 [0] NCCL INFO Using non-device net plugin version 0
speakyse:3688:3861 [0] NCCL INFO Using network Socket

speakyse:3688:3861 [0] misc/nvmlwrap.cc:143 NCCL WARN nvmlDeviceGetP2PStatus(0,0,NVML_P2P_CAPS_INDEX_READ) failed: Invalid Argument
speakyse:3688:3861 [0] NCCL INFO misc/nvmlwrap.cc:181 -> 2
speakyse:3688:3861 [0] NCCL INFO init.cc:351 -> 2
speakyse:3688:3861 [0] NCCL INFO init.cc:1387 -> 2
speakyse:3688:3861 [0] NCCL INFO group.cc:64 -> 2 [Async thread]
speakyse:3688:3688 [0] NCCL INFO group.cc:418 -> 2
speakyse:3688:3688 [0] NCCL INFO group.cc:95 -> 2
Traceback (most recent call last):
  File "/mnt/vol_llm/test.py", line 11, in <module>
    llm = LLM(model="facebook/opt-125m")
  File "/mnt/vol_llm/packages/vllm/entrypoints/llm.py", line 118, in __init__
    self.llm_engine = LLMEngine.from_engine_args(
  File "/mnt/vol_llm/packages/vllm/engine/llm_engine.py", line 277, in from_engine_args
    engine = cls(
  File "/mnt/vol_llm/packages/vllm/engine/llm_engine.py", line 148, in __init__
    self.model_executor = executor_class(
  File "/mnt/vol_llm/packages/vllm/executor/executor_base.py", line 41, in __init__
    self._init_executor()
  File "/mnt/vol_llm/packages/vllm/executor/gpu_executor.py", line 22, in _init_executor
    self._init_non_spec_worker()
  File "/mnt/vol_llm/packages/vllm/executor/gpu_executor.py", line 50, in _init_non_spec_worker
    self.driver_worker.init_device()
  File "/mnt/vol_llm/packages/vllm/worker/worker.py", line 110, in init_device
    init_worker_distributed_environment(self.parallel_config, self.rank,
  File "/mnt/vol_llm/packages/vllm/worker/worker.py", line 313, in init_worker_distributed_environment
    torch.distributed.all_reduce(torch.zeros(1).cuda())
  File "/mnt/vol_llm/packages/torch/distributed/c10d_logger.py", line 72, in wrapper
    return func(*args, **kwargs)
  File "/mnt/vol_llm/packages/torch/distributed/distributed_c10d.py", line 1992, in all_reduce
    work = group.allreduce([tensor], opts)
torch.distributed.DistBackendError: NCCL error in: ../torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:1691, unhandled system error (run with NCCL_DEBUG=INFO for details), NCCL version 2.19.3
ncclSystemError: System call (e.g. socket, malloc) or external library call failed or device error. 
Last error:
nvmlDeviceGetP2PStatus(0,0,NVML_P2P_CAPS_INDEX_READ) failed: Invalid Argument

Any ideas? Thanks!

@alexandergagliano alexandergagliano added the bug Something isn't working label May 3, 2024
@alexandergagliano
Copy link
Author

I'm trying to set up llama3, so I'm hoping not to have to downgrade vllm versions if possible.

@alexandergagliano alexandergagliano changed the title [Bug]: [Bug]: vllm 0.4.1 crashing after checking P2P status on single GPU May 3, 2024
@khoj-pez
Copy link

khoj-pez commented Jun 1, 2024

Any luck? I have the same issue on a single GPU machine.

@youkaichao
Copy link
Member

Do you try newer versions? I believe this code is introduced in #4159 , and we have some update to that part of code later.

@youkaichao
Copy link
Member

My educated guess is that this is some hardware problem. I see the gpu model is GPU 0: GRID A100X-40C, which I never saw before.

@agt
Copy link
Contributor

agt commented Jun 1, 2024

Any luck? I have the same issue on a single GPU machine.

@khoj-pez Which GPU model are you using?

Also, does the error remain if you set environment variable NCCL_P2P_DISABLE=1 ?

@youkaichao
Copy link
Member

After further investigation, i think this is a nccl issue:

misc/nvmlwrap.cc:143 NCCL WARN nvmlDeviceGetP2PStatus(0,0,NVML_P2P_CAPS_INDEX_READ) failed: Invalid Argument

nccl calls nvmlDeviceGetP2PStatus and it does not work in vGPU mode (which leads to this GPU 0: GRID A100X-40C) . It seems nccl forgets to clear the error state, so this failed call affects the later nccl operations.

I suggest you report this to the nccl team at https://github.com/NVIDIA/nccl .

@youkaichao
Copy link
Member

I talked with NCCL team, and they confirm they don't support vGPU. I created an issue to track this problem

@kerthcet
Copy link
Contributor

kerthcet commented Jun 7, 2024

I guess this problem is solved by #4591, can you confirm? @youkaichao

@youkaichao
Copy link
Member

I don't have vGPU to test. It would be great if @alexandergagliano can test the latest code and see if this issue is resolved.

@okalldal
Copy link

I can confirm that the error is still present on a vGPU in 0.4.3, but it is now triggered by the warmup at this line:

torch.distributed.all_reduce(data)

Commenting out that one line seems to make at least the openai compatible server work for me though!

@kerthcet
Copy link
Contributor

/assign
Let me try to take a fix on this.

@youkaichao
Copy link
Member

Commenting out that one line seems to make at least the openai compatible server work for me though!

glad to hear it works. do you know how to use vGPU in k8s so that our ci can test this case?

Copy link

This issue has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this issue should remain open. Thank you!

@github-actions github-actions bot added the stale label Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

6 participants