Fix cpu ut for transformers v5#1333
Merged
Kaihui-intel merged 29 commits intomainfrom Jan 28, 2026
Merged
Conversation
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates CPU unit tests to handle compatibility issues introduced in transformers v5, ensuring tests either skip problematic features or adapt to API changes.
Changes:
- Added conditional test skipping for transformers v5 due to breaking changes in MOE models, GGUF format support, and API deprecations
- Updated assertions to accept both float32 and bfloat16 dtypes for model tensors
- Modified model configuration and dtype handling to work with transformers v5 architecture changes
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/helpers.py | Adds transformers_version helper variable for version checking across tests |
| test/test_cpu/quantization/test_mxfp_nvfp.py | Skips MOE model tests for transformers v5 due to breaking changes |
| test/test_cpu/models/test_moe_model.py | Skips Llama4 test and adds commented code for future v5 compatibility |
| test/test_cpu/integrations/test_llmc_integration.py | Skips llmcompressor integration test due to deprecated use_auth_token parameter |
| test/test_cpu/export/test_gguf_format.py | Skips entire GGUF test class for transformers v5 due to loading failures |
| test/test_cpu/export/test_export.py | Updates dtype assertions to accept both float32 and bfloat16 |
| test/test_cpu/core/test_autoround.py | Adds version-specific model path assertions for Qwen2VL visual model |
| test/test_cpu/backends/test_torch_backend.py | Changes model dtype from bfloat16 to float32 and moves dtype parameter to tokenizer |
| auto_round/modelling/llama4.py | Conditionally imports no_init_weights from different modules based on transformers version |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
for more information, see https://pre-commit.ci
wenhuach21
reviewed
Jan 23, 2026
wenhuach21
reviewed
Jan 23, 2026
xin3he
reviewed
Jan 26, 2026
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
for more information, see https://pre-commit.ci
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
for more information, see https://pre-commit.ci
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
Signed-off-by: WeiweiZhang1 <weiwei1.zhang@intel.com>
Signed-off-by: WeiweiZhang1 <weiwei1.zhang@intel.com>
for more information, see https://pre-commit.ci
xin3he
approved these changes
Jan 27, 2026
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
for more information, see https://pre-commit.ci
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
n1ck-guo
approved these changes
Jan 27, 2026
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
9 tasks
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
for more information, see https://pre-commit.ci
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
for more information, see https://pre-commit.ci
Contributor
Author
|
waiting for fix ci by XuehaoSun · Pull Request #1344 · intel/auto-round
2026-01-27T07:41:58.9168661Z /home/hostuser/.venv/lib/python3.12/site-packages/auto_round/utils/common.py:87: in wrapper
2026-01-27T07:41:58.9168977Z return func(*args, **kwargs)
2026-01-27T07:41:58.9169223Z ^^^^^^^^^^^^^^^^^^^^^
2026-01-27T07:41:58.9169510Z /home/hostuser/.venv/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py:372: in from_pretrained
2026-01-27T07:41:58.9169938Z return model_class.from_pretrained(
2026-01-27T07:41:58.9170250Z /home/hostuser/.venv/lib/python3.12/site-packages/transformers/modeling_utils.py:4075: in from_pretrained
2026-01-27T07:41:58.9170547Z hf_quantizer.preprocess_model(
2026-01-27T07:41:58.9170861Z /home/hostuser/.venv/lib/python3.12/site-packages/transformers/quantizers/base.py:167: in preprocess_model
2026-01-27T07:41:58.9171231Z self._process_model_before_weight_loading(model, **kwargs)
2026-01-27T07:41:58.9171552Z /home/hostuser/.venv/lib/python3.12/site-packages/transformers/quantizers/quantizer_auto_round.py:54: in _process_model_before_weight_loading
2026-01-27T07:41:58.9171949Z model, used_backends = convert_hf_model(model, target_device)
2026-01-27T07:41:58.9172453Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-27T07:41:58.9172778Z /home/hostuser/.venv/lib/python3.12/site-packages/auto_round/inference/convert_model.py:600: in convert_hf_model
2026-01-27T07:41:58.9173127Z used_backends = _replace_by_quant_layers(model, layer_configs, backend, target_device, packing_format)
2026-01-27T07:41:58.9173434Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-27T07:41:58.9173725Z /home/hostuser/.venv/lib/python3.12/site-packages/auto_round/inference/convert_model.py:348: in _replace_by_quant_layers
2026-01-27T07:41:58.9174159Z layer_backend = get_layer_backend(target_device, backend, packing_format, config, in_features, out_features)
2026-01-27T07:41:58.9174459Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-27T07:41:58.9174736Z /home/hostuser/.venv/lib/python3.12/site-packages/auto_round/inference/backend.py:1019: in get_layer_backend
2026-01-27T07:41:58.9175049Z process_requirement(backend_info.requirements, target_device=device)
2026-01-27T07:41:58.9175431Z /home/hostuser/.venv/lib/python3.12/site-packages/auto_round/inference/backend.py:1138: in process_requirement
2026-01-27T07:41:58.9175723Z exit(-1)
FAILED test_cpu/utils/test_calib_dataset.py::TestLocalCalibDataset::test_combine_dataset
FAILED test_cpu/utils/test_calib_dataset.py::TestLocalCalibDataset::test_combine_dataset2
|
wenhuach21
reviewed
Jan 27, 2026
…4 model Signed-off-by: He, Xin3 <xin3.he@intel.com>
lvliang-intel
pushed a commit
that referenced
this pull request
Feb 2, 2026
Signed-off-by: Kaihui-intel <kaihui.tang@intel.com> Signed-off-by: WeiweiZhang1 <weiwei1.zhang@intel.com> Signed-off-by: He, Xin3 <xin3.he@intel.com> Signed-off-by: Sun, Xuehao <xuehao.sun@intel.com> Co-authored-by: sys-lpot-val <sys_lpot_val@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: WeiweiZhang1 <weiwei1.zhang@intel.com> Co-authored-by: Xin He <xin3.he@intel.com> Co-authored-by: Sun, Xuehao <xuehao.sun@intel.com> Co-authored-by: Heng Guo <heng.guo@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
update test_cpu for transformers v5
Type of Change
Related Issues
Fixes or relates to ##1314
Checklist Before Submitting