-
Notifications
You must be signed in to change notification settings - Fork 143
Add support transformers v4.54 v4.55 #1406
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
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": |
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.
@@ -3716,7 +3742,42 @@ def patch_model_for_export( | |||
], | |||
library_name="transformers", | |||
) | |||
class GPTBigCodeOpenVINOConfig(GPTBigCodeOnnxConfig): | |||
class GPTBigCodeOpenVINOConfig(TextDecoderWithPositionIdsOnnxConfig): |
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.
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"): |
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.
following huggingface/transformers#38635
tests/openvino/test_modeling.py
Outdated
"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, |
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.
coming from optimum bettertransformers depreciation huggingface/optimum#2305
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.
4.42 or 4.45 might be a good new min version
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.
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", |
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.
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", |
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.
minimum transformers version now set to v4.45 which was released 1 year ago cc @IlyasMoutawwakil @helena-intel @nikita-savelyevv
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.
Great work!
|
||
|
||
# TODO : complete | ||
TEST_NAME_TO_MODEL_TYPE = { |
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.
will complete and add a tests before merging
Fix #1404