Skip to content

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

remove result to cpu (#1115)

Yi Liu5346cb73b148
diff --git a/auto_round/compressors/base.py b/auto_round/compressors/base.py
index 0c5a7f3fb..fab7fd346 100644
--- a/auto_round/compressors/base.py
+++ b/auto_round/compressors/base.py
@@ -1590,7 +1590,7 @@ class BaseCompressor(object):
if hasattr(m, "imatrix"):
m.imatrix /= m.imatrix_cnt
if hasattr(m, "tmp_name") and m.tmp_name in all_to_quantized_module_names:
- self._quantize_layer_via_rtn(m.tmp_name, to_cpu=False)
+ self._quantize_layer_via_rtn(m.tmp_name, to_cpu=self.low_gpu_mem_usage)
all_to_quantized_module_names.remove(m.tmp_name)
if not self.immediate_saving:
mv_module_from_gpu(block)