Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
e6df5a0
transformers v5.5
echarlaix Apr 15, 2026
4fcd786
update setup
echarlaix Apr 15, 2026
9b439b4
set min required transformers verion to v4.57
echarlaix Apr 15, 2026
88d4f1a
fix position ids generation
echarlaix Apr 16, 2026
c31a88b
convbert
echarlaix Apr 16, 2026
da7c410
fix position_ids generation for qwenvl models
echarlaix Apr 17, 2026
5ca59b8
check for _prepare_position_ids_for_generation
echarlaix Apr 17, 2026
661f0a5
fix qwen3vl
echarlaix Apr 17, 2026
b52550f
fix transformers version
echarlaix Apr 20, 2026
c5f9c47
transformers v5.3
echarlaix Apr 20, 2026
ee941ff
datasets test extra setup
echarlaix Apr 20, 2026
4a77bce
create attention_mask when needed as not created in generate since v5.2
echarlaix Apr 22, 2026
06187d0
fix mm_token_type_ids
echarlaix Apr 23, 2026
9857954
add torchcodec tests install
echarlaix Apr 23, 2026
95a6efd
add missing get_vision_position_ids
echarlaix Apr 24, 2026
dbc13a9
add transformers v5.3 check
echarlaix Apr 24, 2026
fd94a59
workflow
echarlaix Apr 24, 2026
43bd816
worflow
echarlaix Apr 24, 2026
31ffbb4
fix for Qwen2_5
echarlaix Apr 24, 2026
8ae40d3
revert
echarlaix Apr 24, 2026
6c05f54
disable for datasets metric test when datasets <v4
echarlaix Apr 24, 2026
c09aab1
transformers v5.4
echarlaix Apr 24, 2026
620f7a5
Merge branch 'main' into transformers-v5.5
echarlaix Apr 24, 2026
24982a5
add missing
echarlaix Apr 24, 2026
a80912e
use sdpa_mask instead of sdpa_mask_without_vmap for transformers v5 o…
echarlaix Apr 27, 2026
1652bc8
fix eager mask
echarlaix Apr 27, 2026
2699f22
ov_sdpa_mask_without_vmap
echarlaix Apr 28, 2026
d1a61da
remove inheritance to Qwen3VLVisionModel and Qwen3VLModel
echarlaix Apr 28, 2026
dbdf3af
transformers v5.3
echarlaix Apr 28, 2026
fd8d155
transformers-v5 branch
echarlaix Apr 28, 2026
cef3755
Merge branch 'main' into transformers-v5.5
echarlaix Apr 28, 2026
888bfb9
transformers v5.4
echarlaix Apr 28, 2026
60582f8
add transformers v5.3 for tests temporarily
echarlaix Apr 29, 2026
ad5aea6
use sdpa_mask for transformers v5 or higher
echarlaix Apr 29, 2026
f9788e3
remove tests for v5.4 for incompatible models
echarlaix Apr 29, 2026
ea462e4
add comments
echarlaix Apr 29, 2026
9acdc49
simplify
echarlaix Apr 29, 2026
588f89e
add comments
echarlaix Apr 29, 2026
b595a8d
merge main
echarlaix May 18, 2026
8b40b7a
Fix Qwen3_5 model
echarlaix May 18, 2026
a95ba3c
fix import
echarlaix May 18, 2026
1923870
fix untested architectures test
echarlaix May 18, 2026
ab0132c
fix sdpa_mask_without_vmap
echarlaix May 19, 2026
8a34b95
fix imports
echarlaix May 19, 2026
e3bb534
Merge branch 'main' into transformers-v5.5
echarlaix Jun 2, 2026
1df8f01
merge main in branch
echarlaix Jun 2, 2026
e5f0864
add _orig_sdpa_mask_without_vmap
echarlaix Jun 2, 2026
3e670cd
fix
echarlaix Jun 2, 2026
8a09786
fix
echarlaix Jun 2, 2026
774583f
config loading failing coming from type mismatch coming from transfor…
echarlaix Jun 2, 2026
ff2b524
update setup
echarlaix Jun 3, 2026
2bfe323
fix
echarlaix Jun 4, 2026
45b3744
fix
echarlaix Jun 4, 2026
9beacbb
minimum required transformers version is v4.57
echarlaix Jun 5, 2026
dd7b8c4
style
echarlaix Jun 5, 2026
31504a2
remove
echarlaix Jun 5, 2026
d614db1
clean tests
echarlaix Jun 5, 2026
0ab58c3
style
echarlaix Jun 5, 2026
7b3a0a5
style
echarlaix Jun 5, 2026
36b7b3c
merge main
echarlaix Jun 12, 2026
e75a1ae
style
echarlaix Jun 12, 2026
8077881
fix bloom patcher
echarlaix Jun 15, 2026
943af35
add missing smollm3 test
echarlaix Jun 15, 2026
03b4fd1
set max transformers version to 5.3 for mamba models
echarlaix Jun 15, 2026
e478371
max transformers version
echarlaix Jun 15, 2026
dd08ef8
transformers v5.5
echarlaix Jun 15, 2026
5d11a3f
max transformers
echarlaix Jun 15, 2026
c03f843
update tests for v5.5
echarlaix Jun 16, 2026
6f60e28
update tests for v5.5
echarlaix Jun 16, 2026
4c242ea
merge main
echarlaix Jun 16, 2026
7eef74b
filter architectures in tests depending on supported transformers ver…
echarlaix Jun 17, 2026
1d1040f
style
echarlaix Jun 17, 2026
63665bd
fix
echarlaix Jun 17, 2026
b196195
add MIN_TRANSFORMERS_VERSION for gemma4
echarlaix Jun 17, 2026
ee67bf0
fix tests expected int8 node for v5.5 transformers
echarlaix Jun 17, 2026
9e1cd19
merge main
echarlaix Jun 18, 2026
2d2b8b3
fix
echarlaix Jun 18, 2026
2c1950e
fix afmoe patching
echarlaix Jun 18, 2026
4a9b5f5
fix test
echarlaix Jun 18, 2026
90b6b9e
filter
echarlaix Jun 18, 2026
f4475f3
fix dtype for lfm2
echarlaix Jun 18, 2026
d31f22a
style
echarlaix Jun 18, 2026
0b3ba20
fix
echarlaix Jun 19, 2026
d06fead
merge main
echarlaix Jun 22, 2026
ca3d057
deprecate OVModelForVision2Seq
echarlaix Jun 22, 2026
097cbe2
style
echarlaix Jun 22, 2026
f5fb9e6
update docs
echarlaix Jun 22, 2026
bb03c5b
remove gemma4 and from qwen3.5 from preview model workflow
echarlaix Jun 22, 2026
39d921d
merge main
echarlaix Jun 25, 2026
5424017
style
echarlaix Jun 25, 2026
7d44981
filter supported architectures in test_transformations.py
echarlaix Jun 25, 2026
e021e77
should be gemma4_unified_text instead of gemma4_unified
echarlaix Jun 25, 2026
6cc6e4a
fix for eagle patching
echarlaix Jun 25, 2026
c73c7bd
merge main
echarlaix Jul 1, 2026
e2951fb
add gemma3n MIN_TRANSFORMERS_VERSION
echarlaix Jul 1, 2026
206a30d
merge main
echarlaix Jul 3, 2026
136a6df
fix tests
echarlaix Jul 3, 2026
803bf7d
Transformers v5.10
echarlaix Jul 3, 2026
40fe301
fix
echarlaix Jul 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions .github/workflows/test_openvino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
"*quantization*",
"*transformation*",
]
transformers-version: ["4.45.0", "4.57.6", "latest"]
transformers-version: ["5.8.0", "latest"]

