Skip to content
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

Fix bf16 inference accuracy for mistral, phi3, dbrx #833

Merged
merged 5 commits into from
Jul 25, 2024

Conversation

eaidova
Copy link
Collaborator

@eaidova eaidova commented Jul 22, 2024

What does this PR do?

I found that range of models where these changes #783 are required are not limited only llama and gemma, the same issue depends on transformers version can be found in phi3, mistral and dbrx.

@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.

@eaidova eaidova requested a review from echarlaix July 23, 2024 06:30
Copy link
Collaborator

@echarlaix echarlaix left a comment

Choose a reason for hiding this comment

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

Thanks @eaidova

optimum/exporters/openvino/model_patcher.py Outdated Show resolved Hide resolved
optimum/exporters/openvino/model_patcher.py Outdated Show resolved Hide resolved
eaidova and others added 2 commits July 23, 2024 14:46
Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
@eaidova
Copy link
Collaborator Author

eaidova commented Jul 24, 2024

@echarlaix could you please merge? These changes are also contributing to support changes in llama model for transformers 4.43

@echarlaix
Copy link
Collaborator

@echarlaix could you please merge? These changes are also contributing to support changes in llama model for transformers 4.43

Couple of tests are failing, can you take a look before we can merge ? test_exporters_cli_int4_with_local_model_and_default_config and test_load_model_from_hub_private_with_token are unrelated

@eaidova
Copy link
Collaborator Author

eaidova commented Jul 24, 2024

@echarlaix all of them unrelated, gpt-bigcode failed due to issue in optimum patcher (not on our level), optimum-cli failed due to removal config for bloomz from default configs (that leads to changes in group size and config not suitable for testing with small model anymore) - I'll take a look separetly, how we can update this test.

mistral/dbrx - I'm looking

@echarlaix
Copy link
Collaborator

@echarlaix all of them unrelated, gpt-bigcode failed due to issue in optimum patcher (not on our level), optimum-cli failed due to removal config for bloomz from default configs (that leads to changes in group size and config not suitable for testing with small model anymore) - I'll take a look separetly, how we can update this test.

mistral/dbrx - I'm looking

Thanks for fixing ! Will take care of the fix for gpt-bigcode

@echarlaix echarlaix merged commit 31430d6 into huggingface:main Jul 25, 2024
13 of 17 checks passed
IlyasMoutawwakil pushed a commit that referenced this pull request Aug 6, 2024
* Fix bf16 inference accuracy for mistral, phi3, dbrx

* reuse inv_freq

* Apply suggestions from code review

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>

* make dim and base optional

* fix model patcher for dbrx and add bitwise fix for mistral

---------

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
IlyasMoutawwakil pushed a commit that referenced this pull request Aug 6, 2024
* Fix bf16 inference accuracy for mistral, phi3, dbrx

* reuse inv_freq

* Apply suggestions from code review

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>

* make dim and base optional

* fix model patcher for dbrx and add bitwise fix for mistral

---------

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
IlyasMoutawwakil pushed a commit that referenced this pull request Aug 6, 2024
* Fix bf16 inference accuracy for mistral, phi3, dbrx

* reuse inv_freq

* Apply suggestions from code review

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>

* make dim and base optional

* fix model patcher for dbrx and add bitwise fix for mistral

---------

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
IlyasMoutawwakil pushed a commit that referenced this pull request Aug 6, 2024
* Fix bf16 inference accuracy for mistral, phi3, dbrx

* reuse inv_freq

* Apply suggestions from code review

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>

* make dim and base optional

* fix model patcher for dbrx and add bitwise fix for mistral

---------

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
IlyasMoutawwakil pushed a commit that referenced this pull request Aug 6, 2024
* Fix bf16 inference accuracy for mistral, phi3, dbrx

* reuse inv_freq

* Apply suggestions from code review

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>

* make dim and base optional

* fix model patcher for dbrx and add bitwise fix for mistral

---------

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
IlyasMoutawwakil pushed a commit that referenced this pull request Aug 6, 2024
* Fix bf16 inference accuracy for mistral, phi3, dbrx

* reuse inv_freq

* Apply suggestions from code review

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>

* make dim and base optional

* fix model patcher for dbrx and add bitwise fix for mistral

---------

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants