Skip to content

Conversation

echarlaix
Copy link
Collaborator

@echarlaix echarlaix commented Aug 6, 2025

Fix #1404

@echarlaix echarlaix marked this pull request as draft August 6, 2025 07:52
@echarlaix echarlaix added the openvino-test Trigger OpenVINO slow tests label Aug 6, 2025
@HuggingFaceDocBuilderDev

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.

@@ -4685,14 +4685,18 @@ def gpt_bigcode_attn(self, query, key, value, attention_mask=None, head_mask=Non
class GptBigCodeModelPatcher(OVDecoderModelPatcher):
def __enter__(self):
super().__enter__()
if getattr(self._model.config, "_attn_implementation", "eager") == "sdpa":
Copy link
Collaborator Author

@echarlaix echarlaix Aug 7, 2025

Choose a reason for hiding this comment

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

@@ -3716,7 +3742,42 @@ def patch_model_for_export(
],
library_name="transformers",
)
class GPTBigCodeOpenVINOConfig(GPTBigCodeOnnxConfig):
class GPTBigCodeOpenVINOConfig(TextDecoderWithPositionIdsOnnxConfig):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

following huggingface/transformers#38635, the pkv generation was also updated in GPTBigCodeDummyPastKeyValuesGenerator huggingface/optimum#2336

return attn_output, None, past_key_value
outputs = (attn_output, None)

if is_transformers_version("<", "4.54"):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines 1222 to 1229
"bloom": 5 if is_transformers_version(">=", "4.44") else 0,
"chatglm": 2,
"codegen": 5,
"codegen2": 2,
"gpt2": 5,
"gptj": 5,
"gpt_neo": 4,
"gpt_neox": 5,
"gpt2": 5 if is_transformers_version(">=", "4.42") else 0,
"gptj": 5 if is_transformers_version(">=", "4.42") else 0,
"gpt_neo": 4 if is_transformers_version(">=", "4.42") else 0,
"gpt_neox": 5 if is_transformers_version(">=", "4.42") else 0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

coming from optimum bettertransformers depreciation huggingface/optimum#2305

Copy link
Member

Choose a reason for hiding this comment

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

4.42 or 4.45 might be a good new min version

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes agreed! upgraded to 4.45

@@ -145,7 +146,7 @@
"qwen2": "fxmarty/tiny-dummy-qwen2",
"qwen2_moe": "katuni4ka/tiny-random-qwen1.5-moe",
"qwen2_vl": "katuni4ka/tiny-random-qwen2vl",
"qwen2_5_vl": "katuni4ka/tiny-random-qwen2.5-vl",
"qwen2_5_vl": "optimum-internal-testing/tiny-random-qwen2.5-vl",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

https://huggingface.co/katuni4ka/tiny-random-qwen2.5-vl is not compatible with transformers >= v4.55 coming from
https://github.com/huggingface/transformers/blob/v4.55.0/src/transformers/models/qwen2_5_vl/modeling_qwen2_5_vl.py#L1219

optimum-internal-testing/tiny-random-qwen2.5-vl has the same parameter with out_hidden_size set to 16 to keep compatibility with transformers >= v4.55

"transformers>=4.36,<4.54",
# "optimum==1.27.*",
"optimum-onnx @ git+https://github.com/huggingface/optimum-onnx.git@transformers454",
"transformers>=4.45,<4.56",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

minimum transformers version now set to v4.45 which was released 1 year ago cc @IlyasMoutawwakil @helena-intel @nikita-savelyevv

Copy link
Collaborator

@nikita-savelyevv nikita-savelyevv left a comment

Choose a reason for hiding this comment

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

Great work!



# TODO : complete
TEST_NAME_TO_MODEL_TYPE = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will complete and add a tests before merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openvino-test Trigger OpenVINO slow tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HF - Model Export Issue with OSS models
5 participants