vllm-project / vllm

A high-throughput and memory-efficient inference and serving engine for LLMs
https://docs.vllm.ai
Apache License 2.0
29.85k stars 4.51k forks source link

[Bug]: TypeError in XFormersMetadata #4399

Open skonto opened 6 months ago

skonto commented 6 months ago

Your current environment

python collect_env.py
Collecting environment information...
PyTorch version: 2.2.1+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Fedora release 36 (Thirty Six) (x86_64)
GCC version: (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)
Clang version: Could not collect
CMake version: version 3.29.2
Libc version: glibc-2.35

Python version: 3.10.7 (main, Sep  7 2022, 00:00:00) [GCC 12.2.1 20220819 (Red Hat 12.2.1-1)] (64-bit runtime)
Python platform: Linux-6.2.15-100.fc36.x86_64-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: Quadro T1000
Nvidia driver version: 530.41.03
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Address sizes:                   39 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          12
On-line CPU(s) list:             0-11
Vendor ID:                       GenuineIntel
Model name:                      Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
CPU family:                      6
Model:                           158
Thread(s) per core:              2
Core(s) per socket:              6
Socket(s):                       1
Stepping:                        10
CPU(s) scaling MHz:              89%
CPU max MHz:                     4500.0000
CPU min MHz:                     800.0000
BogoMIPS:                        5199.98
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 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 invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust sgx bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp sgx_lc md_clear flush_l1d arch_capabilities
Virtualization:                  VT-x
L1d cache:                       192 KiB (6 instances)
L1i cache:                       192 KiB (6 instances)
L2 cache:                        1.5 MiB (6 instances)
L3 cache:                        12 MiB (1 instance)
NUMA node(s):                    1
NUMA node0 CPU(s):               0-11
Vulnerability Itlb multihit:     KVM: Mitigation: VMX disabled
Vulnerability L1tf:              Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Mmio stale data:   Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed:          Mitigation; IBRS
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 conditional, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:             Mitigation; Microcode
Vulnerability Tsx async abort:   Not affected

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-nccl-cu12==2.19.3
[pip3] torch==2.2.1
[pip3] triton==2.2.0
[pip3] vllm-nccl-cu12==2.18.1.0.4.0
[conda] Could not collectROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.4.1
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    CPU Affinity    NUMA Affinity
GPU0     X  0-11        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

🐛 Describe the bug

Running the following creates an error:

docker run --runtime nvidia    -v ~/.cache/huggingface:/root/.cache/huggingface     --env "HUGGING_FACE_HUB_TOKEN=..."     -p 8000:8000     --ipc=host     vllm/vllm-openai:latest     --model meta-llama/Meta-Llama-3-8B-Instruct --device=cpu

with the following prompt:

curl http://localhost:8000/v1/completions -H "Content-Type: application/json" -d '{
    "model": "meta-llama/Meta-Llama-3-8B-Instruct",
    "prompt": "..."
}'
TypeError: XFormersMetadata.__init__() got an unexpected keyword argument 'num_prefills'

I can see the same error without the docker image using: HF_TOKEN=... python -m vllm.entrypoints.openai.api_server --device=cpu --model meta-llama/Meta-Llama-3-8B-Instruct

memduhcagridemir commented 6 months ago

I wonder if the error is somehow related to --device=cpu parameter passed in.

Based on the flags, your CPU doesn't support AVX512 which is a prerequisite for CPU inference.

skonto commented 6 months ago

Hi @memduhcagridemir thanks, it could be the case. I see in the docs that cpu is only supported for AVX512, I only have AVX2. This is interesting because I was able to run llama3 without vllm (just hf code) on my machine although it was a bit slow (also run with ollama and it run pretty fast, 4bits). As a side note I would have expected some msg printed as well looking at the PR here: https://github.com/vllm-project/vllm/pull/3634:

message(FATAL_ERROR "vLLM CPU backend requires AVX512 ISA support.")

:thinking:

skonto commented 6 months ago

Also probably avx512 may not be a requirement for all models see this: https://github.com/ollama/ollama/issues/2205#issuecomment-1912615902.

jjasghar commented 6 months ago

I think I've ran into the same problem here, I'm have a GPU on my box, but it's an old Nvidia Tesla DC GPU. What's the best way to see if my CPU supports AVX512?

hiGiraffe commented 6 months ago

I have ran into the same problem too. This is my environment

Collecting environment information...
PyTorch version: 2.2.1+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.6 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Clang version: Could not collect
CMake version: version 3.29.2
Libc version: glibc-2.31

