Skip to content

[Bug]: v0.25.1 int4_per_token_head crashes with SWA models #48721

Description

@VikramRangarajan

Your current environment

The output of python collect_env.py
Collecting environment information...
uv is set
==============================
        System Info
==============================
OS                           : Rocky Linux 9.6 (Blue Onyx) (x86_64)
GCC version                  : (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5)
Clang version                : Could not collect
CMake version                : version 3.26.5
Libc version                 : glibc-2.34

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

==============================
      Python Environment
==============================
Python version               : 3.13.12 (main, Mar  3 2026, 15:01:51) [Clang 21.1.4 ] (64-bit runtime)
Python platform              : Linux-5.14.0-570.26.1.el9_6.x86_64-x86_64-with-glibc2.34
    
==============================
       CUDA / GPU Info
==============================
Is CUDA available            : True
CUDA runtime version         : 12.6.20
CUDA_MODULE_LOADING set to   : 
GPU models and configuration : GPU 0: NVIDIA A40
Nvidia driver version        : 575.57.08
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):                               24
On-line CPU(s) list:                  0-23
Vendor ID:                            GenuineIntel
Model name:                           Intel(R) Xeon(R) Gold 6126 CPU @ 2.60GHz
CPU family:                           6
Model:                                85
Thread(s) per core:                   1
Core(s) per socket:                   12
Socket(s):                            2
Stepping:                             4
CPU(s) scaling MHz:                   82%
CPU max MHz:                          3700.0000
CPU min MHz:                          1000.0000
BogoMIPS:                             5200.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 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 cdp_l3 pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts vnmi pku ospke md_clear flush_l1d arch_capabilities
Virtualization:                       VT-x
L1d cache:                            768 KiB (24 instances)
L1i cache:                            768 KiB (24 instances)
L2 cache:                             24 MiB (24 instances)
L3 cache:                             38.5 MiB (2 instances)
NUMA node(s):                         4
NUMA node0 CPU(s):                    0,4,8,12,16,20
NUMA node1 CPU(s):                    1,5,9,13,17,21
NUMA node2 CPU(s):                    2,6,10,14,18,22
NUMA node3 CPU(s):                    3,7,11,15,19,23
Vulnerability Gather data sampling:   Mitigation; Microcode
Vulnerability Itlb multihit:          KVM: Mitigation: Split huge pages
Vulnerability L1tf:                   Mitigation; PTE Inversion; VMX conditional cache flushes, SMT disabled
Vulnerability Mds:                    Mitigation; Clear CPU buffers; SMT disabled
Vulnerability Meltdown:               Mitigation; PTI
Vulnerability Mmio stale data:        Mitigation; Clear CPU buffers; SMT disabled
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Mitigation; 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; IBRS; IBPB conditional; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Mitigation; Clear CPU buffers; SMT disabled

==============================
Versions of relevant libraries
==============================
[pip3] flashinfer-python==0.6.13
[pip3] numpy==2.4.6
[pip3] nvidia-cublas-cu12==12.9.1.4
[pip3] nvidia-cuda-cccl-cu12==12.9.27
[pip3] nvidia-cuda-crt==13.3.73
[pip3] nvidia-cuda-cupti-cu12==12.9.79
[pip3] nvidia-cuda-nvcc==13.2.78
[pip3] nvidia-cuda-nvcc-cu12==12.9.86
[pip3] nvidia-cuda-nvrtc-cu12==12.9.86
[pip3] nvidia-cuda-runtime==13.3.29
[pip3] nvidia-cuda-runtime-cu12==12.9.79
[pip3] nvidia-cuda-tileiras==13.2.78
[pip3] nvidia-cudnn-cu12==9.17.1.4
[pip3] nvidia-cudnn-frontend==1.26.0
[pip3] nvidia-cufft-cu12==11.4.1.4
[pip3] nvidia-cufile-cu12==1.14.1.1
[pip3] nvidia-curand-cu12==10.3.10.19
[pip3] nvidia-cusolver-cu12==11.7.5.82
[pip3] nvidia-cusparse-cu12==12.5.10.65
[pip3] nvidia-cusparselt-cu12==0.7.1
[pip3] nvidia-cutlass-dsl==4.5.2
[pip3] nvidia-cutlass-dsl-libs-base==4.5.2
[pip3] nvidia-ml-py==13.610.43
[pip3] nvidia-nccl-cu12==2.28.9
[pip3] nvidia-nvjitlink-cu12==12.9.86
[pip3] nvidia-nvshmem-cu12==3.4.5
[pip3] nvidia-nvtx-cu12==12.9.79
[pip3] nvidia-nvvm==13.2.78
[pip3] pyzmq==27.1.0
[pip3] tokenspeed-triton==3.8.10.post20260709
[pip3] torch==2.11.0+cu129
[pip3] torch-c-dlpack-ext==0.1.5
[pip3] torchaudio==2.11.0+cu129
[pip3] torchcodec==0.14.0+cpu
[pip3] torchvision==0.26.0+cu129
[pip3] transformers==5.13.1
[pip3] triton==3.6.0
[conda] Could not collect

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.25.1
vLLM Build Flags:
  CUDA Archs: Not Set; ROCm: Disabled; XPU: Disabled
