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

Read use_external_data_format from ORTConfig file #1917

Merged

Conversation

idruker-cerence
Copy link
Contributor

@idruker-cerence idruker-cerence commented Jun 21, 2024

When quantizing the models >2Gb, it's important to set the flag use_external_data_format to 'true',
since otherwise the quantization will fail due to

ValueError: Message onnx.ModelProto exceeds maximum protobuf size of 2GB

However, currently there is no way to set the parameter when using optimum-cli because there is no such
command option. Theoretically, it could be set when using ORTConfig file with -c comman flag, because one of the configuration parameters in it is use_external_data_format. In fact, the optimum code ignores it and does not pass it in quantize() function.

The goal of this change is to close this gap.

What does this PR do?

Fixes #1916

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

Copy link
Contributor

@fxmarty fxmarty left a comment

Choose a reason for hiding this comment

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

LGTM thank you!

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

@IlyasMoutawwakil
Copy link
Member

Thanks @idruker-cerence
can you please run make style (after pip install -e .[quality])

When quantizing the models >2Gb, it's important to
set the flag use_external_data_format to 'true',
since otherwise the quantization will fail due to

`ValueError: Message onnx.ModelProto exceeds maximum protobuf size of 2GB`

However, currently there is no way to set the parameter
when using optimum-cli because there is no such
command option. Theoretically, it could be set when
using ORTConfig file with -c comman flag, because one
of the configuration parameters in it is use_external_data_format.
In fact, the optimum code ignores it and does not pass it
in quantize() function.

The goal of this change is to close this gap.
@IlyasMoutawwakil IlyasMoutawwakil merged commit 2db03d4 into huggingface:main Jun 25, 2024
40 of 45 checks passed
@idruker-cerence idruker-cerence deleted the use_external_data_format branch June 25, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants