vllm: [Bug]: CUDA device detection issue with KubeRay distributed inference for quantized models
Your current environment
The output of `python collect_env.py`
Collecting environment information...
PyTorch version: 2.3.0+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.22.1
Libc version: glibc-2.35
Python version: 3.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-118-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.8.89
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA A40
Nvidia driver version: 550.90.07
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.6
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: 43 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 20
On-line CPU(s) list: 0-19
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz
CPU family: 6
Model: 106
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 20
Stepping: 6
BogoMIPS: 5786.40
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid 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 abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xsaves arat pku ospke md_clear flush_l1d arch_capabilities
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 960 KiB (20 instances)
L1i cache: 640 KiB (20 instances)
L2 cache: 25 MiB (20 instances)
L3 cache: 480 MiB (20 instances)
NUMA node(s): 2
NUMA node0 CPU(s): 0-9
NUMA node1 CPU(s): 10-19
Vulnerability Gather data sampling: Unknown: Dependent on hypervisor status
Vulnerability Itlb multihit: KVM: Mitigation: VMX unsupported
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
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; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI SW loop, KVM SW loop
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Versions of relevant libraries:
[pip3] botorch==0.8.5
[pip3] gpytorch==1.10
[pip3] msgpack-numpy==0.4.8
[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==8.9.2.26
[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-nccl-cu12==2.20.5
[pip3] nvidia-nvjitlink-cu12==12.5.82
[pip3] nvidia-nvtx-cu12==12.1.105
[pip3] onnx==1.15.0
[pip3] onnxruntime==1.18.0
[pip3] pynvml==11.5.0
[pip3] pytorch-lightning==1.8.6
[pip3] pytorch-ranger==0.1.1
[pip3] pyzmq==26.0.3
[pip3] tf2onnx==1.15.1
[pip3] torch==2.3.0+cu121
[pip3] torch_cluster==1.6.3+pt23cu121
[pip3] torch_geometric==2.5.3
[pip3] torch-optimizer==0.3.0
[pip3] torch_scatter==2.1.2+pt23cu121
[pip3] torch_sparse==0.6.18+pt23cu121
[pip3] torch_spline_conv==1.2.2+pt23cu121
[pip3] torchmetrics==0.10.3
[pip3] torchtext==0.18.0+cpu
[pip3] torchvision==0.18.0+cu121
[pip3] transformers==4.36.2
[pip3] triton==2.3.0
[conda] botorch 0.8.5 pypi_0 pypi
[conda] gpytorch 1.10 pypi_0 pypi
[conda] msgpack-numpy 0.4.8 pypi_0 pypi
[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 8.9.2.26 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-nccl-cu12 2.20.5 pypi_0 pypi
[conda] nvidia-nvjitlink-cu12 12.5.82 pypi_0 pypi
[conda] nvidia-nvtx-cu12 12.1.105 pypi_0 pypi
[conda] pynvml 11.5.0 pypi_0 pypi
[conda] pytorch-lightning 1.8.6 pypi_0 pypi
[conda] pytorch-ranger 0.1.1 pypi_0 pypi
[conda] pyzmq 26.0.3 pypi_0 pypi
[conda] torch 2.3.0+cu121 pypi_0 pypi
[conda] torch-cluster 1.6.3+pt23cu121 pypi_0 pypi
[conda] torch-geometric 2.5.3 pypi_0 pypi
[conda] torch-optimizer 0.3.0 pypi_0 pypi
[conda] torch-scatter 2.1.2+pt23cu121 pypi_0 pypi
[conda] torch-sparse 0.6.18+pt23cu121 pypi_0 pypi
[conda] torch-spline-conv 1.2.2+pt23cu121 pypi_0 pypi
[conda] torchmetrics 0.10.3 pypi_0 pypi
[conda] torchtext 0.18.0+cpu pypi_0 pypi
[conda] torchvision 0.18.0+cu121 pypi_0 pypi
[conda] transformers 4.36.2 pypi_0 pypi
[conda] triton 2.3.0 pypi_0 pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: N/A
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0 CPU Affinity NUMA Affinity GPU NUMA ID
GPU0 X 0-19 0-1 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
Model Input Dumps
No response
š Describe the bug
I have 2 nodes with 1 GPU each in a Kubernetes environment. Each of those GPUs is too small to load the model (hugging-quants/Meta-Llama-3.1-70B-Instruct-AWQ-INT4) by itself, hence what I want is to run 2 replicas of vllm over ray to split the weights (PIPELINE_PARALLEL_SIZE config) between the two.
I was able to do that, using this guide. This is the command I used to launch quantized llama3.1:70b - python3 -m vllm.entrypoints.openai.api_server --port 8080 --served-model-name llama3.1:70b --model hugging-quants/Meta-Llama-3.1-70B-Instruct-AWQ-INT4 --max-model-len 4096 --tokenizer hugging-quants/Meta-Llama-3.1-70B-Instruct-AWQ-INT4 --dtype half -q marlin --tensor-parallel-size 1 --pipeline-parallel-size 2.
It successfully runs the model over 3 pods (ray head + 2 ray workers), where each worker has access to its own GPU (46GB)
However, Iām unable to do the same thing with Kuberay, launching a model via RayService. Whenever I try to launch a quantized model I get the following error: RuntimeError: CUDA_VISIBLE_DEVICES is set to empty string, which means GPU support is disabled.. However, Iām able to do the same thing using a non-quantized model. Together with KubeRayās maintainer we successfully launched llama3.1:8B and llama3.1:70B and were unable to launch the same models, but with marlin and gptq quantization
I have previously opened an issue in KubeRay.
Before submitting a new issueā¦
- Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 19 (8 by maintainers)
@jannikstdl
I think i finally figured out the problem. The ray function who calls
AsyncLLMEngine.from_engine_args, does not have GPUs. Andraywill silently set theCUDA_VISIBLE_DEVICESto an empty string. However, when you use quantization, the quantization method needs to access GPU to check if the GPU supports the quantization.Here is a minimal example:
The output is:
And the solution should be
del os.environ['CUDA_VISIBLE_DEVICES']in the ray actor, before callingAsyncLLMEngine.from_engine_args.We observed the same problem: With vLLM 0.5.4 we have no problem deploying quantized models (e.g., this one), however, the moment we select any version greater than 0.5.4 (tested with max. 0.6.2) we get the same problem as described above.
Using the hardcoded solution proposed here works, however we wanted something less invasive, so came up with the following solution, figured it might help someone:
So this is supposed to be inserted in / added to your vLLM deployment code. We add some logging for transparency, and try to derive the correct value of the environment variable in an automated manner using the
nvsmilibrary (which of course then also needs to be a dependency of your deployment, installed, for instance, via pip), however, you can also provide the required information in another way.@youkaichao