Skip to content

fix bug of quantizing Z-image#1516

Merged
xin3he merged 1 commit intomainfrom
xinhe/3-9
Mar 10, 2026
Merged

fix bug of quantizing Z-image#1516
xin3he merged 1 commit intomainfrom
xinhe/3-9

Conversation

@xin3he
Copy link
Copy Markdown
Contributor

@xin3he xin3he commented Mar 9, 2026

Description

  1. save config in FrozenDict type (ZImageTransformer2DModel.config)
  2. stop evaluation if no args.tasks
  3. skip .state_dict calling if module is an parameter object. (x_pad_token, cap_pad_token)

Type of Change

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

Related Issues

Fixes or relates to #1507

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 9, 2026 03:23
@xin3he xin3he requested review from mengniwang95 and yiliu30 and removed request for Copilot March 9, 2026 03:24
@xin3he
Copy link
Copy Markdown
Contributor Author

xin3he commented Mar 9, 2026

Raw model output:
dragon
W4A16 output (auto-round Tongyi-MAI/Z-Image-Turbo --iters 0 --disable_opt_rtn --format fake):
dragon-w4

@xin3he
Copy link
Copy Markdown
Contributor Author

xin3he commented Mar 9, 2026

revert save_config change, and use #1519 insteadly.

Copilot AI review requested due to automatic review settings March 9, 2026 08:42
Copy link
Copy Markdown
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

This PR targets export/evaluation correctness for quantized models (including diffusion/Z-Image related flows), adjusting how export artifacts are written and when evaluation is executed.

Changes:

  • Introduces new export utilities (model saving, AutoGPTQ QuantLinear selection, quantization-config filtering, layer release helper).
  • Adjusts evaluation flow to skip evaluation when no args.tasks are provided.
  • Hardens shard-writer offload logic to avoid calling .state_dict() on non-Module objects.

Reviewed changes

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

File Description
auto_round/export/utils.py Adds shared export helpers for saving models and cleaning quantization configs.
auto_round/eval/evaluation.py Reorders early-return logic around evaluation dispatch.
auto_round/compressors/shard_writer.py Adds a type-check to avoid .state_dict() on non-modules during meta offload.

You can also share your feedback on Copilot code review. Take the survey.

Signed-off-by: Xin He <xin3.he@intel.com>
@xin3he xin3he merged commit 8a404ec into main Mar 10, 2026
29 checks passed
@xin3he xin3he deleted the xinhe/3-9 branch March 10, 2026 01:50
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.

3 participants