vllm: [Bug]: DeepseekR1 model load fails with weights tied error
Your current environment
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.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.11 (main, Dec 4 2024, 08:55:07) [GCC 11.4.0] (64-bit runtime) Python platform: Linux-5.10.230-223.885.amzn2.x86_64-x86_64-with-glibc2.35 Is CUDA available: True CUDA runtime version: 12.4.131 CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA H100 80GB HBM3 GPU 1: NVIDIA H100 80GB HBM3 GPU 2: NVIDIA H100 80GB HBM3 GPU 3: NVIDIA H100 80GB HBM3 GPU 4: NVIDIA H100 80GB HBM3 GPU 5: NVIDIA H100 80GB HBM3 GPU 6: NVIDIA H100 80GB HBM3 GPU 7: NVIDIA H100 80GB HBM3
Nvidia driver version: 550.144.03 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): 192 On-line CPU(s) list: 0-191 Vendor ID: AuthenticAMD Model name: AMD EPYC 7R13 Processor CPU family: 25 Model: 1 Thread(s) per core: 2 Core(s) per socket: 48 Socket(s): 2 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 monitor 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 perfctr_core 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: 3 MiB (96 instances) L1i cache: 3 MiB (96 instances) L2 cache: 48 MiB (96 instances) L3 cache: 384 MiB (12 instances) NUMA node(s): 2 NUMA node0 CPU(s): 0-47,96-143 NUMA node1 CPU(s): 48-95,144-191 Vulnerability Gather data sampling: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Mitigation; safe RET, no microcode 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+cu124torch2.4 [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-ml-py==12.560.30 [pip3] nvidia-nccl-cu12==2.21.5 [pip3] nvidia-nvjitlink-cu12==12.4.127 [pip3] nvidia-nvtx-cu12==12.4.127 [pip3] onnx==1.17.0 [pip3] onnxruntime==1.20.1 [pip3] pyzmq==26.2.0 [pip3] sentence-transformers==3.3.1 [pip3] torch==2.5.1+cu124 [pip3] torchvision==0.20.1+cu124 [pip3] transformers==4.45.2 [pip3] triton==3.1.0 [conda] Could not collect ROCM Version: Could not collect Neuron SDK Version: N/A vLLM Version: 0.7.0 vLLM Build Flags: CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled GPU Topology: GPU0 GPU1 GPU2 GPU3 GPU4 GPU5 GPU6 GPU7 CPU Affinity NUMA Affinity GPU NUMA ID GPU0 X NV18 NV18 NV18 NV18 NV18 NV18 NV18 0-47,96-143 0 N/A GPU1 NV18 X NV18 NV18 NV18 NV18 NV18 NV18 0-47,96-143 0 N/A GPU2 NV18 NV18 X NV18 NV18 NV18 NV18 NV18 0-47,96-143 0 N/A GPU3 NV18 NV18 NV18 X NV18 NV18 NV18 NV18 0-47,96-143 0 N/A GPU4 NV18 NV18 NV18 NV18 X NV18 NV18 NV18 48-95,144-191 1 N/A GPU5 NV18 NV18 NV18 NV18 NV18 X NV18 NV18 48-95,144-191 1 N/A GPU6 NV18 NV18 NV18 NV18 NV18 NV18 X NV18 48-95,144-191 1 N/A GPU7 NV18 NV18 NV18 NV18 NV18 NV18 NV18 X 48-95,144-191 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
PYTORCH_LIBRARY_PATH=/usr/local/lib/python3.11/dist-packages/torch/lib NVIDIA_VISIBLE_DEVICES=all PYTORCH_PRECXX11=true 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 NCCL_VERSION=2.21.5-1 NVIDIA_DRIVER_CAPABILITIES=compute,utility VLLM_WORKER_MULTIPROC_METHOD=spawn NVIDIA_PRODUCT_NAME=CUDA TORCH_NCCL_BLOCKING_WAIT=0 CUDA_VERSION=12.4.1 PYTORCH_FLAVOR=cu124-precxx11 PYTORCH_VERSION=2.5.1 PYTORCH_KERNEL_CACHE_PATH=/tmp/.cache TORCH_NCCL_ASYNC_ERROR_HANDLING=1 TORCH_NCCL_AVOID_RECORD_STREAMS=1 LD_LIBRARY_PATH=/usr/local/lib/python3.11/dist-packages/cv2/…/…/lib64:/usr/local/lib/python3.11/dist-packages/nvidia/cudnn/lib/ VLLM_NO_USAGE_STATS=1 NCCL_CUMEM_ENABLE=0 TORCHINDUCTOR_COMPILE_THREADS=1 CUDA_MODULE_LOADING=LAZY
Model Input Dumps
No response
🐛 Describe the bug
Below model load code fails with tied model weights error while loading deepseekR1 model weights- https://huggingface.co/deepseek-ai/DeepSeek-R1
model = LLM("/deepseekR1/model_weights", tensor_parallel_size=8, cpu_offload_gb=10, trust_remote_code=True)
Error stacktrace -
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] Traceback (most recent call last):
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] File "/usr/local/lib/python3.11/dist-packages/vllm/executor/multiproc_worker_utils.py", line 234, in _run_worker_process
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] output = run_method(worker, method, args, kwargs)
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] File "/usr/local/lib/python3.11/dist-packages/vllm/utils.py", line 2208, in run_method
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] return func(*args, **kwargs)
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] ^^^^^^^^^^^^^^^^^^^^^
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] File "/usr/local/lib/python3.11/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] return func(*args, **kwargs)
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] ^^^^^^^^^^^^^^^^^^^^^
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] File "/usr/local/lib/python3.11/dist-packages/vllm/worker/worker.py", line 228, in determine_num_available_blocks
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] self.model_runner.profile_run()
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] File "/usr/local/lib/python3.11/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] return func(*args, **kwargs)
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] ^^^^^^^^^^^^^^^^^^^^^
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] File "/usr/local/lib/python3.11/dist-packages/vllm/worker/model_runner.py", line 1235, in profile_run
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] self._dummy_run(max_num_batched_tokens, max_num_seqs)
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] File "/usr/local/lib/python3.11/dist-packages/vllm/worker/model_runner.py", line 1346, in _dummy_run
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] self.execute_model(model_input, kv_caches, intermediate_tensors)
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] File "/usr/local/lib/python3.11/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] return func(*args, **kwargs)
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] ^^^^^^^^^^^^^^^^^^^^^
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] File "/usr/local/lib/python3.11/dist-packages/vllm/worker/model_runner_base.py", line 152, in _wrapper
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] raise type(err)(
INFO PyProcess W-5226-model_code-stdout: (VllmWorkerProcess pid=5246) ERROR 01-29 09:20:28 multiproc_worker_utils.py:240] ValueError: Error in model execution (input dumped to /tmp/err_execute_model_input_20250129-092028.pkl): functional_call got multiple values for keys ['mlp.experts.e_score_correction_bias', 'mlp.gate.e_score_correction_bias'], which are tied. Consider using tie_weights=False
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.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 27 (4 by maintainers)
@cennn is investigating, thanks for your patience.
Same here, fail to serve a DeepSeek-R1 model on 8xH100 80G with cpu_offload_gb option.
Hey everyone, I’d really appreciate it if you could take a look at this PR to see if it solves the problem. https://github.com/vllm-project/vllm/pull/13335
@chuanzhubin I didn’t run into that error when running my code.
It seems to me you’re using the master branch, while I’m running version 0.7.2. Also, I see that you’ve instantiated the server; in my case, I’m using vLLM as a library.
It might be due to offloading leaving a layer on the CPU when it was expected to be on the GPU. Triton is expecting a pointer to GPU memory but is instead receiving a pointer associated with a CPU tensor.
Hey! Thanks for the patch! Unfortunately, I tried it with 8 H100 80GB GPUs and while I can load the model correctly, when I use the
model.generate([prompt], sampling_params)function I still get an error about devices mismatching 😦Does --swap-space work?