Skip to content

Fix CI test_transformers issue caused by transformers 5.3.0#1535

Merged
lvliang-intel merged 2 commits intomainfrom
lvl/fix_ci_issue
Mar 13, 2026
Merged

Fix CI test_transformers issue caused by transformers 5.3.0#1535
lvliang-intel merged 2 commits intomainfrom
lvl/fix_ci_issue

Conversation

@lvliang-intel
Copy link
Copy Markdown
Contributor

Description

This PR fixes a compatibility issue with transformers 5.3.0 in the pre-quantized model loading path.

In transformers 5.3.0, convert_and_load_state_dict_in_model assumes checkpoint tensors implement get_dtype(). However, some entries such as lm_head.weight are plain torch.Tensor objects, which only expose .dtype. This causes loading pre-quantized GPTQ models to fail with:

AttributeError: 'Tensor' object has no attribute 'get_dtype'

This change adds a local compatibility patch in our existing transformers monkey patch flow so AutoRound can continue loading affected models on newer transformers versions without changing model behavior.

https://inteltf-jenk.sh.intel.com/job/AutoRound_unit_test/121/artifact/auto-round/ut_log_dir/unittest_cuda_test_transformers.log

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: lvliang-intel <liang1.lv@intel.com>
Signed-off-by: lvliang-intel <liang1.lv@intel.com>
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@lvliang-intel lvliang-intel merged commit 7b087fb into main Mar 13, 2026
29 checks passed
@lvliang-intel lvliang-intel deleted the lvl/fix_ci_issue branch March 13, 2026 05:25
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