PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度
Attach `act_max_hook` for FP8 model (#1447)
Yi Liu81c8ee4262dd
diff --git a/auto_round/compressors/base.py b/auto_round/compressors/base.pyindex e855fd0ce..5877bd389 100644--- a/auto_round/compressors/base.py+++ b/auto_round/compressors/base.py@@ -1467,7 +1467,7 @@ class BaseCompressor(object):block = convert_module_to_hp_if_necessary(block, dtype=self.amp_dtype, device=self.device)update_block_global_scale_if_needed(block, self.data_type, self.group_size)-+ self._register_act_max_hook(block)if is_auto_device_mapping(self.device_map) and len(self.device_list) > 1:set_auto_device_map_for_block_with_tuning(block, self.device_map, input_ids, self.low_gpu_mem_usage, self.batch_size, self.device