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]: Cannot Run Qwen2 Embedding Model on Gaudi #583

Open
1 task done
rvoleti89 opened this issue Dec 4, 2024 · 6 comments
Open
1 task done

[Bug]: Cannot Run Qwen2 Embedding Model on Gaudi #583

rvoleti89 opened this issue Dec 4, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@rvoleti89
Copy link

Your current environment

The output of `python collect_env.py`
/usr/lib/python3.10/inspect.py:288: FutureWarning: `torch.distributed.reduce_op` is deprecated, please use `torch.distributed.ReduceOp` instead
  return isinstance(object, types.FunctionType)
Detected capabilities: [-cpu -gaudi +gaudi2 -gaudi3 -index_reduce]
Collecting environment information...
PyTorch version: 2.4.0a0+git74cd574
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

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

Python version: 3.10.12 (main, Nov  6 2024, 20:22:13) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-122-generic-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:                        46 bits physical, 57 bits virtual
Byte Order:                           Little Endian
CPU(s):                               160
On-line CPU(s) list:                  0-159
Vendor ID:                            GenuineIntel
Model name:                           Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz
CPU family:                           6
Model:                                106
Thread(s) per core:                   2
Core(s) per socket:                   40
Socket(s):                            2
Stepping:                             6
CPU max MHz:                          3400.0000
CPU min MHz:                          800.0000
BogoMIPS:                             4600.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 invpcid_single intel_ppin 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 split_lock_detect wbnoinvd dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid fsrm md_clear pconfig flush_l1d arch_capabilities
Virtualization:                       VT-x
L1d cache:                            3.8 MiB (80 instances)
L1i cache:                            2.5 MiB (80 instances)
L2 cache:                             100 MiB (80 instances)
L3 cache:                             120 MiB (2 instances)
NUMA node(s):                         2
NUMA node0 CPU(s):                    0-39,80-119
NUMA node1 CPU(s):                    40-79,120-159
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 Reg file data sampling: Not affected
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   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 / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI SW loop, KVM SW loop
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected

Versions of relevant libraries:
[pip3] habana-torch-dataloader==1.18.0.524
[pip3] habana-torch-plugin==1.18.0.524
[pip3] numpy==1.26.4
[pip3] pynvml==8.0.4
[pip3] pytorch-lightning==2.4.0
[pip3] pyzmq==26.2.0
[pip3] torch==2.4.0a0+git74cd574
[pip3] torch_tb_profiler==0.4.0
[pip3] torchaudio==2.4.0a0+69d4077
[pip3] torchdata==0.7.1+5e6f7b7
[pip3] torchmetrics==1.6.0
[pip3] torchtext==0.18.0a0+9bed85d
[pip3] torchvision==0.19.0a0+48b1edf
[pip3] transformers==4.46.3
[pip3] triton==3.1.0
[conda] Could not collect
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.1.dev60+g3e5cd00 (git sha: 3e5cd00
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
Could not collect

LD_LIBRARY_PATH=/usr/local/lib/python3.10/dist-packages/cv2/../../lib64:/opt/habanalabs/libfabric-1.22.0/lib:/opt/amazon/openmpi/lib:/usr/lib/habanalabs:
TORCHINDUCTOR_COMPILE_THREADS=1

Model Input Dumps

No response

🐛 Describe the bug

I am trying to serve the following embedding model in a Kubernetes pod on a Gaudi2 Node with Habana 1.18: Alibaba-NLP/gte-Qwen2-7B-instruct

The pod is running the model with the following serving command:
vllm serve Alibaba-NLP/gte-Qwen2-7B-instruct --task embedding --trust-remote-code

I see the server start successfully, load the weights, and complete warm up as expected. I have set up a k8s service to access the pod externally via curl or python requests with the OpenAI client.

Example curl request:

curl http://100.80.15.19:8000/v1/embeddings\
  -H "Authorization: Bearer xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Hello, this is a test",
    "model": "Alibaba-NLP/gte-Qwen2-7B-instruct",
    "encoding_format": "float"
  }'

This unfortunately just crashes my pod with the following TraceBack in server logs:

