Skip to content

[Bug]: V1 Engine crashes when sending requests with same request id #15041

New issue

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

By clicking “No 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? No Sign in to your account

Closed
1 task done
JasonJ2021 opened this issue Mar 18, 2025 · 0 comments · Fixed by #15043
Closed
1 task done

[Bug]: V1 Engine crashes when sending requests with same request id #15041

JasonJ2021 opened this issue Mar 18, 2025 · 0 comments · Fixed by #15043
Labels
bug Something isn't working

Comments

@JasonJ2021
Copy link
Contributor

Your current environment

The output of `python collect_env.py`
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.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.31.6
Libc version: glibc-2.35

Python version: 3.12.0 | packaged by Anaconda, Inc. | (main, Oct  2 2023, 17:29:18) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-133-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.3.107
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4090
Nvidia driver version: 550.54.14
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):                               128
On-line CPU(s) list:                  0-127
Vendor ID:                            GenuineIntel
Model name:                           Intel(R) Xeon(R) Gold 6430
CPU family:                           6
Model:                                143
Thread(s) per core:                   2
Core(s) per socket:                   32
Socket(s):                            2
Stepping:                             8
CPU max MHz:                          3400.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 vmx 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 invpcid_single cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad 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 hwp hwp_act_window hwp_epp hwp_pkg_req 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 amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities
Virtualization:                       VT-x
L1d cache:                            3 MiB (64 instances)
L1i cache:                            2 MiB (64 instances)
L2 cache:                             128 MiB (64 instances)
L3 cache:                             120 MiB (2 instances)
NUMA node(s):                         2
NUMA node0 CPU(s):                    0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126
NUMA node1 CPU(s):                    1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127
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 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 BHI_DIS_S
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-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-ml-py==12.570.86
[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] sentence-transformers==3.2.1
[pip3] torch==2.6.0
[pip3] torchaudio==2.6.0
[pip3] torchvision==0.21.0
[pip3] transformers==4.48.2
[pip3] transformers-stream-generator==0.0.5
[pip3] triton==3.2.0
[pip3] tritonclient==2.51.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-ml-py              12.570.86                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] sentence-transformers     3.2.1                    pypi_0    pypi
[conda] torch                     2.6.0                    pypi_0    pypi
[conda] torchaudio                2.6.0                    pypi_0    pypi
[conda] torchvision               0.21.0                   pypi_0    pypi
[conda] transformers              4.48.2                   pypi_0    pypi
[conda] transformers-stream-generator 0.0.5                    pypi_0    pypi
[conda] triton                    3.2.0                    pypi_0    pypi
[conda] tritonclient              2.51.0                   pypi_0    pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.1.dev5239+g3b45714.d20250318 (git sha: 3b45714.d20250318
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0	NIC0	NIC1	CPU Affinity	NUMA Affinity	GPU NUMA ID
GPU0	 X 	SYS	SYS	0,2,4,6,8,10	0		N/A
NIC0	SYS	 X 	PIX
NIC1	SYS	PIX	 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

CUDA_HOME=/usr/local/cuda
CUDA_HOME=/usr/local/cuda
LD_LIBRARY_PATH=/usr/local/cuda/lib64:
VLLM_USE_MODELSCOPE=true
VLLM_USE_V1=1
VLLM_WORKER_MULTIPROC_METHOD=spawn
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_sunjh
NCCL_CUMEM_ENABLE=0
TORCHINDUCTOR_COMPILE_THREADS=1
CUDA_MODULE_LOADING=LAZY

🐛 Describe the bug

Caller to the OpenAI Server can set request_id arbitarily. If sending requests with duplicate request_id to OpenAI Server, the V1 Engine will crash immediately.

Below is an example how to trigger this bug.

from openai import OpenAI
openai_api_key = "EMPTY"
openai_base_url = "http://localhost:8800/v1"

if __name__ == "__main__":
    client = OpenAI(api_key=openai_api_key, base_url=openai_base_url)

    prompt = "Write a one-sentence bedtime story about a unicorn."
    request_id = "test"

    model = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"

    completion = client.completions.create(
        model=model,
        prompt=prompt,
        max_tokens=10,
        extra_headers={
            "X-Request-Id": request_id
        },
    )

    completion = client.completions.create(
        model=model,
        prompt=prompt,
        max_tokens=10,
        extra_headers={
            "X-Request-Id": request_id
        },
    )

vllm reports the following error.

INFO:     Started server process [2095823]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO 03-18 14:46:40 [logger.py:39] Received request cmpl-test-0: prompt: 'Write a one-sentence bedtime story about a unicorn.', params: SamplingParams(n=1, presence_penalty=0.0, frequency_penalty=0.0, repetition_penalty=1.0, temperature=0.6, top_p=0.95, top_k=-1, min_p=0.0, seed=None, stop=[], stop_token_ids=[], bad_words=[], include_stop_str_in_output=False, ignore_eos=False, max_tokens=10, min_tokens=0, logprobs=None, prompt_logprobs=None, skip_special_tokens=True, spaces_between_special_tokens=True, truncate_prompt_tokens=None, guided_decoding=None, extra_args=None), prompt_token_ids: [151646, 7985, 264, 825, 1331, 18380, 88507, 3364, 911, 264, 81830, 13], lora_request: None, prompt_adapter_request: None.
INFO 03-18 14:46:40 [async_llm.py:204] Added request cmpl-test-0.
INFO:     127.0.0.1:56084 - "POST /v1/completions HTTP/1.1" 200 OK
INFO 03-18 14:46:40 [logger.py:39] Received request cmpl-test-0: prompt: 'Write a one-sentence bedtime story about a unicorn.', params: SamplingParams(n=1, presence_penalty=0.0, frequency_penalty=0.0, repetition_penalty=1.0, temperature=0.6, top_p=0.95, top_k=-1, min_p=0.0, seed=None, stop=[], stop_token_ids=[], bad_words=[], include_stop_str_in_output=False, ignore_eos=False, max_tokens=10, min_tokens=0, logprobs=None, prompt_logprobs=None, skip_special_tokens=True, spaces_between_special_tokens=True, truncate_prompt_tokens=None, guided_decoding=None, extra_args=None), prompt_token_ids: [151646, 7985, 264, 825, 1331, 18380, 88507, 3364, 911, 264, 81830, 13], lora_request: None, prompt_adapter_request: None.
INFO 03-18 14:46:40 [async_llm.py:204] Added request cmpl-test-0.
ERROR 03-18 14:46:40 [core.py:341] EngineCore hit an exception: Traceback (most recent call last):
ERROR 03-18 14:46:40 [core.py:341]   File "/home/sunjh/vllm/vllm/v1/engine/core.py", line 334, in run_engine_core
ERROR 03-18 14:46:40 [core.py:341]     engine_core.run_busy_loop()
ERROR 03-18 14:46:40 [core.py:341]   File "/home/sunjh/vllm/vllm/v1/engine/core.py", line 368, in run_busy_loop
ERROR 03-18 14:46:40 [core.py:341]     outputs = step_fn()
ERROR 03-18 14:46:40 [core.py:341]               ^^^^^^^^^
ERROR 03-18 14:46:40 [core.py:341]   File "/home/sunjh/vllm/vllm/v1/engine/core.py", line 193, in step
ERROR 03-18 14:46:40 [core.py:341]     output = self.model_executor.execute_model(scheduler_output)
ERROR 03-18 14:46:40 [core.py:341]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 03-18 14:46:40 [core.py:341]   File "/home/sunjh/vllm/vllm/v1/executor/abstract.py", line 80, in execute_model
ERROR 03-18 14:46:40 [core.py:341]     output = self.collective_rpc("execute_model",
ERROR 03-18 14:46:40 [core.py:341]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 03-18 14:46:40 [core.py:341]   File "/home/sunjh/vllm/vllm/executor/uniproc_executor.py", line 56, in collective_rpc
ERROR 03-18 14:46:40 [core.py:341]     answer = run_method(self.driver_worker, method, args, kwargs)
ERROR 03-18 14:46:40 [core.py:341]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 03-18 14:46:40 [core.py:341]   File "/home/sunjh/vllm/vllm/utils.py", line 2216, in run_method
ERROR 03-18 14:46:40 [core.py:341]     return func(*args, **kwargs)
ERROR 03-18 14:46:40 [core.py:341]            ^^^^^^^^^^^^^^^^^^^^^
ERROR 03-18 14:46:40 [core.py:341]   File "/home/sunjh/miniconda3/envs/vllm-dev/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
ERROR 03-18 14:46:40 [core.py:341]     return func(*args, **kwargs)
ERROR 03-18 14:46:40 [core.py:341]            ^^^^^^^^^^^^^^^^^^^^^
ERROR 03-18 14:46:40 [core.py:341]   File "/home/sunjh/vllm/vllm/v1/worker/gpu_worker.py", line 242, in execute_model
ERROR 03-18 14:46:40 [core.py:341]     output = self.model_runner.execute_model(scheduler_output)
ERROR 03-18 14:46:40 [core.py:341]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 03-18 14:46:40 [core.py:341]   File "/home/sunjh/miniconda3/envs/vllm-dev/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
ERROR 03-18 14:46:40 [core.py:341]     return func(*args, **kwargs)
ERROR 03-18 14:46:40 [core.py:341]            ^^^^^^^^^^^^^^^^^^^^^
ERROR 03-18 14:46:40 [core.py:341]   File "/home/sunjh/vllm/vllm/v1/worker/gpu_model_runner.py", line 934, in execute_model
ERROR 03-18 14:46:40 [core.py:341]     attn_metadata, logits_indices = self._prepare_inputs(scheduler_output)
ERROR 03-18 14:46:40 [core.py:341]                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 03-18 14:46:40 [core.py:341]   File "/home/sunjh/vllm/vllm/v1/worker/gpu_model_runner.py", line 479, in _prepare_inputs
ERROR 03-18 14:46:40 [core.py:341]     num_scheduled_tokens[i] = num_tokens
ERROR 03-18 14:46:40 [core.py:341]     ~~~~~~~~~~~~~~~~~~~~^^^
ERROR 03-18 14:46:40 [core.py:341] IndexError: index 1 is out of bounds for axis 0 with size 1
ERROR 03-18 14:46:40 [core.py:341]
CRITICAL 03-18 14:46:40 [core_client.py:269] Got fatal signal from worker processes, shutting down. See stack trace above for root cause issue.
[1]    2095823 killed     vllm serve deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B --port 8800

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.
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant