Skip to content

Fix FP8 quantizer for Transformers v4#1504

Merged
yiliu30 merged 11 commits intomainfrom
hpu-v4
Mar 9, 2026
Merged

Fix FP8 quantizer for Transformers v4#1504
yiliu30 merged 11 commits intomainfrom
hpu-v4

Conversation

@yiliu30
Copy link
Contributor

@yiliu30 yiliu30 commented Mar 6, 2026

Description

Please briefly describe your main changes, the motivation.

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.

Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Copilot AI review requested due to automatic review settings March 6, 2026 03:12
Copy link
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 aims to restore/fix FP8 fine-grained integration compatibility with Transformers v4 by switching the HPU finegrained-fp8 monkeypatch to a version-specific patch module, and by introducing a dedicated v4 patch implementation.

Changes:

  • Update HPU patching to select a Transformers v4 vs v5+ compatible finegrained_fp8 replacement module at runtime.
  • Add a new finegrained_fp8_patch_v4.py module providing FP8Linear replacement logic for Transformers v4.
  • Add an example script for running FP8 static quantization and saving output.

Reviewed changes

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

File Description
examples/quant_model.py Adds an example CLI for quantizing/saving a model with AutoRound FP8 static scheme.
auto_round/modeling/hpu_patch.py Selects the correct finegrained_fp8 patch module depending on Transformers major version.
auto_round/modeling/finegrained_fp8_patch_v4.py Introduces a Transformers v4-specific FP8Linear replacement implementation.

@chensuyue chensuyue added this to the 0.10.3 milestone Mar 7, 2026
yiliu30 and others added 5 commits March 9, 2026 08:51
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Copy link

@a32543254 a32543254 left a comment

Choose a reason for hiding this comment

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

LGTM

@yiliu30 yiliu30 merged commit 6ab2db2 into main Mar 9, 2026
29 checks passed
@yiliu30 yiliu30 deleted the hpu-v4 branch March 9, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants