Skip to content

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

fix bug for exporting afp8 fake format (#731)

Heng Guo978cac112bf7
diff --git a/auto_round/autoround.py b/auto_round/autoround.py
index 9e7b15294..b143cac36 100644
--- a/auto_round/autoround.py
+++ b/auto_round/autoround.py
@@ -646,6 +646,8 @@ class AutoRound(object):
Returns:
bool: True if the format is supported, False otherwise.
"""
+ if format == "fake":
+ return format
format = format.replace("q*_", f"q{self.bits}_")
# only support to export afp8
if self.act_bits <= 8:
@@ -673,7 +675,7 @@ class AutoRound(object):
else:
if not (format == "auto_round" or format == "auto_round:fp8"):
logger.warning(
- f"Currently only support to export auto_round format for static W{self.bits}AFP8 model,"
+ f"Currently only support to export auto_round or fake format for static W{self.bits}AFP8 model,"
" change format to auto_round"
)
format = "auto_round"