Python version: 3.8.10 (default, Nov 22 2023, 10:22:35)  [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.4.0-173-generic-x86_64-with-glibc2.29
Is CUDA available: True
CUDA runtime version: 12.1.105
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: NVIDIA GeForce RTX 3090
GPU 1: NVIDIA GeForce RTX 3090

Nvidia driver version: 550.54.14
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Byte Order:                         Little Endian
Address sizes:                      46 bits physical, 57 bits virtual
CPU(s):                             104
On-line CPU(s) list:                0-103
Thread(s) per core:                 2
Core(s) per socket:                 26
Socket(s):                          2
NUMA node(s):                       2
Vendor ID:                          GenuineIntel
CPU family:                         6
Model:                              106
Model name:                         Intel(R) Xeon(R) Gold 5320 CPU @ 2.20GHz
Stepping:                           6
CPU MHz:                            2800.000
BogoMIPS:                           4400.00
Virtualization:                     VT-x
L1d cache:                          2.4 MiB
L1i cache:                          1.6 MiB
L2 cache:                           65 MiB
L3 cache:                           78 MiB
NUMA node0 CPU(s):                  0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102
NUMA node1 CPU(s):                  1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed:             Not affected
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected
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 invpcid_single ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq rdpid md_clear pconfig flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.24.4
[pip3] torch==2.2.1
[pip3] triton==2.2.0
[conda] Could not collect

Obviously my cpus support avx512. But when I ran

python3 -m vllm.entrypoints.openai.api_server \
--device cpu

and

curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
        "model": "facebook/opt-125m",
        "messages": [
            {"role": "system", "content": "You are an intelligent British female writer and translator who is good at writing science fiction using multiple languages. You won a Nobel price in literature five years ago."},
            {"role": "user", "content": "Please detailedly tell a story about an exciting aerospace expedition for a Chinese boy Lam and his German dog. They are sent to aerospace by mistake and strive to wait for rescue from motherland with no water and food supply for over a month. They are almost caught by aliens disguised as his mother. Moreover, please translate the above story to Chinese, German, French, Portuguese and Japanese respectively."}
        ], "temperature": 0
    }' 

I got the same error

TypeError: __init__() got an unexpected keyword argument 'num_prefills'

I wanted to ask if you solved this problem?

jjasghar commented 6 months ago

