Skip to content

Implement AutoScheme support for model-free packing with validation a…#1990

Merged
xin3he merged 5 commits into
mainfrom
xinhe/7-1
Jul 3, 2026
Merged

Implement AutoScheme support for model-free packing with validation a…#1990
xin3he merged 5 commits into
mainfrom
xinhe/7-1

Conversation

@xin3he

@xin3he xin3he commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

This pull request introduces comprehensive support for using AutoScheme (automatic mixed-bit quantization selection) in model-free mode, enabling a two-phase workflow: first, a brief model load for delta-loss scoring to select per-layer bit-widths, followed by efficient shard-by-shard packing without keeping the model in memory. The changes include both implementation and documentation updates, as well as new tests to ensure correct behavior and constraints.

Key changes:

Model-Free + AutoScheme Integration

  • Added functions (_looks_like_auto_scheme, _validate_auto_scheme_options, _convert_auto_scheme_layer_config) to detect, validate, and process AutoScheme objects for model-free quantization, ensuring only supported option families (INT or MXFP) are allowed and not mixed. (auto_round/compressors/model_free.py auto_round/compressors/model_free.pyR1488-R1598)
  • Implemented a two-phase workflow: the model is loaded only briefly for delta-loss scoring (selection), then released before model-free packing begins. The resolved per-layer scheme and ignore-lists are injected into the standard pipeline. (auto_round/compressors/model_free.py [1] [2] [3] [4]

Utilities and Routing

  • Updated is_model_free_route to recognize and correctly route AutoScheme objects, including family validation and format restrictions. (auto_round/utils/model.py [1] [2]

Documentation

  • Added detailed documentation and usage examples for combining AutoScheme with model-free mode, including constraints and supported option families, in both English and Chinese guides. (docs/step_by_step.md [1] [2] [3]; docs/step_by_step_CN.md [4] [5]

Testing

  • Added a comprehensive test suite for model-free + AutoScheme, covering detection, validation (including error cases), layer config conversion, and end-to-end runs for both INT and MXFP families. (test/test_cpu/quantization/test_model_free.py test/test_cpu/quantization/test_model_free.pyR1310-R1391)

These changes ensure that users can now perform automatic mixed-bit quantization in model-free mode with robust validation, clear documentation, and strong test coverage.

Type of Change

Enhancement

Related Issues

Fixes or relates to #910

Checklist Before Submitting

  • My code has been tested locally.
  • Documentation has been updated as needed.
  • New or updated tests are included where applicable.
  • The CUDA CI has passed. You can trigger it by commenting /azp run Unit-Test-CUDA-AutoRound.

…nd configuration conversion

Signed-off-by: Xin He <xin3.he@intel.com>
@xin3he xin3he requested a review from wenhuach21 July 3, 2026 05:37

@wenhuach21 wenhuach21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not familiar with this part, and this change does not affect the major logic. So looks good to me

…hods

Signed-off-by: Xin He <xin3.he@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds support for using AutoScheme in model-free quantization by resolving mixed-bit per-layer choices via a brief delta-loss scoring phase, then performing shard-by-shard packing without keeping the full model resident. This also updates auto-routing logic, documentation, and CPU tests.

Changes:

  • Implement AutoScheme detection/validation + conversion of generated layer_config into model-free inputs (two-phase selection → packing).
  • Extend is_model_free_route to route AutoScheme runs based on option “family” (INT vs MXFP) and export format.
  • Add docs and tests covering AutoScheme + model-free workflows and validation constraints.

Reviewed changes

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

Show a summary per file
File Description
auto_round/compressors/model_free.py Adds AutoScheme validation/conversion and a two-phase selection→packing workflow in model-free mode.
auto_round/utils/model.py Updates model-free auto-routing to recognize and validate AutoScheme + format constraints.
docs/step_by_step.md Documents AutoScheme + model-free usage, constraints, and examples.
docs/step_by_step_CN.md Adds partial CN documentation updates for AutoScheme + model-free.
test/test_cpu/quantization/test_model_free.py Adds unit + e2e tests for AutoScheme support in model-free mode.

Comment thread auto_round/compressors/model_free.py
Comment thread test/test_cpu/quantization/test_model_free.py Outdated
Comment thread docs/step_by_step.md Outdated
Comment thread docs/step_by_step_CN.md
@chensuyue

Copy link
Copy Markdown
Contributor

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

xin3he added 3 commits July 3, 2026 14:16
…-free quantization

Signed-off-by: Xin He <xin3.he@intel.com>
…iled assertions

Signed-off-by: Xin He <xin3.he@intel.com>
Signed-off-by: Xin He <xin3.he@intel.com>
@chensuyue

Copy link
Copy Markdown
Contributor

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@xin3he xin3he added this to the 0.14.0 milestone Jul 3, 2026
@xin3he xin3he merged commit cd10607 into main Jul 3, 2026
47 checks passed
@xin3he xin3he deleted the xinhe/7-1 branch July 3, 2026 08:00
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.

4 participants