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

[Usage]: vllm: error: unrecognized arguments: --lora-path #13669

Open
1 task done
imrankh46 opened this issue Feb 21, 2025 · 11 comments
Open
1 task done

[Usage]: vllm: error: unrecognized arguments: --lora-path #13669

imrankh46 opened this issue Feb 21, 2025 · 11 comments
Assignees
Labels
usage How to use vllm

Comments

@imrankh46
Copy link

Your current environment

INFO 02-21 12:37:49 __init__.py:207] Automatically detected platform cuda.
Collecting environment information...
PyTorch version: 2.5.1+cu124
Is debug build: False
CUDA used to build PyTorch: 12.4
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.3 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.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.4.0-167-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.8.89
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: NVIDIA A40
GPU 1: NVIDIA A40

Nvidia driver version: 565.57.01
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:                      52 bits physical, 57 bits virtual
Byte Order:                         Little Endian
CPU(s):                             96
On-line CPU(s) list:                0-95
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Xeon(R) Gold 6342 CPU @ 2.80GHz
CPU family:                         6
Model:                              106
Thread(s) per core:                 2
Core(s) per socket:                 24
Socket(s):                          2
Stepping:                           6
Frequency boost:                    enabled
CPU max MHz:                        2801.0000
CPU min MHz:                        800.0000
BogoMIPS:                           5600.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 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
Virtualization:                     VT-x
L1d cache:                          2.3 MiB (48 instances)
L1i cache:                          1.5 MiB (48 instances)
L2 cache:                           60 MiB (48 instances)
L3 cache:                           72 MiB (2 instances)
NUMA node(s):                       2
NUMA node0 CPU(s):                  0-23,48-71
NUMA node1 CPU(s):                  24-47,72-95
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

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.4.5.8
[pip3] nvidia-cuda-cupti-cu12==12.4.127
[pip3] nvidia-cuda-nvrtc-cu12==12.4.127
[pip3] nvidia-cuda-runtime-cu12==12.4.127
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.2.1.3
[pip3] nvidia-curand-cu12==10.3.5.147
[pip3] nvidia-cusolver-cu12==11.6.1.9
[pip3] nvidia-cusparse-cu12==12.3.1.170
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.4.127
[pip3] nvidia-nvtx-cu12==12.4.127
[pip3] pyzmq==26.2.1
[pip3] torch==2.5.1
[pip3] torchaudio==2.5.1
[pip3] torchvision==0.20.1
[pip3] transformers==4.49.0
[pip3] triton==3.1.0
[conda] Could not collect
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.7.3
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0	GPU1	NIC0	NIC1	CPU Affinity	NUMA Affinity	GPU NUMA ID
GPU0	 X 	SYS	SYS	SYS	0-23,48-71	0		N/A
GPU1	SYS	 X 	NODE	NODE	24-47,72-95	1		N/A
NIC0	SYS	NODE	 X 	PIX				
NIC1	SYS	NODE	PIX	 X 				

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

NIC Legend:

  NIC0: mlx5_0
  NIC1: mlx5_1

NVIDIA_VISIBLE_DEVICES=GPU-520102db-6a65-ae07-66a2-6fedfc6e3e76,GPU-4d31c51c-a1c8-04ca-277a-d59c3f2ab377
NVIDIA_REQUIRE_CUDA=cuda>=11.8 brand=tesla,driver>=450,driver<451 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>=510,driver<511 brand=unknown,driver>=510,driver<511 brand=nvidia,driver>=510,driver<511 brand=nvidiartx,driver>=510,driver<511 brand=geforce,driver>=510,driver<511 brand=geforcertx,driver>=510,driver<511 brand=quadro,driver>=510,driver<511 brand=quadrortx,driver>=510,driver<511 brand=titan,driver>=510,driver<511 brand=titanrtx,driver>=510,driver<511 brand=tesla,driver>=515,driver<516 brand=unknown,driver>=515,driver<516 brand=nvidia,driver>=515,driver<516 brand=nvidiartx,driver>=515,driver<516 brand=geforce,driver>=515,driver<516 brand=geforcertx,driver>=515,driver<516 brand=quadro,driver>=515,driver<516 brand=quadrortx,driver>=515,driver<516 brand=titan,driver>=515,driver<516 brand=titanrtx,driver>=515,driver<516
NCCL_VERSION=2.15.5-1
NVIDIA_DRIVER_CAPABILITIES=compute,display,graphics,utility,video
NVIDIA_PRODUCT_NAME=CUDA
CUDA_VERSION=11.8.0
LD_LIBRARY_PATH=/usr/local/lib/python3.10/dist-packages/cv2/../../lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64
VLLM_USE_V1=1
NCCL_CUMEM_ENABLE=0
TORCHINDUCTOR_COMPILE_THREADS=1
CUDA_MODULE_LOADING=LAZY