GPU Topology:
  	�[4mGPU0	NIC0	CPU Affinity	NUMA Affinity	GPU NUMA ID�[0m
GPU0	 X 	SYS	0,4,8,12,16	0		N/A
NIC0	SYS	 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

==============================
     Environment Variables
==============================
CUDA=/apps/rocky9/cuda/12.6
I_MPI_HYDRA_BOOTSTRAP_EXEC_EXTRA_ARGS=--external-launcher
TORCHINDUCTOR_CACHE_DIR=torchinductor
CUDA_INCLUDE_PATH=/apps/rocky9/cuda/12.6/include
ZE_AFFINITY_MASK=0
CUDA_VISIBLE_DEVICES=0
CUDA_VISIBLE_DEVICES=0
CUDA_ROOT=/apps/rocky9/cuda/12.6
LD_LIBRARY_PATH=/apps/rocky9/cuda/12.6/extras/CUPTI/lib64:/apps/rocky9/cuda/12.6/lib64:/apps/rocky9/cuda/12.6/lib:/usr/lib64/nvidia:/apps/openmpi/5.0.5-gcc-11.4.1-svmliy7/lib
CUDA_HOME=/apps/rocky9/cuda/12.6
CUDA_HOME=/apps/rocky9/cuda/12.6
I_MPI_HYDRA_BOOTSTRAP=slurm
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1

🐛 Describe the bug

vllm serve google/gemma-4-12B-it --kv-cache-dtype int4_per_token_head

This crashes with a reshape bug:

Output of above command
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231] EngineCore failed to start.
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231] Traceback (most recent call last):
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core.py", line 1200, in run_engine_core
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs)
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     return func(*args, **kwargs)
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core.py", line 966, in __init__
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     super().__init__(
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     ~~~~~~~~~~~~~~~~^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         vllm_config,
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         ^^^^^^^^^^^^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     ...<3 lines>...
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         internal_dp_balancing,
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         ^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     )
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     ^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core.py", line 133, in __init__
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     kv_cache_config = self._initialize_kv_caches(vllm_config)
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     return func(*args, **kwargs)
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core.py", line 321, in _initialize_kv_caches
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     self.model_executor.initialize_from_config(kv_cache_configs)
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/executor/abstract.py", line 123, in initialize_from_config
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     self.collective_rpc("initialize_from_config", args=(kv_cache_configs,))
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/executor/uniproc_executor.py", line 92, in collective_rpc
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     result = run_method(self.driver_worker, method, args, kwargs)
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/serial_utils.py", line 510, in run_method
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     return func(*args, **kwargs)
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/worker_base.py", line 325, in initialize_from_config
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     self.worker.initialize_from_config(kv_cache_config)  # type: ignore
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     return func(*args, **kwargs)
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/gpu_worker.py", line 710, in initialize_from_config
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     self.model_runner.initialize_kv_cache(kv_cache_config)
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/gpu/model_runner.py", line 480, in initialize_kv_cache
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     kv_caches_dict = init_kv_cache(
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         self.kv_caches,
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     ...<6 lines>...
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         self.vllm_config,
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     )
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/gpu/attn_utils.py", line 535, in init_kv_cache
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     kv_caches = _reshape_kv_cache(
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         attn_groups=flattened_attn_groups,
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     ...<4 lines>...
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         kv_cache_config=kv_cache_config,
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     )
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/gpu/attn_utils.py", line 333, in _reshape_kv_cache
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     kv_caches[layer_name] = _reshape_attention_kv_cache(
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         kv_raw_tensor,
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         ^^^^^^^^^^^^^^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     ...<4 lines>...
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         packing,
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]         ^^^^^^^^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     )
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     ^
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/gpu/attn_utils.py", line 251, in _reshape_attention_kv_cache
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231]     kv_cache = kv_raw_tensor.view(dtype).view(permuted_kv_cache_shape)
(EngineCore pid=2315771) ERROR 07-15 05:14:48 [core.py:1231] RuntimeError: shape '[35397, 2, 16, 8, 132]' is invalid for input of size 2356024320
(EngineCore pid=2315771) Process EngineCore:
(EngineCore pid=2315771) Traceback (most recent call last):
(EngineCore pid=2315771)   File "/home/rangarav/.local/share/uv/python/cpython-3.13.12-linux-x86_64-gnu/lib/python3.13/multiprocessing/process.py", line 313, in _bootstrap
(EngineCore pid=2315771)     self.run()
(EngineCore pid=2315771)     ~~~~~~~~^^
(EngineCore pid=2315771)   File "/home/rangarav/.local/share/uv/python/cpython-3.13.12-linux-x86_64-gnu/lib/python3.13/multiprocessing/process.py", line 108, in run
(EngineCore pid=2315771)     self._target(*self._args, **self._kwargs)
(EngineCore pid=2315771)     ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core.py", line 1235, in run_engine_core
(EngineCore pid=2315771)     raise e
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core.py", line 1200, in run_engine_core
(EngineCore pid=2315771)     engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs)
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(EngineCore pid=2315771)     return func(*args, **kwargs)
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core.py", line 966, in __init__
(EngineCore pid=2315771)     super().__init__(
(EngineCore pid=2315771)     ~~~~~~~~~~~~~~~~^
(EngineCore pid=2315771)         vllm_config,
(EngineCore pid=2315771)         ^^^^^^^^^^^^
(EngineCore pid=2315771)     ...<3 lines>...
(EngineCore pid=2315771)         internal_dp_balancing,
(EngineCore pid=2315771)         ^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=2315771)     )
(EngineCore pid=2315771)     ^
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core.py", line 133, in __init__
(EngineCore pid=2315771)     kv_cache_config = self._initialize_kv_caches(vllm_config)
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(EngineCore pid=2315771)     return func(*args, **kwargs)
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core.py", line 321, in _initialize_kv_caches
(EngineCore pid=2315771)     self.model_executor.initialize_from_config(kv_cache_configs)
(EngineCore pid=2315771)     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/executor/abstract.py", line 123, in initialize_from_config
(EngineCore pid=2315771)     self.collective_rpc("initialize_from_config", args=(kv_cache_configs,))
(EngineCore pid=2315771)     ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/executor/uniproc_executor.py", line 92, in collective_rpc
(EngineCore pid=2315771)     result = run_method(self.driver_worker, method, args, kwargs)
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/serial_utils.py", line 510, in run_method
(EngineCore pid=2315771)     return func(*args, **kwargs)
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/worker_base.py", line 325, in initialize_from_config
(EngineCore pid=2315771)     self.worker.initialize_from_config(kv_cache_config)  # type: ignore
(EngineCore pid=2315771)     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(EngineCore pid=2315771)     return func(*args, **kwargs)
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/gpu_worker.py", line 710, in initialize_from_config
(EngineCore pid=2315771)     self.model_runner.initialize_kv_cache(kv_cache_config)
(EngineCore pid=2315771)     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/gpu/model_runner.py", line 480, in initialize_kv_cache
(EngineCore pid=2315771)     kv_caches_dict = init_kv_cache(
(EngineCore pid=2315771)         self.kv_caches,
(EngineCore pid=2315771)     ...<6 lines>...
(EngineCore pid=2315771)         self.vllm_config,
(EngineCore pid=2315771)     )
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/gpu/attn_utils.py", line 535, in init_kv_cache
(EngineCore pid=2315771)     kv_caches = _reshape_kv_cache(
(EngineCore pid=2315771)         attn_groups=flattened_attn_groups,
(EngineCore pid=2315771)     ...<4 lines>...
(EngineCore pid=2315771)         kv_cache_config=kv_cache_config,
(EngineCore pid=2315771)     )
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/gpu/attn_utils.py", line 333, in _reshape_kv_cache
(EngineCore pid=2315771)     kv_caches[layer_name] = _reshape_attention_kv_cache(
(EngineCore pid=2315771)                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
(EngineCore pid=2315771)         kv_raw_tensor,
(EngineCore pid=2315771)         ^^^^^^^^^^^^^^
(EngineCore pid=2315771)     ...<4 lines>...
(EngineCore pid=2315771)         packing,
(EngineCore pid=2315771)         ^^^^^^^^
(EngineCore pid=2315771)     )
(EngineCore pid=2315771)     ^
(EngineCore pid=2315771)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/worker/gpu/attn_utils.py", line 251, in _reshape_attention_kv_cache
(EngineCore pid=2315771)     kv_cache = kv_raw_tensor.view(dtype).view(permuted_kv_cache_shape)
(EngineCore pid=2315771) RuntimeError: shape '[35397, 2, 16, 8, 132]' is invalid for input of size 2356024320
[rank0]:[W715 05:14:49.132366342 ProcessGroupNCCL.cpp:1575] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator())
(APIServer pid=2315524) Traceback (most recent call last):
(APIServer pid=2315524)   File "/vllmtest/.venv/bin/vllm", line 10, in <module>
(APIServer pid=2315524)     sys.exit(main())
(APIServer pid=2315524)              ~~~~^^
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/entrypoints/cli/main.py", line 95, in main
(APIServer pid=2315524)     args.dispatch_function(args)
(APIServer pid=2315524)     ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/entrypoints/cli/serve.py", line 148, in cmd
(APIServer pid=2315524)     uvloop.run(run_server(args))
(APIServer pid=2315524)     ~~~~~~~~~~^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/uvloop/__init__.py", line 96, in run
(APIServer pid=2315524)     return __asyncio.run(
(APIServer pid=2315524)            ~~~~~~~~~~~~~^
(APIServer pid=2315524)         wrapper(),
(APIServer pid=2315524)         ^^^^^^^^^^
(APIServer pid=2315524)     ...<2 lines>...
(APIServer pid=2315524)         **run_kwargs
(APIServer pid=2315524)         ^^^^^^^^^^^^
(APIServer pid=2315524)     )
(APIServer pid=2315524)     ^
(APIServer pid=2315524)   File "/home/rangarav/.local/share/uv/python/cpython-3.13.12-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py", line 195, in run
(APIServer pid=2315524)     return runner.run(main)
(APIServer pid=2315524)            ~~~~~~~~~~^^^^^^
(APIServer pid=2315524)   File "/home/rangarav/.local/share/uv/python/cpython-3.13.12-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py", line 118, in run
(APIServer pid=2315524)     return self._loop.run_until_complete(task)
(APIServer pid=2315524)            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
(APIServer pid=2315524)   File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/uvloop/__init__.py", line 48, in wrapper
(APIServer pid=2315524)     return await main
(APIServer pid=2315524)            ^^^^^^^^^^
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/entrypoints/openai/api_server.py", line 698, in run_server
(APIServer pid=2315524)     await run_server_worker(listen_address, sock, args, **uvicorn_kwargs)
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/entrypoints/openai/api_server.py", line 712, in run_server_worker
(APIServer pid=2315524)     async with build_async_engine_client(
(APIServer pid=2315524)                ~~~~~~~~~~~~~~~~~~~~~~~~~^
(APIServer pid=2315524)         args,
(APIServer pid=2315524)         ^^^^^
(APIServer pid=2315524)         client_config=client_config,
(APIServer pid=2315524)         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)     ) as engine_client:
(APIServer pid=2315524)     ^
(APIServer pid=2315524)   File "/home/rangarav/.local/share/uv/python/cpython-3.13.12-linux-x86_64-gnu/lib/python3.13/contextlib.py", line 214, in __aenter__
(APIServer pid=2315524)     return await anext(self.gen)
(APIServer pid=2315524)            ^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/entrypoints/openai/api_server.py", line 100, in build_async_engine_client
(APIServer pid=2315524)     async with build_async_engine_client_from_engine_args(
(APIServer pid=2315524)                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
(APIServer pid=2315524)         engine_args,
(APIServer pid=2315524)         ^^^^^^^^^^^^
(APIServer pid=2315524)         usage_context=usage_context,
(APIServer pid=2315524)         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)         client_config=client_config,
(APIServer pid=2315524)         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)     ) as engine:
(APIServer pid=2315524)     ^
(APIServer pid=2315524)   File "/home/rangarav/.local/share/uv/python/cpython-3.13.12-linux-x86_64-gnu/lib/python3.13/contextlib.py", line 214, in __aenter__
(APIServer pid=2315524)     return await anext(self.gen)
(APIServer pid=2315524)            ^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/entrypoints/openai/api_server.py", line 136, in build_async_engine_client_from_engine_args
(APIServer pid=2315524)     async_llm = AsyncLLM.from_vllm_config(
(APIServer pid=2315524)         vllm_config=vllm_config,
(APIServer pid=2315524)     ...<6 lines>...
(APIServer pid=2315524)         client_index=client_index,
(APIServer pid=2315524)     )
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/async_llm.py", line 217, in from_vllm_config
(APIServer pid=2315524)     return cls(
(APIServer pid=2315524)         vllm_config=vllm_config,
(APIServer pid=2315524)     ...<9 lines>...
(APIServer pid=2315524)         client_index=client_index,
(APIServer pid=2315524)     )
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/async_llm.py", line 146, in __init__
(APIServer pid=2315524)     self.engine_core = EngineCoreClient.make_async_mp_client(
(APIServer pid=2315524)                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
(APIServer pid=2315524)         vllm_config=vllm_config,
(APIServer pid=2315524)         ^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)     ...<4 lines>...
(APIServer pid=2315524)         client_index=client_index,
(APIServer pid=2315524)         ^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)     )
(APIServer pid=2315524)     ^
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(APIServer pid=2315524)     return func(*args, **kwargs)
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core_client.py", line 132, in make_async_mp_client
(APIServer pid=2315524)     return AsyncMPClient(*client_args)
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper
(APIServer pid=2315524)     return func(*args, **kwargs)
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core_client.py", line 963, in __init__
(APIServer pid=2315524)     super().__init__(
(APIServer pid=2315524)     ~~~~~~~~~~~~~~~~^
(APIServer pid=2315524)         asyncio_mode=True,
(APIServer pid=2315524)         ^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)     ...<3 lines>...
(APIServer pid=2315524)         client_addresses=client_addresses,
(APIServer pid=2315524)         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)     )
(APIServer pid=2315524)     ^
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/core_client.py", line 573, in __init__
(APIServer pid=2315524)     with launch_core_engines(
(APIServer pid=2315524)          ~~~~~~~~~~~~~~~~~~~^
(APIServer pid=2315524)         vllm_config, executor_class, log_stats, addresses
(APIServer pid=2315524)         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)     ) as (engine_manager, coordinator, addresses, tensor_queue):
(APIServer pid=2315524)     ^
(APIServer pid=2315524)   File "/home/rangarav/.local/share/uv/python/cpython-3.13.12-linux-x86_64-gnu/lib/python3.13/contextlib.py", line 148, in __exit__
(APIServer pid=2315524)     next(self.gen)
(APIServer pid=2315524)     ~~~~^^^^^^^^^^
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/utils.py", line 1213, in launch_core_engines
(APIServer pid=2315524)     wait_for_engine_startup(
(APIServer pid=2315524)     ~~~~~~~~~~~~~~~~~~~~~~~^
(APIServer pid=2315524)         handshake_socket,
(APIServer pid=2315524)         ^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)     ...<6 lines>...
(APIServer pid=2315524)         coordinator.proc if coordinator else None,
(APIServer pid=2315524)         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2315524)     )
(APIServer pid=2315524)     ^
(APIServer pid=2315524)   File "/vllmtest/.venv/lib/python3.13/site-packages/vllm/v1/engine/utils.py", line 1272, in wait_for_engine_startup
(APIServer pid=2315524)     raise RuntimeError(
(APIServer pid=2315524)     ...<3 lines>...
(APIServer pid=2315524)     )
(APIServer pid=2315524) RuntimeError: Engine core initialization failed. See root cause above. Failed core proc(s): {}

This is because of SlidingWindowSpec.real_page_size_bytes

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions