Skip to content

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

[HPU]Fix compile bug when quant layer (#441)

Yi Liu19601d4ed977
diff --git a/auto_round/autoround.py b/auto_round/autoround.py
index 5c0f0c66e..7cadb49fa 100644
--- a/auto_round/autoround.py
+++ b/auto_round/autoround.py
@@ -495,7 +495,7 @@ class AutoRound(object):
device = next(self.model.parameters()).device
if self.enable_torch_compile != False:
try:
- quant_layer = compile_func(self.quant_layer, device, self.enable_torch_compile)
+ quant_layer = compile_func(self.quant_layer, self.device, self.enable_torch_compile)
except:
logger.warning("torch compile failed, reset it to `False`")
self.enable_torch_compile = False