Skip to content

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

support bf16 inference (#420)

Wenhua Cheng29c5119f4cce
diff --git a/auto_round/auto_quantizer.py b/auto_round/auto_quantizer.py
index 25a7c11ec..4856c253f 100644
--- a/auto_round/auto_quantizer.py
+++ b/auto_round/auto_quantizer.py
@@ -403,9 +403,6 @@ class AutoRoundQuantizer(HfQuantizer):
if ("hpu" == target_device or "cpu" == target_device) and model.dtype != torch.bfloat16:
logger.info(f"Change the dtype to `bfloat16` as {target_device.upper()} does not support float16")
model = model.to(torch.bfloat16)
- elif "cuda" == target_device and model.dtype != torch.float16:
- logger.info(f"Change the dtype to `float16` for better performance")
- model = model.to(torch.float16)
bits = quantization_config.bits
group_size = quantization_config.group_size