runs-on: ubuntu-22.04

Expand Down Expand Up @@ -70,17 +70,7 @@ jobs:
run: |
uv pip install transformers==${{ matrix.transformers-version }}

- if: ${{ matrix.transformers-version == '4.57.6' }}
name: Install qwen-asr package
run: |
uv pip install qwen-asr

- if: ${{ matrix.transformers-version == '4.45.0' }}
name: Install specific dependencies and versions required for older transformers
run: |
uv pip install transformers==${{ matrix.transformers-version }} accelerate==0.* peft==0.13.* diffusers==0.32.* transformers_stream_generator

- if: ${{ matrix.transformers-version != '4.45.0' && matrix.test-pattern == '*decoder*'}}
- if: ${{ matrix.test-pattern == '*decoder*'}}
name: Install auto-gptq, autoawq
run: |
uv pip install auto-gptq "autoawq<0.2.8"
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/test_openvino_preview_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,8 @@ jobs:
run: |
uv pip install --pre -U openvino openvino-tokenizers openvino-genai --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly

- name: Gemma 4 Validation
run: |
uv pip install transformers==5.5.0
pytest tests/openvino/${{ matrix.test-pattern }} -k "gemma4 and not gemma4_unified" --durations=0

- name: Gemma 4 Unified Validation
if: ${{ matrix.test-pattern != '*quantization*' }}
run: |
uv pip install "transformers>=5.10,<5.11"
pytest tests/openvino/${{ matrix.test-pattern }} -k gemma4_unified --durations=0

