Skip to content

add small zimage test and fix bug#1734

Merged
lvliang-intel merged 4 commits intomainfrom
xinhe/4-23
Apr 24, 2026
Merged

add small zimage test and fix bug#1734
lvliang-intel merged 4 commits intomainfrom
xinhe/4-23

Conversation

@xin3he
Copy link
Copy Markdown
Contributor

@xin3he xin3he commented Apr 23, 2026

Description

This pull request introduces support for testing and handling a new diffusion model, "Z-Image", and makes improvements to model file renaming and test fixture setup. The main changes include adding a test fixture and test case for the Z-Image model, updating the weights file renaming logic, and refining how model modules are loaded in tests.

Support for Z-Image diffusion model:

  • Added a new pytest fixture tiny_z_image_model_path in test/fixtures.py to create and clean up a minimal Z-Image model for testing, with custom configuration overrides.
  • Introduced a new test test_z_image_tune in test/test_cuda/models/test_diffusion.py to verify quantization and saving for the Z-Image model using the new fixture.

Model file handling improvements:

  • Updated rename_weights_files in auto_round/utils/model.py to handle the case where there is only one .safetensors file by renaming it directly, avoiding unnecessary enumeration.

Test utilities and module loading:

  • Modified _get_module in test/helpers.py to directly set reduced modules for specific model attributes, improving how models with nested modules are handled in test environments.

Type of Change

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

Related Issues

Fixes or relates to #

Checklist Before Submitting

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

@xin3he xin3he requested review from Copilot and mengniwang95 April 23, 2026 13:51
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

Note

Copilot was unable to run its full agentic suite in this review.

Adds a CUDA test + fixture for a minimal “Z-Image” diffusion model and adjusts tiny-model module construction and safetensors renaming behavior.

Changes:

  • Add tiny_z_image_model_path fixture and a test_z_image_tune CUDA test.
  • Update tiny-model helper to replace certain nested modules with reduced “tiny” modules.
  • Adjust rename_weights_files to special-case single .safetensors files.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
test/test_cuda/models/test_diffusion.py Adds a CUDA test exercising Z-Image quantization/saving path.
test/helpers.py Changes tiny-model construction to replace nested modules rather than mutating configs in-place.
test/fixtures.py Adds a session-scoped fixture that builds a minimal Z-Image model with config overrides.
auto_round/utils/model.py Special-cases renaming when only one .safetensors file exists.

Comment thread test/test_cuda/models/test_diffusion.py Outdated
Comment thread test/fixtures.py
Comment thread auto_round/utils/model.py
Comment thread auto_round/utils/model.py
@xin3he
Copy link
Copy Markdown
Contributor Author

xin3he commented Apr 24, 2026

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@lvliang-intel lvliang-intel merged commit 46b2991 into main Apr 24, 2026
42 checks passed
@lvliang-intel lvliang-intel deleted the xinhe/4-23 branch April 24, 2026 14:41
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