Skip to content

PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度

fix: skip activation fake-quant in FakeActQuantLinear when act quantization is not configured (#2286)

Heng Guo888b0f1e554d
diff --git a/auto_round/experimental/qmodules/fake.py b/auto_round/experimental/qmodules/fake.py
index 0089a2555..7f1a56c40 100644
--- a/auto_round/experimental/qmodules/fake.py
+++ b/auto_round/experimental/qmodules/fake.py
@@ -69,6 +69,10 @@ class FakeActQuantLinear(QModuleBase):
return
def qdq_input(self, activation: torch.Tensor) -> torch.Tensor:
+ # No activation quantization configured (e.g. weight-only GGUF-style schemes where
+ # act_bits defaults to 16 / act_data_type is None) -> skip activation fake-quant.
+ if self.config.act_data_type is None or (self.config.act_bits is not None and self.config.act_bits >= 16):
+ return activation
quant_func, _ = get_quant_func(
dtype=self.config.act_data_type,
bits=self.config.act_bits,