Fix CI test_transformers issue caused by transformers 5.3.0#1535
Merged
lvliang-intel merged 2 commits intomainfrom Mar 13, 2026
Merged
Fix CI test_transformers issue caused by transformers 5.3.0#1535lvliang-intel merged 2 commits intomainfrom
lvliang-intel merged 2 commits intomainfrom
Conversation
Signed-off-by: lvliang-intel <liang1.lv@intel.com>
Signed-off-by: lvliang-intel <liang1.lv@intel.com>
xin3he
approved these changes
Mar 13, 2026
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 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_modelassumes 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
Related Issues
Fixes or relates to #
Checklist Before Submitting