-
Notifications
You must be signed in to change notification settings - Fork 75
Fix cpu ut for transformers v5 #1333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
There was a problem hiding this 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 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
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
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: sys-lpot-val <sys_lpot_val@intel.com>
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
|
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
|
…4 model Signed-off-by: He, Xin3 <xin3.he@intel.com>
Description
update test_cpu for transformers v5
Type of Change
Related Issues
Fixes or relates to ##1314
Checklist Before Submitting