feat: add MXFP4/MXFP8 quantization support (llmc_compressor format) and related tests#1865
Draft
xin3he wants to merge 5 commits into
Draft
feat: add MXFP4/MXFP8 quantization support (llmc_compressor format) and related tests#1865xin3he wants to merge 5 commits into
xin3he wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds MXFP4 / MXFP8 model-free (RTN) quantization to the auto_round library, routing through the existing quant_mx shared-exponent logic and QuantLinear.pack() to emit compressed-tensors / llm-compressor style outputs. Also tweaks shard processing to keep already-quantized tensors for ignored/skipped layers, and broadens model-free supported formats.
Changes:
- New
_quantize_weight_mxfp()plus an MXFP branch in_quantize_single_tensor(), scheme validation, and compressed-tensors style config generation via_build_mxfp_quantization_config(). _process_shard()now preserves original tensors for ignored/skipped.weightlayers before FP8/FP4 dequantization;SUPPORTED_FORMATSandquantize_and_save()acceptllm_compressorvariants.- New unit / end-to-end tests for MXFP4 / MXFP8 model-free flows and an ignored-FP8-preservation test.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| auto_round/compressors/model_free.py | Adds MXFP weight quantization, compressed-tensors config builder, MXFP validation branch, ignored-tensor preservation in shard processing, and expanded supported formats. |
| test/test_cpu/quantization/test_model_free.py | Adds shape/dtype, end-to-end, AutoRound API, shard, ignored-FP8 preservation, and scheme-validation tests for MXFP. |
Signed-off-by: Xin He <xin3.he@intel.com>
Signed-off-by: Xin He <xin3.he@intel.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Xin He <xin3.he@intel.com>
Signed-off-by: Xin He <xin3.he@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request adds support for MXFP4 and MXFP8 (Mixed-Precision Floating Point) model-free quantization to the
auto_roundlibrary, alongside robust handling and configuration for these schemes. The changes include new quantization logic, configuration generation, updated validation, and comprehensive tests to ensure correct behavior and compatibility with the existing codebase.MXFP4/MXFP8 Quantization Support:
_quantize_weight_mxfpfunction for quantizing weights into MXFP formats, utilizing existing utilities for exponent sharing and packing.Configuration and Format Handling:
Robustness Improvements:
Testing Enhancements:
Miscellaneous:
These changes collectively enable efficient and correct model-free quantization using MXFP4 and MXFP8, while maintaining compatibility and robustness across the quantization pipeline.
Type of Change
New feature
Related Issues
Fixes or relates to #1741
Checklist Before Submitting
/azp run Unit-Test-CUDA-AutoRound.