How would you like to use vllm

i am using vllm version 0.7.3 and it have already support for lora but it's showing the following error.

import os
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
os.environ["VLLM_USE_V1"] = "1"

import subprocess

command = (
    "nohup vllm serve Qwen/Qwen2.5-32B-Instruct --dtype auto --api-key token-abc12 "
    "--tensor-parallel-size 2 --max_model_len 2000 --gpu-memory-utilization 0.9 "
    "--max-loras 1 --max-lora-rank 128 --enable-lora --lora-path yard1/llama-2-7b-sql-lora-test "
    "> log.txt 2>&1 &"
)

subprocess.Popen(command, shell=True)

it showing the following error.
vllm: error: unrecognized arguments: --lora-path yard1/llama-2-7b-sql-lora-test

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.
@imrankh46 imrankh46 added the usage How to use vllm label Feb 21, 2025
@DarkLight1337
Copy link
Member

According to the docs, you should use --lora-modules, not --lora-path.

@varun-sundar-rabindranath
Copy link
Contributor

@imrankh46 - like @DarkLight1337 mentioned, try replacing --lora-path yard1/llama-2-7b-sql-lora-test with --lora-modules some_name=yard1/llama-2-7b-sql-lora-test

@imrankh46
Copy link
Author

@varun-sundar-rabindranath showing the following error
ValueError: Call to add_lora method failed: vLLM only supports modules_to_save being None.

@imrankh46
Copy link
Author

@varun-sundar-rabindranath how did you serve lora adapter?

@imrankh46
Copy link
Author

oh apologize. vllm not supporting modules_to_save. can you add support for it on the fly...

"modules_to_save": [
   "lm_head",
   "embed_tokens"
  ],

@varun-sundar-rabindranath
Copy link
Contributor

@imrankh46 - I'll take a look. cc'ing @DarkLight1337 @jeejeelee .

@varun-sundar-rabindranath
Copy link
Contributor

Hi @imrankh46 .

I am unfamiliar with modules_to_save.

As far as I understand, modules_to_save is used during training (from here link ).
I also see that in https://huggingface.co/yard1/llama-2-7b-sql-lora-test/blob/main/adapter_config.json , embed_tokens and lm_head are part of the target modules. Can you try removing modules_to_save from adapter_config.json and adding them to target_modules.

Please correct me if the suggestion is non-sensical. Also, I believe you are using a different LoRA adapter (not yard1/llama-2-7b-sql-lora-test), can you share some commands so I can repro and try things for myself. Thanks.

@imrankh46
Copy link
Author

@varun-sundar-rabindranath I am using a different adapter. When we add different tokens to the tokenizer, such as <pad>, <eos>, etc., we need to save modules_to_save, such as embed_tokens and lm_head. Otherwise, the model will repeat the answer.

@imrankh46
Copy link
Author

@varun-sundar-rabindranath also suggest by trl team
If the chat template contains special tokens like <|im_start|> (ChatML) or <|eot_id|> (Llama), the embedding layer and LM head must be included in the trainable parameters via the modules_to_save argument. Without this, the fine-tuned model will produce unbounded or nonsense generations. If the chat template doesn’t contain special tokens (e.g. Alpaca), then the modules_to_save argument can be ignored or set to None.

read the following
https://huggingface.co/docs/trl/v0.15.1/sft_trainer

@varun-sundar-rabindranath
Copy link
Contributor

I see. I think I understand the issue a bit better now.
target_modules points at the modules for which LoRA adapters are to be added.
modules_to_save simply marks entire modules as trainable, and stores the trained weights during fine-tuned model checkpoint save.

yard1/llama-2-7b-sql-lora-test has LoRA adapters for lm_head and embed_tokens. vLLM has support for treating the lm_head and embed_tokens modules as LoRA layers (

class VocabParallelEmbeddingWithLoRA(BaseLayerWithLoRA):
,
class LogitsProcessorWithLoRA(BaseLayerWithLoRA):
) . But doesn't support replacing it entirely.

@jeejeelee @DarkLight1337 , looks like we could potentially handle this at the lora/layer.py level. What do you think ?

@jeejeelee
Copy link
Collaborator

@varun-sundar-rabindranath showing the following error ValueError: Call to add_lora method failed: vLLM only supports modules_to_save being None.

See: #11714

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage How to use vllm
Projects
None yet
Development

No branches or pull requests

4 participants