vllm icon indicating copy to clipboard operation
vllm copied to clipboard

[Bug]: Vllm 0.8.2 + Ray 2.44 (Ray serve deployment) fallbacks to V0 Engine

Open Qasimk555 opened this issue 9 months ago • 13 comments

Your current environment

INFO 03-26 19:23:29 [__init__.py:239] Automatically detected platform cuda.
Collecting environment information...
PyTorch version: 2.6.0+cu124
Is debug build: False
CUDA used to build PyTorch: 12.4
ROCM used to build PyTorch: N/A

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

Python version: 3.11.11 (main, Dec 11 2024, 16:28:39) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.8.0-1020-gcp-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.5.40
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA A100-SXM4-40GB
Nvidia driver version: 550.90.07
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, 48 bits virtual
Byte Order:                           Little Endian
CPU(s):                               12
On-line CPU(s) list:                  0-11
Vendor ID:                            GenuineIntel
Model name:                           Intel(R) Xeon(R) CPU @ 2.20GHz
CPU family:                           6
Model:                                85
Thread(s) per core:                   2
Core(s) per socket:                   6
Socket(s):                            1
Stepping:                             7
BogoMIPS:                             4400.39
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat avx512_vnni md_clear arch_capabilities
Hypervisor vendor:                    KVM
Virtualization type:                  full
L1d cache:                            192 KiB (6 instances)
L1i cache:                            192 KiB (6 instances)
L2 cache:                             6 MiB (6 instances)
L3 cache:                             38.5 MiB (1 instance)
NUMA node(s):                         1
NUMA node0 CPU(s):                    0-11
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:        Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Mitigation; Enhanced IBRS
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; BHI SW loop, KVM SW loop
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.4.5.8
[pip3] nvidia-cuda-cupti-cu12==12.4.127
[pip3] nvidia-cuda-nvrtc-cu12==12.4.127
[pip3] nvidia-cuda-runtime-cu12==12.4.127
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.2.1.3
[pip3] nvidia-curand-cu12==10.3.5.147
[pip3] nvidia-cusolver-cu12==11.6.1.9
[pip3] nvidia-cusparse-cu12==12.3.1.170
[pip3] nvidia-cusparselt-cu12==0.6.2
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.4.127
[pip3] nvidia-nvtx-cu12==12.4.127
[pip3] pyzmq==26.3.0
[pip3] torch==2.6.0+cu124
[pip3] torchaudio==2.6.0
[pip3] torchvision==0.21.0+cu124
[pip3] transformers==4.50.1
[pip3] triton==3.2.0
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] nvidia-cublas-cu12        12.4.5.8                 pypi_0    pypi
[conda] nvidia-cuda-cupti-cu12    12.4.127                 pypi_0    pypi
[conda] nvidia-cuda-nvrtc-cu12    12.4.127                 pypi_0    pypi
[conda] nvidia-cuda-runtime-cu12  12.4.127                 pypi_0    pypi
[conda] nvidia-cudnn-cu12         9.1.0.70                 pypi_0    pypi
[conda] nvidia-cufft-cu12         11.2.1.3                 pypi_0    pypi
[conda] nvidia-curand-cu12        10.3.5.147               pypi_0    pypi
[conda] nvidia-cusolver-cu12      11.6.1.9                 pypi_0    pypi
[conda] nvidia-cusparse-cu12      12.3.1.170               pypi_0    pypi
[conda] nvidia-cusparselt-cu12    0.6.2                    pypi_0    pypi
[conda] nvidia-nccl-cu12          2.21.5                   pypi_0    pypi
[conda] nvidia-nvjitlink-cu12     12.4.127                 pypi_0    pypi
[conda] nvidia-nvtx-cu12          12.4.127                 pypi_0    pypi
[conda] pyzmq                     26.3.0                   pypi_0    pypi
[conda] torch                     2.6.0+cu124              pypi_0    pypi
[conda] torchaudio                2.6.0                    pypi_0    pypi
[conda] torchvision               0.21.0+cu124             pypi_0    pypi
[conda] transformers              4.50.1                   pypi_0    pypi
[conda] triton                    3.2.0                    pypi_0    pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.8.2
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      0-11    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

