Skip to content

Add support for transformers v5.5#1684

Open
echarlaix wants to merge 101 commits into
mainfrom
transformers-v5.5
Open

Add support for transformers v5.5#1684
echarlaix wants to merge 101 commits into
mainfrom
transformers-v5.5

Conversation

@echarlaix

@echarlaix echarlaix commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator

Adds compatibility with transformers v5.5 and bumps the supported range to >=4.57,<5.6.

  • attention_mask is now created explicitly when needed, since generate() no longer creates it since v5.2
  • mm_token_type_ids is now computed and passed to get_rope_index as required by transformers v5.3 for Qwen2VL, Qwen2.5VL, and Qwen3VL models
  • position_ids generation fixed for v5.3 decode step where input_ids is already sliced to 1 token
    • cache_position handling for SSM models (>=v4.54): SSM models no longer receive cache_position from generate(). It is now inferred from cache_params when absent
  • AutoModelForVision2Seq → AutoModelForImageTextToText (>=v4.54)

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

SUPPORTED_ARCHITECTURES += ("data2vec-text", "flaubert", "xlm")

if is_transformers_version("!=", "4.52"):
SUPPORTED_ARCHITECTURES += ("convbert",)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@echarlaix echarlaix added the openvino-slow Runs OpenVINO slow tests with different versions of transformers label Apr 17, 2026
@echarlaix echarlaix removed the openvino-slow Runs OpenVINO slow tests with different versions of transformers label Apr 20, 2026
@echarlaix echarlaix added the openvino-slow Runs OpenVINO slow tests with different versions of transformers label Apr 24, 2026

@regisss regisss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@rkazants rkazants left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please clean-up preview models (gemma 4, qwen3.5) job because they should come to regular jobs

@IlyasMoutawwakil IlyasMoutawwakil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM !

@echarlaix echarlaix removed the openvino-slow Runs OpenVINO slow tests with different versions of transformers label Jul 7, 2026

@rkazants rkazants left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We loose support for critical models:
minicpm | MiniCPMOpenVINOConfig | 4.53.3 | 469
minicpm3 | MiniCPM3OpenVINOConfig | 4.53.3 | 478
chatglm | ChatGLM2OpenVINOConfig | 4.55.4 | 518
qwen | QwenOpenVINOConfig | 4.55.4 | 822
arctic | ArcticOpenVINOConfig | 4.53.3 | 1219
llava-qwen2 | LlavaQwen2OpenVINOConfig | 4.53.3 | 2133
minicpmo | MiniCPMOOpenVINOConfig | 4.51.3 | 2752
phi3_v | Phi3VisionOpenVINOConfig | 4.53.3 | 2769
phi4_multimodal | Phi4MMOpenVINOConfig | 4.53.3 | 2904
deepseek / deepseek_v2 | DeepseekOpenVINOConfig | 4.53.3 | 391

Comment thread .github/workflows/test_openvino.yml Outdated
"*transformation*",
]
transformers-version: ["4.45.0", "4.57.6", "latest"]
transformers-version: ["4.57.6", "5.3.0", "latest"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

may be let us leave ["4.45.0", "4.57.6", "latest"]?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@rkazants we only test min/max supported transformers version (4.57.6 and 5.5)
https://github.com/huggingface/optimum-intel/blob/transformers-v5.5/.github/workflows/test_openvino.yml#L42 having more tests can result in rate limit errors as this launches x8 tests each time (can be an issue especially for concurrent PRs), would make more sense to have nightly tests for missing transformers release

Comment thread tests/openvino/test_quantization.py
@echarlaix echarlaix force-pushed the transformers-v5.5 branch from fb9c5a2 to 1f714fe Compare July 9, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants