Skip to content

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

Support diffusion model AIDC-AI/Ovis-Image-7B quantization (#1616)

Liang Lv95a84d2be0a7
diff --git a/auto_round/compressors/diffusion/README.md b/auto_round/compressors/diffusion/README.md
index c0f8eb534..e87dc5dea 100644
--- a/auto_round/compressors/diffusion/README.md
+++ b/auto_round/compressors/diffusion/README.md
@@ -62,7 +62,7 @@ auto-round \
### Diffusion Support Matrix
-For diffusion models, currently we only validate quantizaion on the FLUX.1-dev, which involves quantizing the transformer component of the pipeline.
+For diffusion models, currently we validate quantization on the following models, which involves quantizing the transformer component of the pipeline.
| Model | calibration dataset | Model Link |
|---------------|---------------------|--------------|
@@ -70,7 +70,7 @@ For diffusion models, currently we only validate quantizaion on the FLUX.1-dev,
| Tongyi-MAI/Z-Image | COCO2014 | - |
| Tongyi-MAI/Z-Image-Turb | COCO2014 | - |
| stepfun-ai/NextStep-1.1 | COCO2014 | - |
-
+| AIDC-AI/Ovis-Image-7B | COCO2014 | - |
<details>
diff --git a/auto_round/compressors/diffusion/compressor.py b/auto_round/compressors/diffusion/compressor.py
index b57adbb8c..7330f5018 100644
--- a/auto_round/compressors/diffusion/compressor.py
+++ b/auto_round/compressors/diffusion/compressor.py
@@ -47,6 +47,8 @@ pipeline_utils = LazyImport("diffusers.pipelines.pipeline_utils")
output_configs = {
"FluxTransformerBlock": ["encoder_hidden_states", "hidden_states"],
"FluxSingleTransformerBlock": ["encoder_hidden_states", "hidden_states"],
+ "OvisImageTransformerBlock": ["encoder_hidden_states", "hidden_states"],
+ "OvisImageSingleTransformerBlock": ["encoder_hidden_states", "hidden_states"],
}
@@ -116,7 +118,7 @@ class DiffusionCompressor(BaseCompressor):
pipeline_fn: callable = None,
**kwargs,
):
- logger.warning("Diffusion model quantization is experimental and is only validated on Flux models.")
+ logger.warning("Diffusion model quantization is experimental and is only validated on a few models.")
if dataset == "NeelNanda/pile-10k":
dataset = "coco2014"
logger.warning(