vllm-project / vllm

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

[Bug]: Cache operations are not supported for Neuron backend. #4839

Closed milo157 closed 6 months ago

milo157 commented 6 months ago

Your current environment

PyTorch version: 2.1.2+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.4 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.29.3
Libc version: glibc-2.35

Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-1031-aws-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
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:                   48 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          32
On-line CPU(s) list:             0-31
Vendor ID:                       AuthenticAMD
Model name:                      AMD EPYC 7R13 Processor
CPU family:                      25
Model:                           1
Thread(s) per core:              2
Core(s) per socket:              16
Socket(s):                       1
Stepping:                        1
BogoMIPS:                        5299.99
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 nopl nonstop_tsc cpuid extd_apicid aperfmperf tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch topoext invpcid_single ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr rdpru wbnoinvd arat npt nrip_save vaes vpclmulqdq rdpid
Hypervisor vendor:               KVM
Virtualization type:             full
L1d cache:                       512 KiB (16 instances)
L1i cache:                       512 KiB (16 instances)
L2 cache:                        8 MiB (16 instances)
L3 cache:                        64 MiB (2 instances)
NUMA node(s):                    2
NUMA node0 CPU(s):               0-7,16-23
NUMA node1 CPU(s):               8-15,24-31
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Mmio stale data:   Not affected
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; Retpolines, IBPB conditional, IBRS_FW, STIBP always-on, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected

Versions of relevant libraries:
[pip3] numpy==1.25.2
[pip3] nvidia-nccl-cu12==2.18.1
[pip3] torch==2.1.2
[pip3] torch-neuronx==2.1.2.2.1.0
[pip3] torch-xla==2.1.2
[pip3] torchvision==0.16.2
[pip3] triton==2.1.0
[conda] Could not collectROCM Version: Could not collect
Neuron SDK Version: (0, 'instance-type: inf2.8xlarge\ninstance-id: i-0a4cb8ace67c6d13f\n+--------+--------+--------+---------+\n| NEURON | NEURON | NEURON |   PCI   |\n| DEVICE | CORES  | MEMORY |   BDF   |\n+--------+--------+--------+---------+\n| 0      | 2      | 32 GB  | 00:1f.0 |\n+--------+--------+--------+---------+', '')
vLLM Version: 0.4.2
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
Could not collect

🐛 Describe the bug

There error is: "Cache operations are not supported for Neuron backend"

My code is: ` from typing import Optional from pydantic import BaseModel from vllm import LLM, SamplingParams from transformers import AutoTokenizer import time import os from huggingface_hub import login

login(token = 'xxxxx')

model_id = "mistralai/Mistral-7B-Instruct-v0.2" llm = LLM( model=model_id, max_num_seqs=1, max_model_len=128, block_size=128,

The device can be automatically detected when AWS Neuron SDK is installed.

# The device argument can be either unspecified for automated detection,
# or explicitly assigned.
device="neuron",
tensor_parallel_size=2)

start_time = time.time()

sampling_params = SamplingParams(temperature=0.7, top_p=0.95) outputs = llm.generate(["What is your name?"], sampling_params)

End timing

end_time = time.time()

total_tokens = 0 for output in outputs: prompt = output.prompt generated_text = output.outputs[0].text print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}") `

It seems to happen on the actually llm.generate() line

I ran this successfully a few days/weeks ago but now I suddenly get this issue. I tried to checkout other version releases but it seems to not have helped the issue

milo157 commented 6 months ago

Seems like there is a issue with the latest release - it works if I checkout this specific hash: 6ef09b08f88b675f84b7140238286e5d4c5304c8 (version v0.4.1) however checking out the tag v0.4.1 does not work and results in a different error

nelsonspbr commented 2 months ago

I still get the same error with a fresh install of vllm 0.5.0+neuron214:

........
Compiler status PASS
2024-09-09 14:23:11.000504:  58607  INFO ||NEURON_CACHE||: Compile cache path: /var/tmp/neuron-compile-cache
.
Compiler status PASS
2024-09-09 14:23:32.000296:  58608  INFO ||NEURON_CACHE||: Compile cache path: /var/tmp/neuron-compile-cache
2024-Sep-09 14:23:34.0116 58275:58494 [5] init.cc:125 CCOM WARN NET/Plugin : No plugin found (libnccl-net.so), multi-instance execution will not work
Traceback (most recent call last):
  File "/home/ec2-user/fmwork/./driver", line 55, in <module>
    main()
  File "/home/ec2-user/fmwork/./driver", line 50, in main
    dts = fmwork.loop(par.reps, llm.generate, kwargs)
  File "/home/ec2-user/fmwork/fmwork.py", line 71, in loop
    function(**kwargs)
  File "/home/ec2-user/vllm/0.5.0/py310/vllm/vllm/utils.py", line 677, in inner
    return fn(*args, **kwargs)
  File "/home/ec2-user/vllm/0.5.0/py310/vllm/vllm/entrypoints/llm.py", line 304, in generate
    outputs = self._run_engine(use_tqdm=use_tqdm)
  File "/home/ec2-user/vllm/0.5.0/py310/vllm/vllm/entrypoints/llm.py", line 554, in _run_engine
    step_outputs = self.llm_engine.step()
  File "/home/ec2-user/vllm/0.5.0/py310/vllm/vllm/engine/llm_engine.py", line 773, in step
    output = self.model_executor.execute_model(
  File "/home/ec2-user/vllm/0.5.0/py310/vllm/vllm/executor/neuron_executor.py", line 53, in execute_model
    and execute_model_req.blocks_to_copy == {}), (
AssertionError: Cache operations are not supported for Neuron backend.
(20240909-py310) ec2-user@ip-10-0-173-55 fmwork$ pip list | grep vllm
vllm                              0.5.0+neuron214     /home/ec2-user/vllm/0.5.0/py310/vllm