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]: DeepSeek-Coder-V2-Instruct-AWQ assert self.quant_method is not None #7494

Open
fengyang95 opened this issue Aug 14, 2024 · 19 comments
Open
Labels
bug Something isn't working

Comments

@fengyang95
Copy link

Your current environment

The output of `python collect_env.py`
```text
ollecting environment information...
PyTorch version: 2.3.1+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Debian GNU/Linux 11 (bullseye) (x86_64)
GCC version: (Debian 10.2.1-6) 10.2.1 20210110
Clang version: Could not collect
CMake version: version 3.30.2
Libc version: glibc-2.31

Python version: 3.9.2 (default, Feb 28 2021, 17:03:44)  [GCC 10.2.1 20210110] (64-bit runtime)
Python platform: Linux-5.4.143.bsk.8-amd64-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 12.1.105
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: NVIDIA L40
GPU 1: NVIDIA L40
GPU 2: NVIDIA L40
GPU 3: NVIDIA L40
GPU 4: NVIDIA L40
GPU 5: NVIDIA L40
GPU 6: NVIDIA L40
GPU 7: NVIDIA L40

Nvidia driver version: Could not collect
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.0
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
Byte Order:                      Little Endian
Address sizes:                   52 bits physical, 57 bits virtual
CPU(s):                          180
On-line CPU(s) list:             0-179
Thread(s) per core:              2
Core(s) per socket:              45
Socket(s):                       2
NUMA node(s):                    2
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           143
Model name:                      Intel(R) Xeon(R) Platinum 8457C
Stepping:                        8
CPU MHz:                         2599.044
BogoMIPS:                        5198.08
Hypervisor vendor:               KVM
Virtualization type:             full
L1d cache:                       4.2 MiB
L1i cache:                       2.8 MiB
L2 cache:                        180 MiB
L3 cache:                        195 MiB
NUMA node0 CPU(s):               0-89
NUMA node1 CPU(s):               90-179
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          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
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; TSX disabled
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves avx512_bf16 wbnoinvd arat avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid cldemote movdiri movdir64b md_clear arch_capabilities

Versions of relevant libraries:
[pip3] byted-torch==2.1.0.post2
[pip3] flashinfer==0.0.8+cu121torch2.3
[pip3] numpy==1.26.2
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] pyzmq==26.1.0
[pip3] torch==2.3.1
[pip3] torchaudio==2.1.0+cu121
[pip3] torchvision==0.18.1
[pip3] transformers==4.44.0
[pip3] triton==2.3.1
[conda] Could not collect
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.5.3.post1@38c4b7e863570a045308af814c72f4504297222e
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    GPU1    GPU2    GPU3    GPU4    GPU5    GPU6    GPU7    NIC0    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      NODE    NODE    NODE    SYS     SYS     SYS     SYS     SYS     2-89    0               N/A
GPU1    NODE     X      NODE    NODE    SYS     SYS     SYS     SYS     SYS     2-89    0               N/A
GPU2    NODE    NODE     X      NODE    SYS     SYS     SYS     SYS     SYS     2-89    0               N/A
GPU3    NODE    NODE    NODE     X      SYS     SYS     SYS     SYS     SYS     2-89    0               N/A
GPU4    SYS     SYS     SYS     SYS      X      NODE    NODE    NODE    SYS     92-177  1               N/A
GPU5    SYS     SYS     SYS     SYS     NODE     X      NODE    NODE    SYS     92-177  1               N/A
GPU6    SYS     SYS     SYS     SYS     NODE    NODE     X      NODE    SYS     92-177  1               N/A
GPU7    SYS     SYS     SYS     SYS     NODE    NODE    NODE     X      SYS     92-177  1               N/A
NIC0    SYS     SYS     SYS     SYS     SYS     SYS     SYS     SYS      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

</details>


### 🐛 Describe the bug

Using the ds-coder-v2-awq [,](https://huggingface.co/casperhansen/deepseek-coder-v2-instruct-awq) the following error is reported.

Traceback (most recent call last):
[rank0]:   File "/opt/tiger/deepseek_http/vllm_server.py", line 134, in <module>
[rank0]:     engine = AsyncLLMEngine.from_engine_args(engine_args)
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/engine/async_llm_engine.py", line 466, in from_engine_args
[rank0]:     engine = cls(
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/engine/async_llm_engine.py", line 380, in __init__
[rank0]:     self.engine = self._init_engine(*args, **kwargs)
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/engine/async_llm_engine.py", line 547, in _init_engine
[rank0]:     return engine_class(*args, **kwargs)
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/engine/llm_engine.py", line 251, in __init__
[rank0]:     self.model_executor = executor_class(
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/executor/multiproc_gpu_executor.py", line 201, in __init__
[rank0]:     super().__init__(*args, **kwargs)
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/executor/distributed_gpu_executor.py", line 25, in __init__
[rank0]:     super().__init__(*args, **kwargs)
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/executor/executor_base.py", line 47, in __init__
[rank0]:     self._init_executor()
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/executor/multiproc_gpu_executor.py", line 124, in _init_executor
[rank0]:     self._run_workers("load_model",
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/executor/multiproc_gpu_executor.py", line 178, in _run_workers
[rank0]:     driver_worker_output = driver_worker_method(*args, **kwargs)
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/worker/worker.py", line 139, in load_model
[rank0]:     self.model_runner.load_model()
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/worker/model_runner.py", line 682, in load_model
[rank0]:     self.model = get_model(model_config=self.model_config,
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/model_executor/model_loader/__init__.py", line 21, in get_model
[rank0]:     return loader.load_model(model_config=model_config,
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/model_executor/model_loader/loader.py", line 280, in load_model
[rank0]:     model = _initialize_model(model_config, self.load_config,
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/model_executor/model_loader/loader.py", line 111, in _initialize_model
[rank0]:     return model_class(config=model_config.hf_config,
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/model_executor/models/deepseek_v2.py", line 439, in __init__
[rank0]:     self.model = DeepseekV2Model(config, cache_config, quant_config)
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/model_executor/models/deepseek_v2.py", line 401, in __init__
[rank0]:     self.layers = nn.ModuleList([
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/model_executor/models/deepseek_v2.py", line 402, in <listcomp>
[rank0]:     DeepseekV2DecoderLayer(config,
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/model_executor/models/deepseek_v2.py", line 341, in __init__
[rank0]:     self.mlp = DeepseekV2MoE(config=config, quant_config=quant_config)
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/model_executor/models/deepseek_v2.py", line 106, in __init__
[rank0]:     self.experts = FusedMoE(num_experts=config.n_routed_experts,
[rank0]:   File "/usr/local/lib/python3.9/dist-packages/vllm/model_executor/layers/fused_moe/layer.py", line 186, in __init__
[rank0]:     assert self.quant_method is not None
[rank0]: AssertionError
@fengyang95 fengyang95 added the bug Something isn't working label Aug 14, 2024
@fengyang95 fengyang95 changed the title [Bug]: [Bug]: DeepSeek-Coder-V2-Instruct-AWQ assert self.quant_method is not None Aug 14, 2024
@jeejeelee
Copy link
Collaborator

AWQ is not yet supported for this MOE Model

@fengyang95
Copy link
Author

AWQ is not yet supported for this MOE Model

Is there any plans to support it in the near future?

@jeejeelee
Copy link
Collaborator

cc @mgoin @robertgshaw2-neuralmagic

@robertgshaw2-redhat
Copy link
Collaborator

robertgshaw2-redhat commented Aug 14, 2024

yes we are almost done with it. I hope in v0.5.6 we will have it

@fengyang95
Copy link
Author

yes we are almost done with it. I hope in v0.5.6 we will have it

Once it is supported, can we deploy it on the L40? Currently, we only have L40 available.

@TheAhmadOsman
Copy link

yes we are almost done with it. I hope in v0.5.6 we will have it

Any chance it'd be available sooner than that on a dev branch?

@TheAhmadOsman
Copy link

Hi @robertgshaw2-neuralmagic, sorry to bother you, but I just wanted to check if you can point us toward the branch or if there are any updates

@paolovic
Copy link

paolovic commented Sep 1, 2024

jup, support of https://huggingface.co/casperhansen/deepseek-coder-v2-instruct-awq/tree/main
would be awesome!

@fengyang95
Copy link
Author

fengyang95 commented Sep 7, 2024

yes we are almost done with it. I hope in v0.5.6 we will have it

@robertgshaw2-neuralmagic Hi,now that v0.6.0 has been released, it seems that I didn't see any PR related to AWQ. Can you please let me know approximately how long we would have to wait for it?

@xiaoqi35
Copy link

xiaoqi35 commented Sep 8, 2024

For deepseek-v2 modeling, there are two points todo:

@jli943
Copy link

jli943 commented Sep 24, 2024

I'm facing the same problem, any plan to support such MoE Quant models?

@liangzelang
Copy link

liangzelang commented Oct 29, 2024

For deepseek-v2 modeling, there are two points todo:

I'm currently running the awq quantized DeepSeek-V2 model and encountered the same issue. I found that vllm 0.6.3 now supports the AWQ fuse MoE operator, so your first point is resolved. However, what do you mean by the second point? Because I'm encountering the following issue:

 File "/opt/conda/envs/sglang_py310/lib/python3.10/site-packages/sglang/srt/models/deepseek_v2.py", line 315, in forward
    attn_output = self.attn(q, k, v, forward_batch)
  File "/opt/conda/envs/sglang_py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/conda/envs/sglang_py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/sglang_py310/lib/python3.10/site-packages/sglang/srt/layers/radix_attention.py", line 60, in forward
    return forward_batch.attn_backend.forward(q, k, v, self, forward_batch)
  File "/opt/conda/envs/sglang_py310/lib/python3.10/site-packages/sglang/srt/layers/attention/__init__.py", line 49, in forward
    return self.forward_extend(q, k, v, layer, forward_batch)
  File "/opt/conda/envs/sglang_py310/lib/python3.10/site-packages/sglang/srt/layers/attention/flashinfer_backend.py", line 211, in forward_extend
    o = prefill_wrapper_paged.forward(
  File "/opt/conda/envs/sglang_py310/lib/python3.10/site-packages/flashinfer/prefill.py", line 879, in forward
    return self.run(q, paged_kv_cache, k_scale=k_scale, v_scale=v_scale)
  File "/opt/conda/envs/sglang_py310/lib/python3.10/site-packages/flashinfer/prefill.py", line 939, in run
    out = self._wrapper.run(
RuntimeError: BatchPrefillWithPagedKVCache failed with error code an illegal memory access was encountered

@tohnee
Copy link

tohnee commented Nov 12, 2024

i used vllm v0.6.3.post1,this problem still exist

@jeejeelee
Copy link
Collaborator

i used vllm v0.6.3.post1,this problem still exist

Could you please provibe your runnning script?

@Virtual1257
Copy link

Virtual1257 commented Jan 3, 2025

i used vllm 0.6.6.post2.dev58+g07064cb1.cu124,this problem still exist
runnning script

python api_server.py --model /llm-model/deepseek-ai/deepseek-coder-v2-instruct-awq --gpu-memory-utilization 0.85 --max-model-len 512 --tensor-parallel-size 4 --quantization awq
  File "/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/deepseek_v2.py", line 496, in __init__
    self.model = DeepseekV2Model(vllm_config=vllm_config,
  File "/llm-source/vllm-project/vllm0103/vllm/vllm/compilation/decorators.py", line 147, in __init__
    old_init(self, vllm_config=vllm_config, prefix=prefix, **kwargs)
  File "/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/deepseek_v2.py", line 431, in __init__
    self.start_layer, self.end_layer, self.layers = make_layers(
  File "/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/utils.py", line 550, in make_layers
    [PPMissingLayer() for _ in range(start_layer)] + [
  File "/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/utils.py", line 551, in <listcomp>
    maybe_offload_to_cpu(layer_fn(prefix=f"{prefix}.{idx}"))
  File "/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/deepseek_v2.py", line 433, in <lambda>
    lambda prefix: DeepseekV2DecoderLayer(
  File "/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/deepseek_v2.py", line 361, in __init__
    self.mlp = DeepseekV2MoE(
  File "/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/deepseek_v2.py", line 115, in __init__
    self.experts = FusedMoE(num_experts=config.n_routed_experts,
  File "/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/layers/fused_moe/layer.py", line 254, in __init__
    assert self.quant_method is not None

@jeejeelee
Copy link
Collaborator

jeejeelee commented Jan 3, 2025

If I remember correctly, try:

python api_server.py --model /llm-model/deepseek-ai/deepseek-coder-v2-instruct-awq --gpu-memory-utilization 0.85 --max-model-len 512 --tensor-parallel-size 4 

@Virtual1257
Copy link

If I remember correctly, try:如果我记得正确,尝试:

python api_server.py --model /llm-model/deepseek-ai/deepseek-coder-v2-instruct-awq --gpu-memory-utilization 0.85 --max-model-len 512 --tensor-parallel-size 4 

Thank you. I followed your instructions and was able to load the model correctly, but after loading the model, I encountered another error. My machine is equipped with 4 x A40 GPUs, with the following software versions:

  • Driver Version: 550.120
  • CUDA Version: 12.4
  • PyTorch Version: 2.5.1
  • vLLM Version: 0.6.6.post2.dev58+g07064cb1.cu124
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/layers/quantization/awq_marlin.py", line 463, in apply
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return torch.ops.vllm.fused_marlin_moe(
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return forward_call(*args, **kwargs)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/_ops.py", line 1116, in __call__
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return self._op(*args, **(kwargs or {}))
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/deepseek_v2.py", line 404, in forward
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/layers/fused_moe/fused_marlin_moe.py", line 236, in fused_marlin_moe
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     sorted_token_ids, _, _ = moe_align_block_size(topk_ids, block_size_m, E)
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     hidden_states = self.mlp(hidden_states)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/layers/fused_moe/fused_moe.py", line 259, in moe_align_block_size
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     ops.moe_align_block_size(topk_ids, num_experts, block_size, sorted_ids,
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/_custom_ops.py", line 952, in moe_align_block_size
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     torch.ops._moe_C.moe_align_block_size(topk_ids, num_experts, block_size,
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return self._call_impl(*args, **kwargs)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/_ops.py", line 1116, in __call__
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return self._op(*args, **(kwargs or {}))
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] RuntimeError: CUDA error: invalid argument
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return forward_call(*args, **kwargs)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] For debugging consider passing CUDA_LAUNCH_BLOCKING=1
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/deepseek_v2.py", line 150, in forward

@jeejeelee
Copy link
Collaborator

If I remember correctly, try:如果我记得正确,尝试:

python api_server.py --model /llm-model/deepseek-ai/deepseek-coder-v2-instruct-awq --gpu-memory-utilization 0.85 --max-model-len 512 --tensor-parallel-size 4 

Thank you. I followed your instructions and was able to load the model correctly, but after loading the model, I encountered another error. My machine is equipped with 4 x A40 GPUs, with the following software versions:

  • Driver Version: 550.120
  • CUDA Version: 12.4
  • PyTorch Version: 2.5.1
  • vLLM Version: 0.6.6.post2.dev58+g07064cb1.cu124
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/layers/quantization/awq_marlin.py", line 463, in apply
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return torch.ops.vllm.fused_marlin_moe(
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return forward_call(*args, **kwargs)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/_ops.py", line 1116, in __call__
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return self._op(*args, **(kwargs or {}))
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/deepseek_v2.py", line 404, in forward
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/layers/fused_moe/fused_marlin_moe.py", line 236, in fused_marlin_moe
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     sorted_token_ids, _, _ = moe_align_block_size(topk_ids, block_size_m, E)
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     hidden_states = self.mlp(hidden_states)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/layers/fused_moe/fused_moe.py", line 259, in moe_align_block_size
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     ops.moe_align_block_size(topk_ids, num_experts, block_size, sorted_ids,
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/_custom_ops.py", line 952, in moe_align_block_size
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     torch.ops._moe_C.moe_align_block_size(topk_ids, num_experts, block_size,
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return self._call_impl(*args, **kwargs)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/_ops.py", line 1116, in __call__
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return self._op(*args, **(kwargs or {}))
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] RuntimeError: CUDA error: invalid argument
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return forward_call(*args, **kwargs)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] For debugging consider passing CUDA_LAUNCH_BLOCKING=1
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/deepseek_v2.py", line 150, in forward

Where is this model from? It seems DS doesn't provide AWQ version

@Virtual1257
Copy link

If I remember correctly, try:如果我记得正确,尝试:

python api_server.py --model /llm-model/deepseek-ai/deepseek-coder-v2-instruct-awq --gpu-memory-utilization 0.85 --max-model-len 512 --tensor-parallel-size 4 

Thank you. I followed your instructions and was able to load the model correctly, but after loading the model, I encountered another error. My machine is equipped with 4 x A40 GPUs, with the following software versions:

  • Driver Version: 550.120
  • CUDA Version: 12.4
  • PyTorch Version: 2.5.1
  • vLLM Version: 0.6.6.post2.dev58+g07064cb1.cu124
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/layers/quantization/awq_marlin.py", line 463, in apply
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return torch.ops.vllm.fused_marlin_moe(
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return forward_call(*args, **kwargs)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/_ops.py", line 1116, in __call__
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return self._op(*args, **(kwargs or {}))
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/deepseek_v2.py", line 404, in forward
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/layers/fused_moe/fused_marlin_moe.py", line 236, in fused_marlin_moe
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     sorted_token_ids, _, _ = moe_align_block_size(topk_ids, block_size_m, E)
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     hidden_states = self.mlp(hidden_states)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/layers/fused_moe/fused_moe.py", line 259, in moe_align_block_size
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     ops.moe_align_block_size(topk_ids, num_experts, block_size, sorted_ids,
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/_custom_ops.py", line 952, in moe_align_block_size
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     torch.ops._moe_C.moe_align_block_size(topk_ids, num_experts, block_size,
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return self._call_impl(*args, **kwargs)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/_ops.py", line 1116, in __call__
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return self._op(*args, **(kwargs or {}))
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/.conda/envs/vllm0103/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] RuntimeError: CUDA error: invalid argument
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]     return forward_call(*args, **kwargs)
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] For debugging consider passing CUDA_LAUNCH_BLOCKING=1
(VllmWorkerProcess pid=283722) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234] Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
(VllmWorkerProcess pid=283723) ERROR 01-05 10:56:58 multiproc_worker_utils.py:234]   File "/home/root/llm-source/vllm-project/vllm0103/vllm/vllm/model_executor/models/deepseek_v2.py", line 150, in forward

Where is this model from? It seems DS doesn't provide AWQ version

I downloaded the model from https://modelscope.cn/models/cycloneboy/deepseek-coder-v2-instruct-awq. If AWQ is not supported, how should I quantize and run deepseekv2 now? Could you give me some advice? Thank you very much.

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

10 participants