Skip to content
New issue

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

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

[Bug]: shape is invalid for input of size #12633

Open
1 task done
kagurazakasanae opened this issue Jan 31, 2025 · 0 comments
Open
1 task done

[Bug]: shape is invalid for input of size #12633

kagurazakasanae opened this issue Jan 31, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@kagurazakasanae
Copy link

Your current environment

The output of `python collect_env.py`
INFO 01-31 21:34:53 __init__.py:183] Automatically detected platform rocm.
WARNING 01-31 21:34:53 rocm.py:31] `fork` method is not supported by ROCm. VLLM_WORKER_MULTIPROC_METHOD is overridden to `spawn` instead.
Collecting environment information...
PyTorch version: 2.5.1+rocm6.2
Is debug build: False
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: 6.2.41133-dd7f95766

OS: Ubuntu 24.04.1 LTS (x86_64)
GCC version: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Clang version: Could not collect
CMake version: version 3.31.4
Libc version: glibc-2.39

Python version: 3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0] (64-bit runtime)
Python platform: Linux-6.8.0-52-generic-x86_64-with-glibc2.39
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: AMD Instinct MI300X (gfx942:sramecc+:xnack-)
Nvidia driver version: Could not collect
cuDNN version: Could not collect
HIP runtime version: 6.2.41133
MIOpen runtime version: 3.2.0
Is XNNPACK available: True

CPU:
Architecture:                         x86_64
CPU op-mode(s):                       32-bit, 64-bit
Address sizes:                        52 bits physical, 57 bits virtual
Byte Order:                           Little Endian
CPU(s):                               256
On-line CPU(s) list:                  0-255
Vendor ID:                            AuthenticAMD
BIOS Vendor ID:                       Advanced Micro Devices, Inc.
Model name:                           AMD EPYC 9534 64-Core Processor
BIOS Model name:                      AMD EPYC 9534 64-Core Processor                 Unknown CPU @ 2.4GHz
BIOS CPU family:                      107
CPU family:                           25
Model:                                17
Thread(s) per core:                   2
Core(s) per socket:                   64
Socket(s):                            2
Stepping:                             1
Frequency boost:                      enabled
CPU(s) scaling MHz:                   99%
CPU max MHz:                          3718.0659
CPU min MHz:                          1500.0000
BogoMIPS:                             4892.26
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp ibrs_enhanced vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local user_shstk avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif x2avic v_spec_ctrl vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq la57 rdpid overflow_recov succor smca fsrm flush_l1d debug_swap
Virtualization:                       AMD-V
L1d cache:                            4 MiB (128 instances)
L1i cache:                            4 MiB (128 instances)
L2 cache:                             128 MiB (128 instances)
L3 cache:                             512 MiB (16 instances)
NUMA node(s):                         2
NUMA node0 CPU(s):                    0-63,128-191
NUMA node1 CPU(s):                    64-127,192-255
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:   Mitigation; Safe RET
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; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] pytorch-triton-rocm==3.1.0
[pip3] pyzmq==26.2.1
[pip3] torch==2.5.1+rocm6.2
[pip3] transformers==4.48.2
[pip3] transformers==4.48.2
[pip3] triton==3.0.0
[conda] Could not collect
ROCM Version: 6.2.41134-65d174c3e
Neuron SDK Version: N/A
vLLM Version: 0.7.1.dev54+g89003c40
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
============================ ROCm System Management Interface ============================
================================ Weight between two GPUs =================================
       GPU0         GPU1         GPU2         GPU3         GPU4         GPU5         GPU6         GPU7
GPU0   0            15           15           15           15           15           15           15
GPU1   15           0            15           15           15           15           15           15
GPU2   15           15           0            15           15           15           15           15
GPU3   15           15           15           0            15           15           15           15
GPU4   15           15           15           15           0            15           15           15
GPU5   15           15           15           15           15           0            15           15
GPU6   15           15           15           15           15           15           0            15
GPU7   15           15           15           15           15           15           15           0

================================= Hops between two GPUs ==================================
       GPU0         GPU1         GPU2         GPU3         GPU4         GPU5         GPU6         GPU7
GPU0   0            1            1            1            1            1            1            1
GPU1   1            0            1            1            1            1            1            1
GPU2   1            1            0            1            1            1            1            1
GPU3   1            1            1            0            1            1            1            1
GPU4   1            1            1            1            0            1            1            1
GPU5   1            1            1            1            1            0            1            1
GPU6   1            1            1            1            1            1            0            1
GPU7   1            1            1            1            1            1            1            0

