Skip to content

meet error when quantizing Qwen2.5vl-72B with multi-gpus #3867

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

Closed
sys-reasoner opened this issue Apr 14, 2025 · 4 comments
Closed

meet error when quantizing Qwen2.5vl-72B with multi-gpus #3867

sys-reasoner opened this issue Apr 14, 2025 · 4 comments

Comments

@sys-reasoner
Copy link

sys-reasoner commented Apr 14, 2025

@Jintao-Huang @hjh0119 Hi guys,

I use 8 * 80G A100 to quantize my post-trained Qwen2.5vl-72B with autoAWQ. Before that I have installed autoawq from source. But after loading model, it throws distributed error immediately. How should I solve this problem?

Image

Here is my shell command:
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \ MAX_PIXELS=2097152 \ VIDEO_MAX_PIXELS=50176 \ FPS_MAX_FRAMES=12 \ swift export \ --model Qwen2.5vl72B_post_train \ --dataset quant.json \ --quant_n_samples 256 \ --quant_batch_size -1 \ --max_length 8192 \ --quant_method awq \ --quant_bits 4 \ --output_dir 72B_awq

Here are related libraries:
autoawq----0.2.8 built from source
trainsformers----4.49.0
torch----2.5.1

@Jintao-Huang
Copy link
Collaborator

Jintao-Huang commented Apr 14, 2025

Try upgrading the transformers.

@sys-reasoner
Copy link
Author

sys-reasoner commented Apr 14, 2025

Try upgrading the transformers.

After upgrading the transformers to 4.51 it works for quantizing. But when deploying to vllm, it encounters this error:
ValueError: The input size is not aligned with the quantized weight shape. This can be caused by too large tensor parallel size.
I have tried tp=2,4,8, all these tp have this error.
Image

@sys-reasoner
Copy link
Author

Try upgrading the transformers.

After upgrading the transformers to 4.51 it works for quantizing. But when deploying to vllm, it encounters this error: ValueError: The input size is not aligned with the quantized weight shape. This can be caused by too large tensor parallel size.

Image

in config.json, I find that this quantization hyperparameters are added:
"quantization_config": { "bits": 4, "group_size": 128, "modules_to_not_convert": [ "visual" ], "quant_method": "awq", "version": "gemm", "zero_point": true },

@sys-reasoner
Copy link
Author

@Jintao-Huang issue fixed. if using vllm tensor parallelism, awq quantized model's intermediate size should be divisible by (group_size * tp). So the default group size should be modified to fit that.

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

No branches or pull requests

2 participants