Skip to content

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

Open
lvliang-intel wants to merge 2 commits intomainfrom
lvl/support_ovis_image
Open

Support diffusion model AIDC-AI/Ovis-Image-7B quantization#1616
lvliang-intel wants to merge 2 commits intomainfrom
lvl/support_ovis_image

Conversation

@lvliang-intel
Copy link
Contributor

Description

Support diffusion model AIDC-AI/Ovis-Image-7B quantization

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Other (please specify):

Related Issues

#1609

Checklist Before Submitting

  • My code has been tested locally.
  • Documentation has been updated as needed.
  • New or updated tests are included where applicable.

Copilot AI review requested due to automatic review settings March 25, 2026 12:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds explicit support for quantizing the diffusion model AIDC-AI/Ovis-Image-7B by extending the diffusion compressor’s known block-output mapping and updating the diffusion documentation to reflect validation status.

Changes:

  • Register Ovis-Image transformer block class names in output_configs so block outputs can be interpreted correctly during calibration/quantization.
  • Update the diffusion compressor warning to indicate validation on Flux and Ovis-Image models.
  • Update the diffusion support matrix docs to include AIDC-AI/Ovis-Image-7B.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
auto_round/compressors/diffusion/compressor.py Adds Ovis-Image block output mappings and updates validation warning text.
auto_round/compressors/diffusion/README.md Updates diffusion support matrix to include Ovis-Image-7B.

Comment on lines 42 to 47
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"],
}
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New Ovis-Image support is introduced by adding OvisImage* block class names to output_configs, but the diffusion test suite currently only exercises FLUX. Consider adding a regression/smoke test that runs AutoRoundDiffusion on an Ovis-Image pipeline (or a lightweight stub that uses these block class names/outputs) to ensure the new mapping stays correct and prevents runtime assertion failures in _get_block_outputs.

Copilot uses AI. Check for mistakes.
@lvliang-intel
Copy link
Contributor Author

Quantize Script
quantize_ovis_image.py
CUDA_VISIBLE_DEVICES=0 python quantize_ovis_image.py --model /mnt/disk4/lvl/Ovis-Image-7B --output tmp_ovis_image_w4a16 --scheme W4A16 --num-inference-steps 10 --guidance-scale 5.0 --format auto_round

Run inference with vLLM-Omni(with patch for ovis image)
run_ovis_image.py

CUDA_VISIBLE_DEVICES=0 run_ovis_image.py --model /mnt/disk4/lvl/Ovis-Image-7B/ --prompt "A watercolor fox reading a book" --guidance-scale 5.0 --num-inference-steps 50
original_ovis_image_model_output

CUDA_VISIBLE_DEVICES=0 python run_ovis_image.py --model ./tmp_ovis_image_w4a16/ --prompt "A watercolor fox reading a book" --guidance-scale 5.0 --num-inference-steps 50
quantized_ovis_image_model_output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants