Skip to content

format add check for scheme args#1332

Merged
n1ck-guo merged 3 commits intomainfrom
hengguo/add_scheme_checker
Jan 26, 2026
Merged

format add check for scheme args#1332
n1ck-guo merged 3 commits intomainfrom
hengguo/add_scheme_checker

Conversation

@n1ck-guo
Copy link
Copy Markdown
Contributor

Description

In the previous code, the format function only handles cases where the scheme is a string. It does not perform checks for scenarios like --scheme w2a16 --bits 4. This PR adds the relevant checks.

Type of Change

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

Related Issues

Fixes or relates to #1247

Checklist Before Submitting

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

Signed-off-by: n1ck-guo <heng.guo@intel.com>
@n1ck-guo n1ck-guo requested review from Copilot, wenhuach21 and xin3he and removed request for Copilot January 23, 2026 07:47
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 adds validation of scheme arguments when exporting models to different quantization formats. Previously, the format function only validated string schemes and didn't check for incompatibilities between the scheme object's properties (bits, data_type, etc.) and the target format's requirements.

Changes:

  • Added check_scheme_args() method to validate QuantizationScheme objects against format-specific constraints
  • Implemented validation for LLMCompressor, AutoGPTQ, AutoAWQ, and VLLM formats
  • Removed unsupported w8a8 test case for llmcompressor format

Reviewed changes

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

File Description
auto_round/formats.py Added check_scheme_args() methods to OutputFormat classes to validate scheme parameters against format requirements
test/test_cpu/export/test_export.py Added test cases to verify scheme validation raises appropriate errors for incompatible configurations
test/test_cpu/integrations/test_llmcompressor.py Commented out w8a8 test case as this scheme is not supported by llmcompressor format

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: n1ck-guo <heng.guo@intel.com>
Signed-off-by: n1ck-guo <heng.guo@intel.com>
@n1ck-guo n1ck-guo merged commit 7f1dee6 into main Jan 26, 2026
28 checks passed
@n1ck-guo n1ck-guo deleted the hengguo/add_scheme_checker branch January 26, 2026 02:42
lvliang-intel pushed a commit that referenced this pull request Feb 2, 2026
Signed-off-by: n1ck-guo <heng.guo@intel.com>
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