│ INFO 12-04 05:49:12 logger.py:37] Received request embd-75f19ddc1028446e88aaca4f98a320df-0: prompt: 'Hello, this is a test', params: PoolingParams │
│ INFO 12-04 05:49:12 engine.py:268] Added request embd-75f19ddc1028446e88aaca4f98a320df-0.                                                          │
│ ERROR 12-04 05:49:12 engine.py:136] TypeError("'NoneType' object is not subscriptable")                                                            │
│ ERROR 12-04 05:49:12 engine.py:136] Traceback (most recent call last):                                                                             │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/engine/multip │
│ ERROR 12-04 05:49:12 engine.py:136]     self.run_engine_loop()                                                                                     │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/engine/multip │
│ ERROR 12-04 05:49:12 engine.py:136]     request_outputs = self.engine_step()                                                                       │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/engine/multip │
│ ERROR 12-04 05:49:12 engine.py:136]     raise e                                                                                                    │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/engine/multip │
│ ERROR 12-04 05:49:12 engine.py:136]     return self.engine.step()                                                                                  │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/engine/llm_en │
│ ERROR 12-04 05:49:12 engine.py:136]     outputs = self.model_executor.execute_model(                                                               │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/executor/hpu_ │
│ ERROR 12-04 05:49:12 engine.py:136]     output = self.driver_worker.execute_model(execute_model_req)                                               │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/worker/worker │
│ ERROR 12-04 05:49:12 engine.py:136]     inputs = self.prepare_input(execute_model_req)                                                             │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/worker/worker │
│ ERROR 12-04 05:49:12 engine.py:136]     return self._get_driver_input_and_broadcast(execute_model_req)                                             │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/worker/worker │
│ ERROR 12-04 05:49:12 engine.py:136]     self.model_runner.prepare_model_input(                                                                     │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context     │
│ ERROR 12-04 05:49:12 engine.py:136]     return func(*args, **kwargs)                                                                               │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/worker/hpu_mo │
│ ERROR 12-04 05:49:12 engine.py:136]     model_input, sampling_metadata = self.prepare_input_tensors(                                               │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/worker/hpu_mo │
│ ERROR 12-04 05:49:12 engine.py:136]     ) = self._prepare_prompt(prefill_reqs)                                                                     │
│ ERROR 12-04 05:49:12 engine.py:136]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.1.dev60+g3e5cd00.gaudi000-py3.10.egg/vllm/worker/hpu_mo │
│ ERROR 12-04 05:49:12 engine.py:136]     block_number = block_table[i // self.block_size]                                                           │
│ ERROR 12-04 05:49:12 engine.py:136] TypeError: 'NoneType' object is not subscriptable                                                              │
│ CRITICAL 12-04 05:49:12 launcher.py:99] MQLLMEngine is already dead, terminating server process                                                    │
│ INFO:     100.80.14.103:64687 - "POST /v1/embeddings HTTP/1.1" 500 Internal Server Error                                                           │
│ INFO:     Shutting down                                                                                                                            │
│ INFO:     Waiting for application shutdown.                                                                                                        │
│ INFO:     Application shutdown complete.                                                                                                           │

As a sanity check, I ran this exact same command with vLLM v0.6.4.post1 on a 20 GB Nvidia A100 MIG slice, and it worked perfectly, so this issue seems Gaudi specific to me.

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.
@rvoleti89 rvoleti89 added the bug Something isn't working label Dec 4, 2024
@rvoleti89 rvoleti89 changed the title [Bug]: [Bug]: Cannot Run Qwen2 Embedding Model on Gaudi Dec 4, 2024
@michalkuligowski
Copy link

michalkuligowski commented Dec 4, 2024

Hi @rvoleti89 from the collect env printout I see that you are using vllm version different from what is support in 1.18. Can you try:
$ git clone https://github.com/HabanaAI/vllm-fork.git
$ cd vllm-fork
$ git checkout v0.5.3.post1+Gaudi-1.18.0
$ pip install -r requirements-hpu.txt
$ pip install -e .

and see if that helps?

@rvoleti89
Copy link
Author

Hi @rvoleti89 from the collect env printout I see that you are using vllm version different from what is support in 1.18. Can you try: $ git clone https://github.com/HabanaAI/vllm-fork.git $ cd vllm-fork $ git checkout v0.5.3.post1+Gaudi-1.18.0 $ pip install -r requirements-hpu.txt $ pip install -e .

and see if that helps?

I have tried the v0.5.3.post1+Gaudi-1.18.0 tagged version as well. I don't believe embeddings were supported at all in that version.

This version I am trying here was the latest build off of the habana_main branch as of yesterday. 1.18 is stated as a requirement in the README.

@rvoleti89
Copy link
Author

rvoleti89 commented Dec 4, 2024

To be clear, this is the commit I used for the build:

1440f45

My commit hash in the printout is different as I forked it to a personal repository to automate the build with a CI/CD pipeline, but no other modifications were made.

EDIT: I also tried with a build from this latest commit, same issue: 8754e17

@libinta
Copy link

libinta commented Dec 9, 2024

@rvoleti89 thanks for reporting the issue. We can reproduce it with the sha1 id you mentioned. In vllm upstream v0.6.4.post1 , the embedding task is using embedding_model_runner.py to handle it. The vllm-fork hpu_model_runner.py is missing embedding task handle. We will find a solution to support it, and keep you updated.

@rvoleti89
Copy link
Author

@libinta thank you for your responsiveness regarding this issue. I look forward to future updates regarding embedding support and take a look at the v0.6.4.post1 implementation upstream to see if there's something I can do in the meantime to find a workaround.

@rvoleti89
Copy link
Author

@rvoleti89 thanks for reporting the issue. We can reproduce it with the sha1 id you mentioned. In vllm upstream v0.6.4.post1 , the embedding task is using embedding_model_runner.py to handle it. The vllm-fork hpu_model_runner.py is missing embedding task handle. We will find a solution to support it, and keep you updated.

@libinta Is there any update on embeddings model support in vLLM for Gaudi? Since I opened this issue, an official vllm-fork release v0.6.4.post2+Gaudi-1.19.0 was made, but this requires Habana runtime 1.19.0. As far as I could tell, embeddings models are still not supported.

Will future support for embeddings require 1.19.0, or can we expect it on 1.18.0 also? Is there some sort of timeline for this?

Much appreciated. Thanks!

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

3 participants