Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Support activation-only scale search for PyTorch AWQ calibration

Đang mở
#2,674 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@meenchen đang làm issue này rồi.

Từ ngày 6/10/2026.

  • #2675 của @thuiaaa — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Detailed description of the requested feature

Please add an activation-only scale-search option to the PyTorch PTQ AWQ calibration algorithms (at least awq_lite, and therefore awq_full).

The current get_scale implementation searches per-input-channel scales proportional to act_scale ** alpha / weight_scale ** (1 - alpha):
https://github.com/NVIDIA/Model-Optimizer/blob/9f902aefd/modelopt/torch/quantization/model_calib.py#L1481-L1494

Equation (5) of the AWQ paper instead defines the search space as s = s_X ** alpha, where s_X is the mean activation magnitude per input channel:
https://arxiv.org/html/2306.00978v6

The paper authors' current implementation also uses activation-only scaling:
https://github.com/mit-han-lab/llm-awq/blob/main/awq/quantize/auto_scale.py#L119-L125

For historical context, the authors' initial repository commit included a weight term, which was removed in a later commit:
https://github.com/mit-han-lab/llm-awq/commit/02c1dd657d1e

AutoAWQ subsequently added activation-only scaling as an optional mode (duo_scaling=False) in PR #216 while retaining its existing weight-and-activation mode as the default:
https://github.com/casper-hansen/AutoAWQ/pull/216

That PR reported lower WikiText perplexity for Qwen 7B Chat with activation-only scaling (10.224 to 9.949), while the results for Mistral 7B Instruct and Llama 2 7B Chat were approximately unchanged or slightly mixed. This is evidence that the choice can matter by model, not a claim that activation-only scaling is universally better.

Could ModelOpt expose a configuration option for the paper's activation-only search space, alongside the current formula? A backward-compatible default would preserve existing quantization behavior. It would help users reproduce the paper's scale search and compare both methods on their target models.

Timeline

No fixed deadline. This would enable paper-aligned AWQ experiments and model-specific accuracy comparisons.

Describe alternatives you've considered

AutoAWQ exposes duo_scaling=False, but using a separate quantization library does not provide this option within ModelOpt's existing PTQ and export workflows. Replacing ModelOpt's current formula unconditionally could change existing results, so a configurable choice seems preferable.

Target hardware/use case

PyTorch PTQ for LLM weight-only INT4 AWQ (W4A16), including INT4_AWQ_CFG; the same option may also be relevant to other ModelOpt AWQ formats that use the shared scale search.

Ngôn ngữ chính
Python
Star
5.3k
Fork
745
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
160

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/Model-Optimizer

Tất cả issue của NVIDIA/Model-Optimizer

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.