- name: Qwen3.5 and Qwen3.5-Moe Validation
run: |
uv pip install "transformers>=5.2,<5.3"
pytest tests/openvino/${{ matrix.test-pattern }} -k "qwen3_5 or qwen3_5_moe" --durations=0
pytest tests/openvino/${{ matrix.test-pattern }} -k gemma4_unified --durations=0
7 changes: 1 addition & 6 deletions .github/workflows/test_openvino_slow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "windows-2022"]
transformers-version: ["4.45.0", "latest"]
transformers-version: ["5.8.0", "latest"]
include:
- transformers-version: "main"
os: "ubuntu-22.04"
Expand Down Expand Up @@ -69,11 +69,6 @@ jobs:
path: ~/.cache/huggingface/hub
key: hf-models

- if: ${{ matrix.transformers-version != 'latest' && matrix.transformers-version != 'main' }}
name: Install specific dependencies and versions required for older transformers
run: |
uv pip install transformers==${{ matrix.transformers-version }} accelerate==0.* peft==0.13.* diffusers==0.32.* transformers_stream_generator

- if: ${{ matrix.transformers-version == 'main' }}
name: Install transformers from repository
run: |
Expand Down
2 changes: 1 addition & 1 deletion docs/source/openvino/inference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ As shown in the table below, each task is associated with a class enabling to au
| `OVModelForCausalLM` | `text-generation-with-past` |
| `OVModelForSeq2SeqLM` | `text2text-generation-with-past` |
| `OVModelForSpeechSeq2Seq` | `automatic-speech-recognition` |
| `OVModelForVision2Seq` | `image-to-text` |
| `OVModelForImageTextToText` | `image-to-text` |
| `OVModelForTextToSpeechSeq2Seq` | `text-to-audio` |

### Diffusers models
Expand Down
4 changes: 2 additions & 2 deletions docs/source/openvino/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ The following classes are available for the following computer vision tasks.

The following classes are available for the following multimodal tasks.

### OVModelForVision2Seq
### OVModelForImageTextToText

[[autodoc]] openvino.modeling_seq2seq.OVModelForVision2Seq
[[autodoc]] openvino.modeling_seq2seq.OVModelForImageTextToText
- forward

### OVModelForPix2Struct
Expand Down
7 changes: 2 additions & 5 deletions optimum/exporters/openvino/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE
from requests.exceptions import ConnectionError as RequestsConnectionError
from transformers import AutoConfig, AutoTokenizer, PreTrainedTokenizerBase, ProcessorMixin
from transformers import AutoConfig, AutoTokenizer, Mxfp4Config, PreTrainedTokenizerBase, ProcessorMixin
from transformers.utils import is_torch_available

from openvino import Core, Type, save_model
Expand Down Expand Up @@ -53,9 +53,6 @@
)


if is_transformers_version(">=", "4.55"):
from transformers import Mxfp4Config

FORCE_ATTN_MODEL_CLASSES = {"phi3_v": "eager", "gemma2": "sdpa", "llama4": "sdpa"}