LD_LIBRARY_PATH=/usr/local/cuda-12.5/lib64
NCCL_CUMEM_ENABLE=0
TORCHINDUCTOR_COMPILE_THREADS=1
CUDA_MODULE_LOADING=LAZY

🐛 Describe the bug

When deploying vllm 0.8.2 with ray 2.44.0 , vllm falls back to V0.

Logs from ray serve deployment:

Image

Before submitting a new issue...

  • [x] 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.

Qasimk555 avatar Mar 26 '25 19:03 Qasimk555

We are aware and are working on a fix. Ideally EOW.

robertgshaw2-redhat avatar Mar 26 '25 20:03 robertgshaw2-redhat

This should be fixed: https://github.com/vllm-project/vllm/pull/15556/files cc @comaniac

ruisearch42 avatar Mar 28 '25 15:03 ruisearch42

I'm a bit confused. The log you showed is more about Engine in background thread, which is not directly related to Ray 2.44. General speaking if you see warning like this, you can specify VLLM_USE_V1=1 to force use V1 engine. However, Ray 2.44 indeed has issues with vLLM integration so you may get illegal memory access, and the issue has been fixed by the PR pointed out by @ruisearch42

comaniac avatar Mar 28 '25 17:03 comaniac

Even after setting VLLM_USE_V1=1 , deploying vllm 0.8.2 with ray 2.44 , falls back to using V0 engine. I have not tested it with ray 2.43.

Do note, starting vllm 0.8.2 standalone (i.e. vllm serve ) doesn't have this issue. It starts up with V1 engine and works fine.

Qasimk555 avatar Mar 28 '25 17:03 Qasimk555

Even after setting VLLM_USE_V1=1 , deploying vllm 0.8.2 with ray 2.44 , falls back to using V0 engine. I have not tested it with ray 2.43.

Do note, starting vllm 0.8.2 standalone (i.e. vllm serve ) doesn't have this issue. It starts up with V1 engine and works fine.

Could you elaborate a bit more? Like how did you start vLLM with Ray? Did you start with Ray Serve LLM? Note that Ray Serve LLM hasn't supported vLLM v1 yet. This PR in Ray adds this support: https://github.com/ray-project/ray/pull/51726. Also cc @lk-chen

comaniac avatar Mar 28 '25 18:03 comaniac

Even after setting VLLM_USE_V1=1 , deploying vllm 0.8.2 with ray 2.44 , falls back to using V0 engine. I have not tested it with ray 2.43. Do note, starting vllm 0.8.2 standalone (i.e. vllm serve ) doesn't have this issue. It starts up with V1 engine and works fine.

Could you elaborate a bit more? Like how did you start vLLM with Ray? Did you start with Ray Serve LLM? Note that Ray Serve LLM hasn't supported vLLM v1 yet. This PR in Ray adds this support: ray-project/ray#51726. Also cc @lk-chen

Yes its a ray serve deployment. Below is the cmd for launching vllm with rayserve:

serve run serve:build_app model="/modelname/" max-model-len=4096 max-model-len=4096 enable-chunked-prefill=True device=cuda port=8000 host=0.0.0.0 gpu-memory-utilization=0.85 max-num-batched-tokens=1024 multi-step-stream-outputs=True num-scheduler-steps=1 tensor-parallel-size=1 pipeline-parallel-size=1 tokenizer-pool-type='ray' tokenizer-pool-size=0

serve.py builds the vllm app from args and serve an open ai like vllm endpoint similar to how vllm serve does. It not using Ray serve LLM constructs, just ray serve to build and deploy vllm instance.

