Repository navigation
Closed
Description
here is the summary:
unsloth/mistral-7b-v0.3-bnb-4bit with error : KeyError: 'layers.0.mlp.down_proj.weight'
unsloth/Qwen2.5-7B-Instruct-bnb-4bit with error: KeyError: 'layers.0.mlp.down_proj.weight'
unsloth/Llama-3.2-1B-Instruct-bnb-4bit with error: KeyError: 'layers.0.mlp.down_proj.weight'
here is the code:
from vllm import LLM, SamplingParams
llm = LLM(model= args.llm_name,
dtype='float16',
#max_model_len = max_len,
tensor_parallel_size= torch.cuda.device_count(),
gpu_memory_utilization= args.gpu_memory_utilization,
#seed=None,
trust_remote_code=True,
quantization=None,
load_format="auto",
enforce_eager=True,
enable_lora=True if args.sft_path else False,
tokenizer_mode= "mistral" if args.llm_name.startswith('mistralai') else 'auto'
) here is the environment info:
WARNING 11-08 15:57:45 _custom_ops.py:19] Failed to import from vllm._C with ModuleNotFoundError("No module named 'vllm._C'")
/home/yanan/vllm/vllm/connections.py:8: RuntimeWarning: Failed to read commit hash:
No module named 'vllm._version'
from vllm.version import __version__ as VLLM_VERSION
Collecting environment information...
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.5 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.11.10 (main, Oct 3 2024, 07:29:13) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.8.0-48-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.5.119
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: Quadro RTX 4000
GPU 1: Quadro RTX 4000
GPU 2: Quadro RTX 4000
GPU 3: Quadro RTX 4000
Nvidia driver version: 535.183.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
架构: x86_64
CPU 运行模式: 32-bit, 64-bit
Address sizes: 46 bits physical, 48 bits virtual
字节序: Little Endian
CPU: 32
在线 CPU 列表: 0-31
厂商 ID: GenuineIntel
型号名称: Intel(R) Xeon(R) Silver 4208 CPU @ 2.10GHz
CPU 系列: 6
型号: 85
每个核的线程数: 2
每个座的核数: 8
座: 2
步进: 7
CPU 最大 MHz: 3200.0000
CPU 最小 MHz: 800.0000
BogoMIPS: 4200.00
标记: 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 cdp_l3 intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req vnmi pku ospke avx512_vnni md_clear flush_l1d arch_capabilities
虚拟化: VT-x
L1d 缓存: 512 KiB (16 instances)
L1i 缓存: 512 KiB (16 instances)
L2 缓存: 16 MiB (16 instances)
L3 缓存: 22 MiB (2 instances)
NUMA 节点: 2
NUMA 节点0 CPU: 0-7,16-23
NUMA 节点1 CPU: 8-15,24-31
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
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: Mitigation; Enhanced IBRS
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 / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI SW loop, KVM SW loop
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Mitigation; TSX disabled
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.46.1
[pip3] triton==3.0.0
[conda] flashinfer 0.1.6+cu121torch2.4 pypi_0 pypi
[conda] numpy 1.26.4 pypi_0 pypi
[conda] nvidia-cublas-cu12 12.1.3.1 pypi_0 pypi
[conda] nvidia-cuda-cupti-cu12 12.1.105 pypi_0 pypi
[conda] nvidia-cuda-nvrtc-cu12 12.1.105 pypi_0 pypi
[conda] nvidia-cuda-runtime-cu12 12.1.105 pypi_0 pypi
[conda] nvidia-cudnn-cu12 9.1.0.70 pypi_0 pypi
[conda] nvidia-cufft-cu12 11.0.2.54 pypi_0 pypi
[conda] nvidia-curand-cu12 10.3.2.106 pypi_0 pypi
[conda] nvidia-cusolver-cu12 11.4.5.107 pypi_0 pypi
[conda] nvidia-cusparse-cu12 12.1.0.106 pypi_0 pypi
[conda] nvidia-ml-py 12.560.30 pypi_0 pypi
[conda] nvidia-nccl-cu12 2.20.5 pypi_0 pypi
[conda] nvidia-nvjitlink-cu12 12.6.77 pypi_0 pypi
[conda] nvidia-nvtx-cu12 12.1.105 pypi_0 pypi
[conda] pyzmq 26.2.0 pypi_0 pypi
[conda] torch 2.4.0 pypi_0 pypi
[conda] torchvision 0.19.0 pypi_0 pypi
[conda] transformers 4.46.1 pypi_0 pypi
[conda] triton 3.0.0 pypi_0 pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: N/A (dev)
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0 GPU1 GPU2 GPU3 CPU Affinity NUMA Affinity GPU NUMA ID
GPU0 X NODE SYS SYS 0-7,16-23 0 N/A
GPU1 NODE X SYS SYS 0-7,16-23 0 N/A
GPU2 SYS SYS X NODE 8-15,24-31 1 N/A
GPU3 SYS SYS NODE X 8-15,24-31 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
LD_LIBRARY_PATH=/home/yanan/anaconda3/envs/vllm/lib/python3.11/site-packages/cv2/../../lib64:
CUDA_MODULE_LOADING=LAZY
Reacted by Sam Stoelinga
Metadata
Metadata
Assignees
Labels
No labels
Activity
yanan1116 commentedon Nov 8, 2024
models such as
unsloth/Qwen2.5-7B-Instructwhich does not have-bnb-4bitseems works fine.may I know the reason ?
yanan1116 commentedon Nov 8, 2024
i do see vllm support
bitsandbytesforunsloth/tinyllama-bnb-4bitas shown herehttps://docs.vllm.ai/en/stable/quantization/bnb.html
JJEccles commentedon Nov 10, 2024
I have also encountered this issue. As I'm trying to run the Lora adapter plus base model (unsloth/Qwen2.5-7B-bnb-4bit) but it seems to not work. I was led to believe vLLM was the way to go for multi Lora on small models.
yanan1116 commentedon Nov 10, 2024
should I always set
quantization="bitsandbytes", load_format="bitsandbytes"when loadingbnb-4bitmodels ?as suggested in https://docs.vllm.ai/en/stable/quantization/bnb.html ?
danielhanchen commentedon Nov 11, 2024
Yes for bitsandbytes models, use
yanan1116 commentedon Nov 11, 2024
@danielhanchen hi , i have to reopen this issue.
llms such as
unsloth/Phi-3.5-mini-instruct-bnb-4bitunsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bitunsloth/Llama-3.2-3B-Instruct-bnb-4bitworks fine.but
unsloth/Qwen2.5-7B-Instruct-bnb-4bitdoes not work with the same code.the error message:
'''
[rank0]: AttributeError: Model Qwen2ForCausalLM does not support BitsAndBytes quantization yet.
'''
could you take a look at it ? thank.s
yanan1116 commentedon Nov 11, 2024
JJEccles commentedon Nov 12, 2024
Yes I always get this issue also on the Qwen models. It's also present on the unsloth/Qwen2.5-3B-bnb-4bit version as well as the 7B.
Can confirm the error across all the Qwen models when trying to run inference on vllm:
"AttributeError: Model Qwen2ForCausalLM does not support BitsAndBytes quantization yet."
I'm assuming since I'm working from a fresh install of: "pip install vllm"
That I'm using the same version. Currently I've had to switch to the the "unsloth/Llama-3.2-3B-bnb-4bit" model as I couldn't find a fix. If anyone finds a way to get it to work please let me know! I'd love to be able to switch back to the fine tuned LORA on top of the 4bit Qwen 2.5 base model.
yanan1116 commentedon Nov 12, 2024
@JJEccles maybe you can use original model
Qwen/Qwen2.5-7B-Instructand setquantization='bitsandbytes', which should work fine, and perhaps it is equal to usingunsloth/Qwen2.5-7B-Instruct@danielhanchen correct me if i am wrong.
JJEccles commentedon Nov 12, 2024
I will look into it, Thanks!
marcelodiaz558 commentedon Nov 15, 2024
@yananchen1989 @JJEccles BitsAndBytes Qwen2.5 models are not supported on the latest vLLM release (v0.6.3.post1) as of today. However, they will function correctly once a new version is released. You can refer to this already-merged pull request.
If you want to use BitsAndBytes with Qwen2.5 immediately, you can install the latest vLLM version using the following command:
I have tested both Qwen2.5 7B Instruct and Qwen 14B Instruct with BNB quantization, and they worked correctly.
If you're using the Docker
vllm-openaiimage, note that the latest version of the image doesn't yet include the Qwen2.5 BNB compatibility changes. However, you can use the image I built 15 days ago, which already includes the required changes. You can find it here: Docker Hub.nkumar15 commentedon Jan 7, 2025
@danielhanchen similar issue I am facing with llama3.2 vision instruct model. have opened issue in vllm here. The expected weights shape are not matching with loaded weights.
vllm-project/vllm#11765
I have fintuned using unsloth 2025.1.1 and vllm 0.6.6
rolandtannous commentedon Jun 29, 2025
This should work now if you install your environment from scratch as follows:
Will close this as complete for now.
Feel free to comment back with details if you are still having this particular issue.
Thank you for using unsloth
Studio: fix two staging-CI regressions in this branch
fix(studio): enforce Hub token caller boundary (#10076)