if TYPE_CHECKING:
Expand Down Expand Up @@ -360,7 +357,7 @@ def main_export(
loading_kwargs["config"] = update_config_for_eagle3(config)

# mxfp4 quantized model will be dequantized to bf16
if quant_method == "mxfp4" and is_transformers_version(">=", "4.55"):
if quant_method == "mxfp4":
dtype = torch.bfloat16
loading_kwargs["quantization_config"] = Mxfp4Config(dequantize=True)

Expand Down
14 changes: 7 additions & 7 deletions optimum/exporters/openvino/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,7 @@ def export_from_model(
ensure_export_task_support_stateful(task) or ensure_model_type_support_stateful(model_type)
)

if (
stateful
and is_encoder_decoder
and not getattr(model, "_supports_cache_class", is_transformers_version(">=", "4.54"))
):
if stateful and is_encoder_decoder and not getattr(model, "_supports_cache_class", True):
stateful = False
# TODO: support ov_config.py in the model repo
if custom_architecture and custom_export_configs is None:
Expand Down Expand Up @@ -1245,7 +1241,9 @@ def get_sd3_models_for_export(pipeline, exporter, int_dtype, float_dtype):
text_encoder = getattr(pipeline, "text_encoder", None)
if text_encoder is not None:
text_encoder.config.output_hidden_states = True
text_encoder.text_model.config.output_hidden_states = True
# `CLIPTextTransformer` removed since transformers v5.6
if hasattr(text_encoder, "text_model"):
text_encoder.text_model.config.output_hidden_states = True
text_encoder_config_constructor = TasksManager.get_exporter_config_constructor(
model=text_encoder,
exporter=exporter,
Expand Down Expand Up @@ -1307,7 +1305,9 @@ def get_sd3_models_for_export(pipeline, exporter, int_dtype, float_dtype):
text_encoder_2 = getattr(pipeline, "text_encoder_2", None)
if text_encoder_2 is not None:
text_encoder_2.config.output_hidden_states = True
text_encoder_2.text_model.config.output_hidden_states = True
# `CLIPTextTransformer` removed since transformers v5.6
if hasattr(text_encoder_2, "text_model"):
text_encoder_2.text_model.config.output_hidden_states = True
export_config_constructor = TasksManager.get_exporter_config_constructor(
model=text_encoder_2,
exporter=exporter,
Expand Down
60 changes: 20 additions & 40 deletions optimum/exporters/openvino/input_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
FalconDummyPastKeyValuesGenerator,
MistralDummyPastKeyValuesGenerator,
NormalizedTextConfig,
is_transformers_version,
)
from optimum.utils.input_generators import DTYPE_MAPPER
from optimum.utils.normalized_config import NormalizedConfig, NormalizedVisionConfig
Expand All @@ -42,46 +41,27 @@ def __init__(self, task: str, normalized_config: NormalizedTextConfig, **kwargs)
self.multi_query = normalized_config.multi_query

def generate(self, input_name: str, framework: str = "pt", int_dtype: str = "int64", float_dtype: str = "fp32"):
if is_transformers_version("<", "4.54"):
if self.multi_query:
shape = (
self.batch_size,
self.sequence_length,
self.hidden_size // self.num_attention_heads * 2,
)
else:
shape = (
self.batch_size,
self.num_attention_heads,
self.sequence_length,
self.hidden_size // self.num_attention_heads * 2,
)
pkv = [
self.random_float_tensor(shape, framework=framework, dtype=float_dtype) for _ in range(self.num_layers)
]

if self.multi_query:
shape = (
self.batch_size,
1,
self.sequence_length,
self.hidden_size // self.num_attention_heads,
)
else:
if self.multi_query:
shape = (
self.batch_size,
1,
self.sequence_length,
self.hidden_size // self.num_attention_heads,
)
else:
shape = (
self.batch_size,
self.num_attention_heads,
self.sequence_length,
self.hidden_size // self.num_attention_heads,
)
pkv = [
(
self.random_float_tensor(shape, framework=framework, dtype=float_dtype),
self.random_float_tensor(shape, framework=framework, dtype=float_dtype),
)
for _ in range(self.num_layers)
]
shape = (
self.batch_size,
self.num_attention_heads,
self.sequence_length,
self.hidden_size // self.num_attention_heads,
)
pkv = [
(
self.random_float_tensor(shape, framework=framework, dtype=float_dtype),
self.random_float_tensor(shape, framework=framework, dtype=float_dtype),
)
for _ in range(self.num_layers)
]

return pkv

Expand Down
Loading
Loading