=============================== Link Type between two GPUs ===============================
       GPU0         GPU1         GPU2         GPU3         GPU4         GPU5         GPU6         GPU7
GPU0   0            XGMI         XGMI         XGMI         XGMI         XGMI         XGMI         XGMI
GPU1   XGMI         0            XGMI         XGMI         XGMI         XGMI         XGMI         XGMI
GPU2   XGMI         XGMI         0            XGMI         XGMI         XGMI         XGMI         XGMI
GPU3   XGMI         XGMI         XGMI         0            XGMI         XGMI         XGMI         XGMI
GPU4   XGMI         XGMI         XGMI         XGMI         0            XGMI         XGMI         XGMI
GPU5   XGMI         XGMI         XGMI         XGMI         XGMI         0            XGMI         XGMI
GPU6   XGMI         XGMI         XGMI         XGMI         XGMI         XGMI         0            XGMI
GPU7   XGMI         XGMI         XGMI         XGMI         XGMI         XGMI         XGMI         0

======================================= Numa Nodes =======================================
GPU[0]          : (Topology) Numa Node: 0
GPU[0]          : (Topology) Numa Affinity: 0
GPU[1]          : (Topology) Numa Node: 0
GPU[1]          : (Topology) Numa Affinity: 0
GPU[2]          : (Topology) Numa Node: 0
GPU[2]          : (Topology) Numa Affinity: 0
GPU[3]          : (Topology) Numa Node: 0
GPU[3]          : (Topology) Numa Affinity: 0
GPU[4]          : (Topology) Numa Node: 1
GPU[4]          : (Topology) Numa Affinity: 1
GPU[5]          : (Topology) Numa Node: 1
GPU[5]          : (Topology) Numa Affinity: 1
GPU[6]          : (Topology) Numa Node: 1
GPU[6]          : (Topology) Numa Affinity: 1
GPU[7]          : (Topology) Numa Node: 1
GPU[7]          : (Topology) Numa Affinity: 1
================================== End of ROCm SMI Log ===================================

PYTORCH_TUNABLEOP_TUNING=0
NCCL_MIN_NCHANNELS=112
PYTORCH_TUNABLEOP_ENABLED=1
PYTORCH_ROCM_ARCH=gfx942
TORCH_BLAS_PREFER_HIPBLASLT=1
VLLM_MLA_DISABLE=0
LD_LIBRARY_PATH=/usr/local/lib/python3.12/dist-packages/cv2/../../lib64:
VLLM_WORKER_MULTIPROC_METHOD=spawn
NCCL_CUMEM_ENABLE=0
TORCHINDUCTOR_COMPILE_THREADS=1
CUDA_MODULE_LOADING=LAZY

Model Input Dumps

No response

🐛 Describe the bug

The vllm no longer working on server with MI300X GPU when running model DeepSeek R1 after this commit cabaf4e

The error is as follows

