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]: Not able to run LLama3 LoRA with --fully-sharded-loras #10342

Open
1 task done
xyang16 opened this issue Nov 14, 2024 · 0 comments
Open
1 task done

[Bug]: Not able to run LLama3 LoRA with --fully-sharded-loras #10342

xyang16 opened this issue Nov 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@xyang16
Copy link
Contributor

xyang16 commented Nov 14, 2024

Your current environment

The output of `python collect_env.py`
PyTorch version: 2.4.0+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: Could not collect
Libc version: glibc-2.35

Python version: 3.12.7 (main, Oct  1 2024, 08:52:12) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-1038-aws-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: NVIDIA L4
GPU 1: NVIDIA L4
GPU 2: NVIDIA L4
GPU 3: NVIDIA L4

Nvidia driver version: 525.85.12
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:                   48 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          48
On-line CPU(s) list:             0-47
Vendor ID:                       AuthenticAMD
Model name:                      AMD EPYC 7R13 Processor
CPU family:                      25
Model:                           1
Thread(s) per core:              2
Core(s) per socket:              24
Socket(s):                       1
Stepping:                        1
BogoMIPS:                        5300.00
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:                       768 KiB (24 instances)
L1i cache:                       768 KiB (24 instances)
L2 cache:                        12 MiB (24 instances)
L3 cache:                        96 MiB (3 instances)
NUMA node(s):                    1
NUMA node0 CPU(s):               0-47
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] flashinfer==0.1.6+cu121torch2.4
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.1.3.1
[pip3] nvidia-cuda-cupti-cu12==12.1.105
[pip3] nvidia-cuda-nvrtc-cu12==12.1.105
[pip3] nvidia-cuda-runtime-cu12==12.1.105
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.0.2.54
[pip3] nvidia-curand-cu12==10.3.2.106
[pip3] nvidia-cusolver-cu12==11.4.5.107
[pip3] nvidia-cusparse-cu12==12.1.0.106
[pip3] nvidia-ml-py==12.560.30
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] nvidia-nvjitlink-cu12==12.6.77
[pip3] nvidia-nvtx-cu12==12.1.105
[pip3] pyzmq==26.2.0
[pip3] torch==2.4.0
[pip3] torchvision==0.19.0
[pip3] transformers==4.45.2
[pip3] triton==3.0.0
[conda] Could not collect
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.6.3.post1
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0	GPU1	GPU2	GPU3	CPU Affinity	NUMA Affinity
GPU0	 X 	SYS	SYS	SYS	0-47		N/A
GPU1	SYS	 X 	SYS	SYS	0-47		N/A
GPU2	SYS	SYS	 X 	SYS	0-47		N/A
GPU3	SYS	SYS	SYS	 X 	0-47		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

NVIDIA_VISIBLE_DEVICES=all
NVIDIA_REQUIRE_CUDA=cuda>=12.4 brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 brand=tesla,driver>=525,driver<526 brand=unknown,driver>=525,driver<526 brand=nvidia,driver>=525,driver<526 brand=nvidiartx,driver>=525,driver<526 brand=geforce,driver>=525,driver<526 brand=geforcertx,driver>=525,driver<526 brand=quadro,driver>=525,driver<526 brand=quadrortx,driver>=525,driver<526 brand=titan,driver>=525,driver<526 brand=titanrtx,driver>=525,driver<526 brand=tesla,driver>=535,driver<536 brand=unknown,driver>=535,driver<536 brand=nvidia,driver>=535,driver<536 brand=nvidiartx,driver>=535,driver<536 brand=geforce,driver>=535,driver<536 brand=geforcertx,driver>=535,driver<536 brand=quadro,driver>=535,driver<536 brand=quadrortx,driver>=535,driver<536 brand=titan,driver>=535,driver<536 brand=titanrtx,driver>=535,driver<536
NVIDIA_DRIVER_CAPABILITIES=compute,utility
VLLM_USAGE_SOURCE=production-docker-image
CUDA_VERSION=12.4.1
LD_LIBRARY_PATH=/usr/local/lib/python3.12/dist-packages/cv2/../../lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64
CUDA_MODULE_LOADING=LAZY

Model Input Dumps

No response

🐛 Describe the bug

I got the following error when running LoRA: RuntimeError('Error in model execution: The size of tensor a (16) must match the size of tensor b (64) at non-singleton dimension 0')

Steps to reproduce:

I followed the steps in https://github.com/vllm-project/vllm/blob/main/docs/source/models/lora.rst

from huggingface_hub import snapshot_download
snapshot_download(repo_id="UnderstandLing/Llama-3-8B-Instruct-fr")
vllm serve unsloth/llama-3-8b-Instruct \
    --tensor-parallel-size 4 \
    --enable-lora \
    --lora-modules french=/tmp/.cache/huggingface/hub/models--UnderstandLing--Llama-3-8B-Instruct-fr/snapshots/0752aa9d84072112b0e59daac788bf9d8a942e50 \
    --max-lora-rank 64 \
    --fully-sharded-loras

Request:

curl http://localhost:8000/v1/completions \
    -H "Content-Type: application/json" \
    -d '{
        "model": "french",
        "prompt": "San Francisco is a",
        "max_tokens": 32,
        "temperature": 0
    }'