I updated vllm==0.4.2 to it, and still getting:

  File "/home/gpu/srv/vllm/venv/lib64/python3.11/site-packages/vllm/engine/async_llm_engine.py", line 475, in engine_step
    request_outputs = await self.engine.step_async()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gpu/srv/vllm/venv/lib64/python3.11/site-packages/vllm/engine/async_llm_engine.py", line 221, in step_async
    output = await self.model_executor.execute_model_async(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gpu/srv/vllm/venv/lib64/python3.11/site-packages/vllm/executor/cpu_executor.py", line 101, in execute_model_async
    output = await make_async(self.driver_worker.execute_model
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gpu/srv/vllm/venv/lib64/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/gpu/srv/vllm/venv/lib64/python3.11/site-packages/vllm/worker/cpu_worker.py", line 290, in execute_model
    output = self.model_runner.execute_model(seq_group_metadata_list,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gpu/srv/vllm/venv/lib64/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/gpu/srv/vllm/venv/lib64/python3.11/site-packages/vllm/worker/cpu_model_runner.py", line 320, in execute_model
    ) = self.prepare_input_tensors(seq_group_metadata_list)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gpu/srv/vllm/venv/lib64/python3.11/site-packages/vllm/worker/cpu_model_runner.py", line 270, in prepare_input_tensors
    ) = self._prepare_prompt(seq_group_metadata_list)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gpu/srv/vllm/venv/lib64/python3.11/site-packages/vllm/worker/cpu_model_runner.py", line 152, in _prepare_prompt
    attn_metadata = self.attn_backend.make_metadata(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gpu/srv/vllm/venv/lib64/python3.11/site-packages/vllm/attention/backends/xformers.py", line 29, in make_metadata
    return XFormersMetadata(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: XFormersMetadata.__init__() got an unexpected keyword argument 'num_prefills'
jjasghar commented 6 months ago
(venv) [gpu@ava vllm]$ python collect_env.py
Collecting environment information...
PyTorch version: 2.3.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: CentOS Stream 8 (x86_64)
GCC version: (GCC) 8.5.0 20210514 (Red Hat 8.5.0-21)
Clang version: Could not collect
CMake version: version 3.29.2
Libc version: glibc-2.28

Python version: 3.11.7 (main, Jan 26 2024, 19:22:20) [GCC 8.5.0 20210514 (Red Hat 8.5.0-21)] (64-bit runtime)
Python platform: Linux-6.8.1-1.el8.elrepo.x86_64-x86_64-with-glibc2.28
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: Tesla T4
Nvidia driver version: 550.54.15
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              192
On-line CPU(s) list: 0-191
Thread(s) per core:  2
Core(s) per socket:  48
Socket(s):           2
NUMA node(s):        2
Vendor ID:           GenuineIntel
CPU family:          6
Model:               143
Model name:          Intel(R) Xeon(R) Platinum 8474C
Stepping:            8
CPU MHz:             786.324
BogoMIPS:            4200.00
Virtualization:      VT-x
L1d cache:           48K
L1i cache:           32K
L2 cache:            2048K
L3 cache:            99840K
NUMA node0 CPU(s):   0-47,96-143
NUMA node1 CPU(s):   48-95,144-191
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hfi vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] torch==2.3.0
[pip3] triton==2.3.0
[pip3] vllm-nccl-cu12==2.18.1.0.4.0
[conda] Could not collectROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.4.2
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      48-95,144-191   1               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
github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this issue should remain open. Thank you!

NWalker1208 commented 5 days ago

I believe I am experiencing the same issue. My CPU does seem to support AVX 512, as I see several references to AVX 512 under the Flags from lscpu. I'm attempting to run Qwen2-VL-7B-Instruct on my CPU using vLLM. Here is the relevant portion of the stack trace from my Python notebook:

File /usr/local/lib/python3.10/dist-packages/vllm/utils.py:1063, in deprecate_kwargs.<locals>.wrapper.<locals>.inner(*args, **kwargs)
   1056             msg += f" {additional_message}"
   1058         warnings.warn(
   1059             DeprecationWarning(msg),
   1060             stacklevel=3,  # The inner function takes up one level
   1061         )
-> 1063 return fn(*args, **kwargs)

File /usr/local/lib/python3.10/dist-packages/vllm/entrypoints/llm.py:353, in LLM.generate(self, prompts, sampling_params, prompt_token_ids, use_tqdm, lora_request, prompt_adapter_request, guided_options_request, priority)
    343     sampling_params = SamplingParams()
    345 self._validate_and_add_requests(
    346     prompts=parsed_prompts,
    347     params=sampling_params,
   (...)
    350     guided_options=guided_options_request,
    351     priority=priority)
--> 353 outputs = self._run_engine(use_tqdm=use_tqdm)
    354 return LLMEngine.validate_outputs(outputs, RequestOutput)

File /usr/local/lib/python3.10/dist-packages/vllm/entrypoints/llm.py:879, in LLM._run_engine(self, use_tqdm)
    877 total_out_toks = 0
    878 while self.llm_engine.has_unfinished_requests():
--> 879     step_outputs = self.llm_engine.step()
    880     for output in step_outputs:
    881         if output.finished:

File /usr/local/lib/python3.10/dist-packages/vllm/engine/llm_engine.py:1389, in LLMEngine.step(self)
   1385 if allow_async_output_proc:
   1386     execute_model_req.async_callback = self.async_callbacks[
   1387         virtual_engine]
-> 1389 outputs = self.model_executor.execute_model(
   1390     execute_model_req=execute_model_req)
   1392 # We need to do this here so that last step's sampled_token_ids can
   1393 # be passed to the next iteration for PP.
   1394 if self.scheduler_config.is_multi_step:

File /usr/local/lib/python3.10/dist-packages/vllm/executor/cpu_executor.py:229, in CPUExecutor.execute_model(self, execute_model_req)
    223 if (self.parallel_config.tensor_parallel_size > 1
    224         and self.parallel_worker_tasks is None):
    225     self.parallel_worker_tasks = self._run_workers(
    226         "start_worker_execution_loop",
    227         async_run_remote_workers_only=True,
    228     )
--> 229 output = self.driver_method_invoker(self.driver_worker,
    230                                     "execute_model", execute_model_req)
    231 return output

File /usr/local/lib/python3.10/dist-packages/vllm/executor/cpu_executor.py:385, in _driver_method_invoker(driver, method, *args, **kwargs)
    384 def _driver_method_invoker(driver, method: str, *args, **kwargs):
--> 385     return getattr(driver, method)(*args, **kwargs)

File /usr/local/lib/python3.10/dist-packages/vllm/worker/worker_base.py:303, in LocalOrDistributedWorkerBase.execute_model(self, execute_model_req)
    299 """Executes at least one model step on the given sequences, unless no
    300 sequences are provided."""
    301 start_time = time.perf_counter()
--> 303 inputs = self.prepare_input(execute_model_req)
    304 if inputs is None:
    305     return None

File /usr/local/lib/python3.10/dist-packages/vllm/worker/worker_base.py:291, in LocalOrDistributedWorkerBase.prepare_input(self, execute_model_req)
    289             broadcast_tensor_dict({}, src=0)
    290         return None
--> 291     return self._get_driver_input_and_broadcast(execute_model_req)
    292 else:
    293     return self._get_worker_input_from_broadcast()

File /usr/local/lib/python3.10/dist-packages/vllm/worker/worker_base.py:253, in LocalOrDistributedWorkerBase._get_driver_input_and_broadcast(self, execute_model_req)
    248 assert self.is_driver_worker
    250 worker_input: WorkerInput = self.prepare_worker_input(
    251     execute_model_req=execute_model_req)
    252 model_input: ModelRunnerInputBase = (
--> 253     self.model_runner.prepare_model_input(
    254         execute_model_req.seq_group_metadata_list,
    255         execute_model_req.virtual_engine,
    256         execute_model_req.finished_requests_ids))
    258 kwargs = extract_previous_hidden_states(execute_model_req)
    260 if self.do_metadata_broadcast:

File /usr/local/lib/python3.10/dist-packages/vllm/worker/cpu_model_runner.py:489, in CPUModelRunner.prepare_model_input(self, seq_group_metadata_list, virtual_engine, finished_requests_ids)
    479 def prepare_model_input(
    480     self,
    481     seq_group_metadata_list: List[SequenceGroupMetadata],
    482     virtual_engine: int = 0,
    483     finished_requests_ids: Optional[List[str]] = None
    484 ) -> ModelInputForCPUWithSamplingMetadata:
    485     """Prepare the model input based on a given sequence group, including
    486     metadata for the sampling step.
    487 
    488     """
--> 489     model_input = self._prepare_model_input_tensors(
    490         seq_group_metadata_list, finished_requests_ids)
    491     # Sampling metadata is only required for the final pp group
    492     generators = self.get_generators(finished_requests_ids)

File /usr/local/lib/python3.10/dist-packages/vllm/worker/cpu_model_runner.py:477, in CPUModelRunner._prepare_model_input_tensors(self, seq_group_metadata_list, finished_requests_ids)
    474 for seq_group_metadata in seq_group_metadata_list:
    475     builder.add_seq_group(seq_group_metadata)
--> 477 return builder.build()

File /usr/local/lib/python3.10/dist-packages/vllm/worker/cpu_model_runner.py:131, in ModelInputForCPUBuilder.build(self)
    128 # Prepare input tensors.
    129 if is_prompt:
    130     (input_tokens, input_positions, attn_metadata, seq_lens,
--> 131      multi_modal_kwargs) = self._prepare_prompt(
    132          self.seq_group_metadata_list)
    133 else:
    134     (input_tokens, input_positions,
    135      attn_metadata) = self._prepare_decode(
    136          self.seq_group_metadata_list)

File /usr/local/lib/python3.10/dist-packages/vllm/worker/cpu_model_runner.py:268, in ModelInputForCPUBuilder._prepare_prompt(self, seq_group_metadata_list)
    260 input_positions = torch.tensor(input_positions
    261                                or input_mrope_positions,
    262                                dtype=torch.long,
    263                                device=self.device)  # type: ignore
    264 slot_mapping = torch.tensor(slot_mapping,
    265                             dtype=torch.long,
    266                             device=self.device)  # type: ignore
--> 268 attn_metadata = self.attn_backend.make_metadata(
    269     is_prompt=True,
    270     seq_lens=seq_lens,
    271     seq_lens_tensor=torch.tensor([]),
    272     max_decode_seq_len=0,
    273     num_prefills=len(seq_lens),
    274     num_prefill_tokens=num_prompt_tokens,
    275     num_decode_tokens=0,
    276     block_tables=torch.tensor([]),
    277     slot_mapping=slot_mapping,
    278 )
    280 multi_modal_kwargs = MultiModalInputs.batch(multi_modal_inputs_list)
    282 return (input_tokens, input_positions, attn_metadata, seq_lens,
    283         multi_modal_kwargs)

File /usr/local/lib/python3.10/dist-packages/vllm/attention/backends/abstract.py:47, in AttentionBackend.make_metadata(cls, *args, **kwargs)
     45 @classmethod
     46 def make_metadata(cls, *args, **kwargs) -> "AttentionMetadata":
---> 47     return cls.get_metadata_cls()(*args, **kwargs)

TypeError: XFormersMetadata.__init__() got an unexpected keyword argument 'is_prompt'