Capturing CUDA graph shapes:   0%|                                                                                                                                                                                                                                                                | 0/35 [00:00<?, ?it/s]
ERROR 01-31 21:25:22 engine.py:387] shape '[47325, 16, 12, -1, 16]' is invalid for input of size 678451200
ERROR 01-31 21:25:22 engine.py:387] Traceback (most recent call last):
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/engine/multiprocessing/engine.py", line 378, in run_mp_engine
ERROR 01-31 21:25:22 engine.py:387]     engine = MQLLMEngine.from_engine_args(engine_args=engine_args,
ERROR 01-31 21:25:22 engine.py:387]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/engine/multiprocessing/engine.py", line 121, in from_engine_args
ERROR 01-31 21:25:22 engine.py:387]     return cls(ipc_path=ipc_path,
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/engine/multiprocessing/engine.py", line 73, in __init__
ERROR 01-31 21:25:22 engine.py:387]     self.engine = LLMEngine(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/engine/llm_engine.py", line 274, in __init__
ERROR 01-31 21:25:22 engine.py:387]     self._initialize_kv_caches()
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/engine/llm_engine.py", line 427, in _initialize_kv_caches
ERROR 01-31 21:25:22 engine.py:387]     self.model_executor.initialize_cache(num_gpu_blocks, num_cpu_blocks)
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/executor/executor_base.py", line 119, in initialize_cache
ERROR 01-31 21:25:22 engine.py:387]     self.collective_rpc("initialize_cache",
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/executor/executor_base.py", line 305, in collective_rpc
ERROR 01-31 21:25:22 engine.py:387]     return self._run_workers(method, *args, **(kwargs or {}))
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/executor/mp_distributed_executor.py", line 183, in _run_workers
ERROR 01-31 21:25:22 engine.py:387]     driver_worker_output = run_method(self.driver_worker, sent_method,
ERROR 01-31 21:25:22 engine.py:387]                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/utils.py", line 2208, in run_method
ERROR 01-31 21:25:22 engine.py:387]     return func(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/worker/worker.py", line 309, in initialize_cache
ERROR 01-31 21:25:22 engine.py:387]     self._warm_up_model()
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/worker/worker.py", line 339, in _warm_up_model
ERROR 01-31 21:25:22 engine.py:387]     self.model_runner.capture_model(self.gpu_cache)
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context
ERROR 01-31 21:25:22 engine.py:387]     return func(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/worker/model_runner.py", line 1549, in capture_model
ERROR 01-31 21:25:22 engine.py:387]     graph_runner.capture(**capture_inputs)
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/worker/model_runner.py", line 1901, in capture
ERROR 01-31 21:25:22 engine.py:387]     self.model(
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
ERROR 01-31 21:25:22 engine.py:387]     return self._call_impl(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1747, in _call_impl
ERROR 01-31 21:25:22 engine.py:387]     return forward_call(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/model_executor/models/deepseek_v3.py", line 532, in forward
ERROR 01-31 21:25:22 engine.py:387]     hidden_states = self.model(input_ids, positions, kv_caches,
ERROR 01-31 21:25:22 engine.py:387]                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
ERROR 01-31 21:25:22 engine.py:387]     return self._call_impl(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1747, in _call_impl
ERROR 01-31 21:25:22 engine.py:387]     return forward_call(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/model_executor/models/deepseek_v3.py", line 488, in forward
ERROR 01-31 21:25:22 engine.py:387]     hidden_states, residual = layer(positions, hidden_states,
ERROR 01-31 21:25:22 engine.py:387]                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
ERROR 01-31 21:25:22 engine.py:387]     return self._call_impl(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1747, in _call_impl
ERROR 01-31 21:25:22 engine.py:387]     return forward_call(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/model_executor/models/deepseek_v3.py", line 407, in forward
ERROR 01-31 21:25:22 engine.py:387]     hidden_states = self.self_attn(
ERROR 01-31 21:25:22 engine.py:387]                     ^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
ERROR 01-31 21:25:22 engine.py:387]     return self._call_impl(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1747, in _call_impl
ERROR 01-31 21:25:22 engine.py:387]     return forward_call(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/model_executor/models/deepseek_v3.py", line 327, in forward
ERROR 01-31 21:25:22 engine.py:387]     attn_output = self.attn(q, k, v, kv_cache, attn_metadata)
ERROR 01-31 21:25:22 engine.py:387]                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
ERROR 01-31 21:25:22 engine.py:387]     return self._call_impl(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1747, in _call_impl
ERROR 01-31 21:25:22 engine.py:387]     return forward_call(*args, **kwargs)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/attention/layer.py", line 184, in forward
ERROR 01-31 21:25:22 engine.py:387]     return torch.ops.vllm.unified_attention(
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/usr/local/lib/python3.12/dist-packages/torch/_ops.py", line 1116, in __call__
ERROR 01-31 21:25:22 engine.py:387]     return self._op(*args, **(kwargs or {}))
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/attention/layer.py", line 290, in unified_attention
ERROR 01-31 21:25:22 engine.py:387]     return self.impl.forward(self, query, key, value, kv_cache, attn_metadata)
ERROR 01-31 21:25:22 engine.py:387]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/attention/backends/rocm_flash_attn.py", line 612, in forward
ERROR 01-31 21:25:22 engine.py:387]     key_cache, value_cache = PagedAttention.split_kv_cache(
ERROR 01-31 21:25:22 engine.py:387]                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387]   File "/data/vllm/vllm/attention/ops/paged_attn.py", line 58, in split_kv_cache
ERROR 01-31 21:25:22 engine.py:387]     key_cache = key_cache.view(num_blocks, num_kv_heads, head_size // x,
ERROR 01-31 21:25:22 engine.py:387]                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 01-31 21:25:22 engine.py:387] RuntimeError: shape '[47325, 16, 12, -1, 16]' is invalid for input of size 678451200
ERROR 01-31 21:25:23 multiproc_worker_utils.py:122] Worker VllmWorkerProcess pid 154219 died, exit code: -15

The command that I used to run is vllm serve deepseek-ai/DeepSeek-R1 --tokenizer deepseek-ai/DeepSeek-R1 --host 0.0.0.0 --port 30001 --trust-remote-code --tensor-parallel-size 8 --max-model-len 65536

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.
@kagurazakasanae kagurazakasanae added the bug Something isn't working label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant