-
Notifications
You must be signed in to change notification settings - Fork 165
[OpenVINO]support Hunyuan LLM #1429
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?
[OpenVINO]support Hunyuan LLM #1429
Conversation
| return dummy_inputs | ||
|
|
||
|
|
||
| class HunyuanDummyPastKeyValuesGenerator(DummyPastKeyValuesGenerator): |
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.
why not use instead MistralDummyPastKeyValuesGenerator and set instead normalized_config.head_dim
| self.random_float_tensor(shape, framework=framework, dtype=float_dtype), | ||
| ) | ||
| for _ in range(self.num_layers) | ||
| ] |
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.
would you mind adding a test as well
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, I will add it once the release version of transformers support this model.
rkazants
left a comment
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.
please add tests for inference: https://github.com/huggingface/optimum-intel/blob/main/tests/openvino/test_modeling.py
Co-authored-by: Roman Kazantsev <[email protected]>
I will add it after this PR |
Let us anticipate that PR to be merged. Then you can add tests to this PR. No need to have several PRs and separate implementation and tests. We need to make sure that inference works. Best regards, |
tests/openvino/test_decoder.py
Outdated
| <<<<<<< HEAD | ||
| "ernie4_5": 2, | ||
| "hunyuan_v1_dense": 2, | ||
| ======= | ||
| >>>>>>> upstream/main |
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.
artifacts of merge, please fix
|
|
||
| @register_in_tasks_manager("hunyuan_v1_dense", *["text-generation", "text-generation-with-past"], library_name="transformers") | ||
| class HunyuanOpenVINOConfig(TextDecoderWithPositionIdsOnnxConfig): | ||
| MIN_TRANSFORMERS_VERSION = "4.55.0.dev0" |
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.
not sure that we need dev0 suffix
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.
since optimum-intel does not support Transformers 4.56, this PR can only work with the commit for Transformers 4.55.
git+https://github.com/huggingface/transformers@4970b23cedaf745f963779b4eae68da281e8c6ca
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.
tests for modelling to test generate() method is needed as well
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.
tests for modelling to test
generate()method is needed as well
its already covered in test_compare_to_transformers i think
|
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. |
|
Hi @openvino-dev-samples #1529 adds support for transformers v4.56 so we can soon merge this PR. looks like some test is currently failing would you mind taking a look ? |
echarlaix
left a comment
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.
Thanks a lot @openvino-dev-samples ! Waiting for #1541 to be merged before we can merge this PR, hopefully this can be done soon cc @rkazants
Co-authored-by: Ella Charlaix <[email protected]>
Co-authored-by: Ella Charlaix <[email protected]>
tests/openvino/test_decoder.py
Outdated
| if is_transformers_version("<", "4.56.0"): | ||
| SUPPORTED_ARCHITECTURES += ("qwen", "chatglm", "chatglm4") | ||
|
|
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.
why it is needed. It looks to be fixed during transition to latest transformers
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.
its just copied from legacy version, and let me remove it.
What does this PR do?
Conversion cmd-line for tencent/Hunyuan-7B-Instruct or Hunyuan-7B-Instruct:
Inference of Hunyuan-7B-Instruct using OpenVINO backend:
Before submitting