mirror of
https://github.com/deepseek-ai/DeepSeek-R1.git
synced 2026-11-05 00:47:42 +00:00
[GH-ISSUE #554] 使用auto-gptq 量化DeepSeek-R1-Distill-Llama-8B模型,遇到了错误Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument mat2 in method wrapper_CUDA_bmm) #442
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepSeek-R1#442
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @davidray222 on GitHub (Mar 9, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/554
当前行为 | Current Behavior
我使用auto-gptq量化方式,量化了Qwen/QwQ-32B,但遇到了
File "/home/david/miniconda3/envs/deepseek/lib/python3.10/site-packages/transformers/models/qwen2/modeling_qwen2.py", line 335, in forward
freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument mat2 in method wrapper_CUDA_bmm)
我是使用AutoGPTQ/examples/quantization
/quant_with_alpaca.py 的程序来量化。
指令为:
CUDA_VISIBLE_DEVICES=0 python quant_with_alpaca.py --pretrained_model_dir deepseek-ai/DeepSeek-R1-Distill-Llama-8B --quantized_model_dir deepseek-llama7b-quant4bit-g32 --bits 4 --group_size 32 --save_and_reload但遇到
期望行为 | Expected Behavior
能成功量化模型成8bit 4bit group_size=32
复现方法 | Steps To Reproduce
No response
运行环境 | Environment
python -c 'import torch; print(torch.version.cuda)'):12.6备注 | Anything else?
想請為各位有沒有解決方法,或是誰有成功使用auto-gptq量化模型的人能提供步驟,謝謝各位先進!
@github-actions[bot] commented on GitHub (Apr 15, 2025):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!
@github-actions[bot] commented on GitHub (May 18, 2025):
false