PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度
add low_cpu_mem_usage in cli (#1146)
Heng Guo0b74fe1529d0
diff --git a/auto_round/__main__.py b/auto_round/__main__.pyindex c468f716d..554b62704 100644--- a/auto_round/__main__.py+++ b/auto_round/__main__.py@@ -135,6 +135,7 @@ class BasicArgumentParser(argparse.ArgumentParser):help="Enable memory-efficient mode by offloading intermediate features to CPU. ""Useful when working with large models that don't fit in GPU memory.",)+ basic.add_argument("--low_cpu_mem_usage", action="store_true", help="Lower CPU memory mode. Defaults to False.")basic.add_argument("--format",default="auto_round",@@ -615,6 +616,7 @@ def tune(args):batch_size=args.batch_size,gradient_accumulate_steps=args.gradient_accumulate_steps,low_gpu_mem_usage=args.low_gpu_mem_usage,+ low_cpu_mem_usage=args.low_cpu_mem_usage,device_map=args.device_map,enable_torch_compile=enable_torch_compile,seed=args.seed,diff --git a/auto_round/compressors/base.py b/auto_round/compressors/base.pyindex 327c82b07..4a860ae10 100644--- a/auto_round/compressors/base.py+++ b/auto_round/compressors/base.py@@ -652,8 +652,9 @@ class BaseCompressor(object):and self.iters > 0):logger.info(+ "%s","'enable_torch_compile' is set to `False` by default. "- "Enabling it can reduce tuning cost by 20%%, but it might throw an exception."+ "Enabling it can reduce tuning cost by 20%, but it might throw an exception.",)if (self.data_type.startswith("fp") or self.act_data_type.startswith("fp")) and self.enable_torch_compile: