vllm - 💡(How to fix) Fix [Bug]: FLASH_ATTN_DIFFKV crashes on init with [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#41807Fetched 2026-05-07 03:32:51
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
0
Timeline (top)
commented ×2labeled ×1

Error Message

(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] EngineCore failed to start. (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] Traceback (most recent call last): (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 1110, in run_engine_core (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs) (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] return func(*args, **kwargs) (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 876, in init (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] super().init( (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 128, in init (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] kv_cache_config = self._initialize_kv_caches(vllm_config) (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] return func(*args, **kwargs) (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 250, in _initialize_kv_caches (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] available_gpu_memory = self.model_executor.determine_available_memory() (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/executor/abstract.py", line 147, in determine_available_memory (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] return self.collective_rpc("determine_available_memory") (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/executor/uniproc_executor.py", line 80, in collective_rpc (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] result = run_method(self.driver_worker, method, args, kwargs) (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/serial_utils.py", line 510, in run_method (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] return func(*args, **kwargs) (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 124, in decorate_context (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] return func(*args, **kwargs) (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 385, in determine_available_memory (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] cudagraph_memory_estimate = self.model_runner.profile_cudagraph_memory() (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 124, in decorate_context (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] return func(*args, **kwargs) (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5951, in profile_cudagraph_memory (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] self._init_minimal_kv_cache_for_profiling() (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5881, in _init_minimal_kv_cache_for_profiling (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] self.initialize_kv_cache(minimal_config, is_profiling=True) (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 6842, in initialize_kv_cache (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] kv_caches = self.initialize_kv_cache_tensors( (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 6759, in initialize_kv_cache_tensors (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] kv_caches = self._reshape_kv_cache_tensors( (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 6655, in _reshape_kv_cache_tensors (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] kv_cache = raw_tensor.view(kv_cache_shape) (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] RuntimeError: shape '[512, 16, 12, 192]' is invalid for input of size 12582912

Root Cause

Issue #39339 seems to be related, but the root cause looks to be different. I can't reproduce #39339 locally.

Fix Action

Fix / Workaround

============================== CPU Info

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): 22 On-line CPU(s) list: 0-21 Vendor ID: GenuineIntel Model name: Intel(R) Core(TM) Ultra 9 185H CPU family: 6 Model: 170 Thread(s) per core: 2 Core(s) per socket: 16 Socket(s): 1 Stepping: 4 CPU(s) scaling MHz: 33% CPU max MHz: 5100.0000 CPU min MHz: 400.0000 BogoMIPS: 6144.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 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid bus_lock_detect movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities Virtualization: VT-x L1d cache: 544 KiB (14 instances) L1i cache: 896 KiB (14 instances) L2 cache: 18 MiB (9 instances) L3 cache: 24 MiB (1 instance) NUMA node(s): 1 NUMA node0 CPU(s): 0-21 Vulnerability Gather data sampling: Not affected Vulnerability Ghostwrite: Not affected Vulnerability Indirect target selection: 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 Old microcode: 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 Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; PBRSB-eIBRS Not affected; BHI BHI_DIS_S Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Mitigation; IBPB before exit to userspace

Code Example

Collecting environment information...
uv is set
==============================
        System Info
==============================
OS                           : Ubuntu 25.10 (x86_64)
GCC version                  : (Ubuntu 14.3.0-8ubuntu1) 14.3.0
Clang version                : 20.1.8 (0ubuntu4)
CMake version                : version 3.31.6
Libc version                 : glibc-2.42

==============================
       PyTorch Info
==============================
PyTorch version              : 2.11.0+cu130
Is debug build               : False
CUDA used to build PyTorch   : 13.0
ROCM used to build PyTorch   : N/A
XPU used to build PyTorch    : N/A

==============================
      Python Environment
==============================
Python version               : 3.12.11 (main, Sep  2 2025, 14:20:58) [Clang 20.1.4 ] (64-bit runtime)
Python platform              : Linux-6.17.0-23-generic-x86_64-with-glibc2.42
    
==============================
       CUDA / GPU Info
==============================
Is CUDA available            : True
CUDA runtime version         : 12.9.86
CUDA_MODULE_LOADING set to   : 
GPU models and configuration : GPU 0: NVIDIA GeForce RTX 4060 Laptop GPU
Nvidia driver version        : 590.48.01
cuDNN version                : Could not collect
HIP runtime version          : N/A
MIOpen runtime version       : N/A
Is XNNPACK available         : True

==============================
          CPU Info
==============================
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):                                  22
On-line CPU(s) list:                     0-21
Vendor ID:                               GenuineIntel
Model name:                              Intel(R) Core(TM) Ultra 9 185H
CPU family:                              6
Model:                                   170
Thread(s) per core:                      2
Core(s) per socket:                      16
Socket(s):                               1
Stepping:                                4
CPU(s) scaling MHz:                      33%
CPU max MHz:                             5100.0000
CPU min MHz:                             400.0000
BogoMIPS:                                6144.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 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid bus_lock_detect movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities
Virtualization:                          VT-x
L1d cache:                               544 KiB (14 instances)
L1i cache:                               896 KiB (14 instances)
L2 cache:                                18 MiB (9 instances)
L3 cache:                                24 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-21
Vulnerability Gather data sampling:      Not affected
Vulnerability Ghostwrite:                Not affected
Vulnerability Indirect target selection: 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 Old microcode:             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
Vulnerability Spectre v1:                Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; Enhanced / Automatic IBRS; IBPB conditional; PBRSB-eIBRS Not affected; BHI BHI_DIS_S
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Mitigation; IBPB before exit to userspace

==============================
Versions of relevant libraries
==============================
[pip3] flashinfer-python==0.6.8.post1
[pip3] mypy-extensions==1.1.0
[pip3] numpy==2.3.5
[pip3] nvidia-cublas==13.1.0.3
[pip3] nvidia-cuda-cupti==13.0.85
[pip3] nvidia-cuda-nvrtc==13.0.88
[pip3] nvidia-cuda-runtime==13.0.96
[pip3] nvidia-cudnn-cu13==9.19.0.56
[pip3] nvidia-cudnn-frontend==1.18.0
[pip3] nvidia-cufft==12.0.0.61
[pip3] nvidia-cufile==1.15.1.6
[pip3] nvidia-curand==10.4.0.35
[pip3] nvidia-cusolver==12.0.4.66
[pip3] nvidia-cusparse==12.6.3.3
[pip3] nvidia-cusparselt-cu13==0.8.0
[pip3] nvidia-cutlass-dsl==4.5.0
[pip3] nvidia-cutlass-dsl-libs-base==4.5.0
[pip3] nvidia-ml-py==13.595.45
[pip3] nvidia-nccl-cu13==2.28.9
[pip3] nvidia-nvjitlink==13.0.88
[pip3] nvidia-nvshmem-cu13==3.4.5
[pip3] nvidia-nvtx==13.0.85
[pip3] pyzmq==27.1.0
[pip3] torch==2.11.0
[pip3] torch-c-dlpack-ext==0.1.5
[pip3] torchaudio==2.11.0
[pip3] torchvision==0.26.0
[pip3] transformers==4.57.5
[pip3] triton==3.6.0
[conda] Could not collect

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.20.0
vLLM Build Flags:
  CUDA Archs: Not Set; ROCm: Disabled; XPU: Disabled
GPU Topology:
        GPU0    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      0-21    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

==============================
     Environment Variables
==============================
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_jlj

---

import vllm

llm = vllm.LLM(
    "facebook/opt-125m",
    attention_config={"backend": "FLASH_ATTN_DIFFKV"},
)
llm.generate("test")

---

(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] EngineCore failed to start.
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] Traceback (most recent call last):
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 1110, in run_engine_core
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return func(*args, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 876, in __init__
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     super().__init__(
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 128, in __init__
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     kv_cache_config = self._initialize_kv_caches(vllm_config)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return func(*args, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 250, in _initialize_kv_caches
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     available_gpu_memory = self.model_executor.determine_available_memory()
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/executor/abstract.py", line 147, in determine_available_memory
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return self.collective_rpc("determine_available_memory")
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/executor/uniproc_executor.py", line 80, in collective_rpc
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     result = run_method(self.driver_worker, method, args, kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/serial_utils.py", line 510, in run_method
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return func(*args, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 124, in decorate_context
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return func(*args, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 385, in determine_available_memory
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     cudagraph_memory_estimate = self.model_runner.profile_cudagraph_memory()
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 124, in decorate_context
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return func(*args, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5951, in profile_cudagraph_memory
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     self._init_minimal_kv_cache_for_profiling()
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5881, in _init_minimal_kv_cache_for_profiling
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     self.initialize_kv_cache(minimal_config, is_profiling=True)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 6842, in initialize_kv_cache
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     kv_caches = self.initialize_kv_cache_tensors(
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 6759, in initialize_kv_cache_tensors
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     kv_caches = self._reshape_kv_cache_tensors(
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 6655, in _reshape_kv_cache_tensors
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     kv_cache = raw_tensor.view(kv_cache_shape)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] RuntimeError: shape '[512, 16, 12, 192]' is invalid for input of size 12582912
RAW_BUFFERClick to expand / collapse

Your current environment

<details> <summary>The output of <code>python collect_env.py</code></summary>
Collecting environment information...
uv is set
==============================
        System Info
==============================
OS                           : Ubuntu 25.10 (x86_64)
GCC version                  : (Ubuntu 14.3.0-8ubuntu1) 14.3.0
Clang version                : 20.1.8 (0ubuntu4)
CMake version                : version 3.31.6
Libc version                 : glibc-2.42

==============================
       PyTorch Info
==============================
PyTorch version              : 2.11.0+cu130
Is debug build               : False
CUDA used to build PyTorch   : 13.0
ROCM used to build PyTorch   : N/A
XPU used to build PyTorch    : N/A

==============================
      Python Environment
==============================
Python version               : 3.12.11 (main, Sep  2 2025, 14:20:58) [Clang 20.1.4 ] (64-bit runtime)
Python platform              : Linux-6.17.0-23-generic-x86_64-with-glibc2.42
    
==============================
       CUDA / GPU Info
==============================
Is CUDA available            : True
CUDA runtime version         : 12.9.86
CUDA_MODULE_LOADING set to   : 
GPU models and configuration : GPU 0: NVIDIA GeForce RTX 4060 Laptop GPU
Nvidia driver version        : 590.48.01
cuDNN version                : Could not collect
HIP runtime version          : N/A
MIOpen runtime version       : N/A
Is XNNPACK available         : True

==============================
          CPU Info
==============================
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):                                  22
On-line CPU(s) list:                     0-21
Vendor ID:                               GenuineIntel
Model name:                              Intel(R) Core(TM) Ultra 9 185H
CPU family:                              6
Model:                                   170
Thread(s) per core:                      2
Core(s) per socket:                      16
Socket(s):                               1
Stepping:                                4
CPU(s) scaling MHz:                      33%
CPU max MHz:                             5100.0000
CPU min MHz:                             400.0000
BogoMIPS:                                6144.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 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid bus_lock_detect movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities
Virtualization:                          VT-x
L1d cache:                               544 KiB (14 instances)
L1i cache:                               896 KiB (14 instances)
L2 cache:                                18 MiB (9 instances)
L3 cache:                                24 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-21
Vulnerability Gather data sampling:      Not affected
Vulnerability Ghostwrite:                Not affected
Vulnerability Indirect target selection: 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 Old microcode:             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
Vulnerability Spectre v1:                Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; Enhanced / Automatic IBRS; IBPB conditional; PBRSB-eIBRS Not affected; BHI BHI_DIS_S
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Mitigation; IBPB before exit to userspace

==============================
Versions of relevant libraries
==============================
[pip3] flashinfer-python==0.6.8.post1
[pip3] mypy-extensions==1.1.0
[pip3] numpy==2.3.5
[pip3] nvidia-cublas==13.1.0.3
[pip3] nvidia-cuda-cupti==13.0.85
[pip3] nvidia-cuda-nvrtc==13.0.88
[pip3] nvidia-cuda-runtime==13.0.96
[pip3] nvidia-cudnn-cu13==9.19.0.56
[pip3] nvidia-cudnn-frontend==1.18.0
[pip3] nvidia-cufft==12.0.0.61
[pip3] nvidia-cufile==1.15.1.6
[pip3] nvidia-curand==10.4.0.35
[pip3] nvidia-cusolver==12.0.4.66
[pip3] nvidia-cusparse==12.6.3.3
[pip3] nvidia-cusparselt-cu13==0.8.0
[pip3] nvidia-cutlass-dsl==4.5.0
[pip3] nvidia-cutlass-dsl-libs-base==4.5.0
[pip3] nvidia-ml-py==13.595.45
[pip3] nvidia-nccl-cu13==2.28.9
[pip3] nvidia-nvjitlink==13.0.88
[pip3] nvidia-nvshmem-cu13==3.4.5
[pip3] nvidia-nvtx==13.0.85
[pip3] pyzmq==27.1.0
[pip3] torch==2.11.0
[pip3] torch-c-dlpack-ext==0.1.5
[pip3] torchaudio==2.11.0
[pip3] torchvision==0.26.0
[pip3] transformers==4.57.5
[pip3] triton==3.6.0
[conda] Could not collect

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.20.0
vLLM Build Flags:
  CUDA Archs: Not Set; ROCm: Disabled; XPU: Disabled
GPU Topology:
        GPU0    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      0-21    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

==============================
     Environment Variables
==============================
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_jlj
</details>

🐛 Describe the bug

For facebook/opt-125m, it seems that the shape computed by get_kv_cache_shape is incorrect in the FLASH_ATTN_DIFFKV backend. The incorrect shape leads to a crash when trying to reshape KV cache tensors in _reshape_kv_cache_tensors.

In the case of facebook/opt-125m, the input shape is 12582912 and the computed KV cache shape is [512, 16, 12, 192]. Since $512 \times 16 \times 12 \times 192 = 18874365$, reshaping fails.

Relevant locations

https://github.com/vllm-project/vllm/blob/e43a7912847ef335337476138e5e863850a4ae0a/vllm/v1/attention/backends/flash_attn_diffkv.py#L54

https://github.com/vllm-project/vllm/blob/e43a7912847ef335337476138e5e863850a4ae0a/vllm/v1/worker/gpu_model_runner.py#L6621

Reproducer

Using vllm v0.20.0, the following python code results in RuntimeError: shape '[512, 16, 12, 192]' is invalid for input of size 12582912.

import vllm

llm = vllm.LLM(
    "facebook/opt-125m",
    attention_config={"backend": "FLASH_ATTN_DIFFKV"},
)
llm.generate("test")

Related issues

Issue #39339 seems to be related, but the root cause looks to be different. I can't reproduce #39339 locally.

Full traceback

traceback.log

Here are all the logged errors:

(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] EngineCore failed to start.
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] Traceback (most recent call last):
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 1110, in run_engine_core
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return func(*args, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 876, in __init__
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     super().__init__(
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 128, in __init__
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     kv_cache_config = self._initialize_kv_caches(vllm_config)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return func(*args, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 250, in _initialize_kv_caches
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     available_gpu_memory = self.model_executor.determine_available_memory()
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/executor/abstract.py", line 147, in determine_available_memory
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return self.collective_rpc("determine_available_memory")
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/executor/uniproc_executor.py", line 80, in collective_rpc
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     result = run_method(self.driver_worker, method, args, kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/serial_utils.py", line 510, in run_method
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return func(*args, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 124, in decorate_context
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return func(*args, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 385, in determine_available_memory
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     cudagraph_memory_estimate = self.model_runner.profile_cudagraph_memory()
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 124, in decorate_context
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     return func(*args, **kwargs)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5951, in profile_cudagraph_memory
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     self._init_minimal_kv_cache_for_profiling()
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5881, in _init_minimal_kv_cache_for_profiling
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     self.initialize_kv_cache(minimal_config, is_profiling=True)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 6842, in initialize_kv_cache
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     kv_caches = self.initialize_kv_cache_tensors(
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 6759, in initialize_kv_cache_tensors
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     kv_caches = self._reshape_kv_cache_tensors(
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]   File "/home/jlj/.cache/uv/environments-v2/repro-3694156de29c21f9/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 6655, in _reshape_kv_cache_tensors
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]     kv_cache = raw_tensor.view(kv_cache_shape)
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136]                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=9168) ERROR 05-06 11:12:28 [core.py:1136] RuntimeError: shape '[512, 16, 12, 192]' is invalid for input of size 12582912

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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

vllm - 💡(How to fix) Fix [Bug]: FLASH_ATTN_DIFFKV crashes on init with [2 comments, 2 participants]