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]: Can't use offline inference embedding #4908

Closed
Fanb1ing opened this issue May 19, 2024 · 6 comments · Fixed by #5946
Closed

[Bug]: Can't use offline inference embedding #4908

Fanb1ing opened this issue May 19, 2024 · 6 comments · Fixed by #5946
Labels
bug Something isn't working

Comments

@Fanb1ing
Copy link

Your current environment

Collecting environment information...

/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn.so.8
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
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: 52 bits physical, 57 bits virtual
Byte Order: Little Endian
CPU(s): 128
On-line CPU(s) list: 0-127
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) Platinum 8358 CPU @ 2.60GHz
CPU family: 6
Model: 106
Thread(s) per core: 2
Core(s) per socket: 32
Socket(s): 2
Stepping: 6
CPU max MHz: 3400.0000
CPU min MHz: 800.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
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 IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected

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] numpy 1.26.4 pypi_0 pypi
[conda] nvidia-nccl-cu12 2.20.5 pypi_0 pypi
[conda] torch 2.3.0 pypi_0 pypi
[conda] triton 2.3.0 pypi_0 pypi
[conda] vllm-nccl-cu12 2.18.1.0.4.0 pypi_0 pypiROCM 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 GPU1 GPU2 GPU3 GPU4 GPU5 CPU Affinity NUMA Affinity GPU NUMA ID
GPU0 X PXB PXB PXB SYS SYS 0-31,64-95 0 N/A
GPU1 PXB X PXB PXB SYS SYS 0-31,64-95 0 N/A
GPU2 PXB PXB X PIX SYS SYS 0-31,64-95 0 N/A
GPU3 PXB PXB PIX X SYS SYS 0-31,64-95 0 N/A
GPU4 SYS SYS SYS SYS X PIX 32-63,96-127 1 N/A
GPU5 SYS SYS SYS SYS PIX X 32-63,96-127 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

🐛 Describe the bug

I use the example code of offline inference embedding at https://docs.vllm.ai/en/latest/getting_started/examples/offline_inference_embedding.html. I only change the model path.

And I recieved this error as follow:
outputs = model.encode(prompts)
^^^^^^^^^^^^
AttributeError: 'LLM' object has no attribute 'encode'

@Fanb1ing Fanb1ing added the bug Something isn't working label May 19, 2024
@robertgshaw2-redhat
Copy link
Collaborator

Embedding models are going to be supported in v0.4.3

So, install from source to use now

@Fanb1ing
Copy link
Author

Thank you very much. I will try to install new version.

@Loreley99
Copy link

Hello, I would like to ask why this error:
"---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in <cell line: 1>()
----> 1 outputs = model.encode(prompts)

10 frames
/content/vllm/vllm/model_executor/sampling_metadata.py in _prepare_seq_groups(seq_group_metadata_list, seq_lens, query_lens, device)
206
207 if seq_group_metadata.is_prompt:
--> 208 if sampling_params.seed is not None:
209 seq_group_metadata.state.generator = torch.Generator(
210 device=device).manual_seed(sampling_params.seed)
AttributeError: 'NoneType' object has no attribute 'seed'"occurs during use?

The model I'm using is llama3-8b, thanks!

@robertgshaw2-redhat
Copy link
Collaborator

Hello, I would like to ask why this error: "--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in <cell line: 1>() ----> 1 outputs = model.encode(prompts)

10 frames /content/vllm/vllm/model_executor/sampling_metadata.py in _prepare_seq_groups(seq_group_metadata_list, seq_lens, query_lens, device) 206 207 if seq_group_metadata.is_prompt: --> 208 if sampling_params.seed is not None: 209 seq_group_metadata.state.generator = torch.Generator( 210 device=device).manual_seed(sampling_params.seed) AttributeError: 'NoneType' object has no attribute 'seed'"occurs during use?

The model I'm using is llama3-8b, thanks!

If you're running the generic Llama-3-8b model, you are running with a generation model rather than an embedding model. I should update the encode API to fail more gracefully if called in this configuration.

If you want to use an embedding model, try:

@Loreley99
Copy link

Hello, I would like to ask why this error: "--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in <cell line: 1>() ----> 1 outputs = model.encode(prompts)
10 frames /content/vllm/vllm/model_executor/sampling_metadata.py in _prepare_seq_groups(seq_group_metadata_list, seq_lens, query_lens, device) 206 207 if seq_group_metadata.is_prompt: --> 208 if sampling_params.seed is not None: 209 seq_group_metadata.state.generator = torch.Generator( 210 device=device).manual_seed(sampling_params.seed) AttributeError: 'NoneType' object has no attribute 'seed'"occurs during use?
The model I'm using is llama3-8b, thanks!

If you're running the generic Llama-3-8b model, you are running with a generation model rather than an embedding model. I should update the encode API to fail more gracefully if called in this configuration.

If you want to use an embedding model, try:

Thank you very much for your quick reply! May I ask if there is an API for vllm if I want to extract the hidden state of the generation model?

@Fanb1ing
Copy link
Author

Hello, I would like to ask why this error: "--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in <cell line: 1>() ----> 1 outputs = model.encode(prompts)
10 frames /content/vllm/vllm/model_executor/sampling_metadata.py in _prepare_seq_groups(seq_group_metadata_list, seq_lens, query_lens, device) 206 207 if seq_group_metadata.is_prompt: --> 208 if sampling_params.seed is not None: 209 seq_group_metadata.state.generator = torch.Generator( 210 device=device).manual_seed(sampling_params.seed) AttributeError: 'NoneType' object has no attribute 'seed'"occurs during use?
The model I'm using is llama3-8b, thanks!

If you're running the generic Llama-3-8b model, you are running with a generation model rather than an embedding model. I should update the encode API to fail more gracefully if called in this configuration.
If you want to use an embedding model, try:

Thank you very much for your quick reply! May I ask if there is an API for vllm if I want to extract the hidden state of the generation model?

Getting the hidden state of the generation model is exactly what I am struggling with. Have you found any good solutions? All the tools I found are targeted for embedding model, not supporting llama3.

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

Successfully merging a pull request may close this issue.

3 participants