Qasimk555 avatar Mar 31 '25 06:03 Qasimk555

cc @Qasimk555 did you try patch https://github.com/ray-project/ray/pull/51726 ? The PR is planned to ship in 2.45

cc @GeneDer

lk-chen avatar Mar 31 '25 16:03 lk-chen

Hi all,

does Ray 2.44.1 support VLLM V1? vLLM==0.8.1 For some reason my deployment is stuck...it loads forever even with VLLM_WORKER_MULTIPROC_METHOD="spawn"

this is my deployments.yaml that I spawn with serve deploy deployments.yaml

proxy_location: HeadOnly

http_options:
  host: 127.0.0.1
  port: 7007

grpc_options:
  port: 9000
  grpc_servicer_functions: []

applications:
- name: LLaMA 3.3 70B Translate
  route_prefix: /openai/deployments/llama/chat/completions
  import_path: vllm_serve:deployment
  runtime_env:
    env_vars:
      VLLM_USE_V1: 1
      TMPDIR: "/tmp/"
      VLLM_WORKER_MULTIPROC_METHOD: "spawn"
  args:
    default_max_tokens: 4096
    model: /models/llama-3.3-70b-instruct-awq
    dtype: half
    quantization: awq_marlin
    max_model_len: 65536
    enforce_eager: False
    tensor_parallel_size: 2
    gpu_memory_utilization: 0.8
    trust_remote_code: True
    enable_chunked_prefill: True

  deployments:
  - name: vLLMGenericAPI
    num_replicas: 1
    max_ongoing_requests: 1
    ray_actor_options:
            num_gpus: 2
            num_cpus: 4


- name: Gemma 3 27B
  route_prefix: /openai/deployments/gemma/chat/completions
  import_path: vllm_serve:deployment
  runtime_env:
    env_vars:
      VLLM_USE_V1: 1
      TMPDIR: "/tmp/"
      VLLM_WORKER_MULTIPROC_METHOD: "spawn"
  args:
    default_max_tokens: 8192
    model: /models/gemma-3-27b-it-FP8-Dynamic
    dtype: bfloat16
    quantization: compressed-tensors
    max_model_len: 93760
    enforce_eager: False
    tensor_parallel_size: 2
    gpu_memory_utilization: 0.8
    trust_remote_code: True
    enable_chunked_prefill: True    
    enable_prefix_caching: True
  deployments:
  - name: vLLMGenericAPI
    num_replicas: 1
    max_ongoing_requests: 5
    ray_actor_options:
            num_gpus: 2
            num_cpus: 4

paolovic avatar Apr 24 '25 05:04 paolovic

@paolovic could you try vllm==0.8.4? 0.8.1 is known to have some bugs, and 0.8.4 fixed some security issue

lk-chen avatar Apr 24 '25 06:04 lk-chen

@paolovic could you try vllm==0.8.4? 0.8.1 is known to have some bugs, and 0.8.4 fixed some security issue

yes, unfortunately, it doesn't help

paolovic avatar Apr 24 '25 13:04 paolovic

Hi @paolovic , can you post the logs to show which step you got stuck? Please also show the ray version you used.

ruisearch42 avatar Apr 24 '25 16:04 ruisearch42

Hi @paolovic , can you post the logs to show which step you got stuck? Please also show the ray version you used.

true. I will update my post, but of course, I tested with ray==2.43.0

paolovic avatar Apr 25 '25 07:04 paolovic

So, actually, it was weird cascade of dependency mismatches, hidden by pip==25.1, with pip==24.0 we were able to track the root cause down. In the end, it had nothing to do with ray or vllm

paolovic avatar Apr 29 '25 14:04 paolovic

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[bot] avatar Jul 31 '25 02:07 github-actions[bot]

This issue has been automatically closed due to inactivity. Please feel free to reopen if you feel it is still relevant. Thank you!

github-actions[bot] avatar Aug 31 '25 02:08 github-actions[bot]