Stacktrace:

ERROR 11-14 13:38:14 engine.py:158] Traceback (most recent call last):
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/worker/model_runner_base.py", line 116, in _wrapper
ERROR 11-14 13:38:14 engine.py:158]     return func(*args, **kwargs)
ERROR 11-14 13:38:14 engine.py:158]            ^^^^^^^^^^^^^^^^^^^^^
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/worker/model_runner.py", line 1619, in execute_model
ERROR 11-14 13:38:14 engine.py:158]     self.set_active_loras(model_input.lora_requests,
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/worker/model_runner.py", line 1318, in set_active_loras
ERROR 11-14 13:38:14 engine.py:158]     self.lora_manager.set_active_adapters(lora_requests, lora_mapping)
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/lora/worker_manager.py", line 136, in set_active_adapters
ERROR 11-14 13:38:14 engine.py:158]     set_active_adapters_worker(requests, mapping, self._apply_adapters,
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/adapter_commons/utils.py", line 52, in set_active_adapters_worker
ERROR 11-14 13:38:14 engine.py:158]     apply_adapters_func(requests)
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/lora/worker_manager.py", line 195, in _apply_adapters
ERROR 11-14 13:38:14 engine.py:158]     self.add_adapter(lora)
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/lora/worker_manager.py", line 211, in add_adapter
ERROR 11-14 13:38:14 engine.py:158]     self._adapter_manager.activate_adapter(lora_request.lora_int_id)
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/lora/models.py", line 697, in activate_adapter
ERROR 11-14 13:38:14 engine.py:158]     result = super().activate_adapter(lora_id)
ERROR 11-14 13:38:14 engine.py:158]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/lora/models.py", line 387, in activate_adapter
ERROR 11-14 13:38:14 engine.py:158]     module.set_lora(index, module_lora.lora_a, module_lora.lora_b,
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/lora/layers.py", line 851, in set_lora
ERROR 11-14 13:38:14 engine.py:158]     index, 0, :lora_a[0].shape[1], :lora_a[0].shape[0]].copy_(
ERROR 11-14 13:38:14 engine.py:158]                                                         ^^^^^^
ERROR 11-14 13:38:14 engine.py:158] RuntimeError: The size of tensor a (16) must match the size of tensor b (64) at non-singleton dimension 0
ERROR 11-14 13:38:14 engine.py:158] 
ERROR 11-14 13:38:14 engine.py:158] The above exception was the direct cause of the following exception:
ERROR 11-14 13:38:14 engine.py:158] 
ERROR 11-14 13:38:14 engine.py:158] Traceback (most recent call last):
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/engine/multiprocessing/engine.py", line 156, in start
ERROR 11-14 13:38:14 engine.py:158]     self.run_engine_loop()
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/engine/multiprocessing/engine.py", line 219, in run_engine_loop
ERROR 11-14 13:38:14 engine.py:158]     request_outputs = self.engine_step()
ERROR 11-14 13:38:14 engine.py:158]                       ^^^^^^^^^^^^^^^^^^
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/engine/multiprocessing/engine.py", line 237, in engine_step
ERROR 11-14 13:38:14 engine.py:158]     raise e
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/engine/multiprocessing/engine.py", line 228, in engine_step
ERROR 11-14 13:38:14 engine.py:158]     return self.engine.step()
ERROR 11-14 13:38:14 engine.py:158]            ^^^^^^^^^^^^^^^^^^
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/engine/llm_engine.py", line 1389, in step
ERROR 11-14 13:38:14 engine.py:158]     outputs = self.model_executor.execute_model(
ERROR 11-14 13:38:14 engine.py:158]               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/executor/distributed_gpu_executor.py", line 82, in execute_model
ERROR 11-14 13:38:14 engine.py:158]     driver_outputs = self._driver_execute_model(execute_model_req)
ERROR 11-14 13:38:14 engine.py:158]                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/executor/multiproc_gpu_executor.py", line 155, in _driver_execute_model
ERROR 11-14 13:38:14 engine.py:158]     return self.driver_worker.execute_model(execute_model_req)
ERROR 11-14 13:38:14 engine.py:158]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/worker/worker_base.py", line 327, in execute_model
ERROR 11-14 13:38:14 engine.py:158]     output = self.model_runner.execute_model(
ERROR 11-14 13:38:14 engine.py:158]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context
ERROR 11-14 13:38:14 engine.py:158]     return func(*args, **kwargs)
ERROR 11-14 13:38:14 engine.py:158]            ^^^^^^^^^^^^^^^^^^^^^
ERROR 11-14 13:38:14 engine.py:158]   File "/usr/local/lib/python3.12/dist-packages/vllm/worker/model_runner_base.py", line 146, in _wrapper
ERROR 11-14 13:38:14 engine.py:158]     raise type(err)(f"Error in model execution: "
ERROR 11-14 13:38:14 engine.py:158] RuntimeError: Error in model execution: The size of tensor a (16) must match the size of tensor b (64) at non-singleton dimension 0

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.
@xyang16 xyang16 added the bug Something isn't working label Nov 14, 2024
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