Skip to content

Fixes for ORT 1.13.1#430

Merged
echarlaix merged 4 commits into
huggingface:mainfrom
regisss:fixes
Oct 25, 2022
Merged

Fixes for ORT 1.13.1#430
echarlaix merged 4 commits into
huggingface:mainfrom
regisss:fixes

Conversation

@regisss
Copy link
Copy Markdown
Contributor

@regisss regisss commented Oct 24, 2022

What does this PR do?

This PR fixes a couple of errors that appeared with ORT 1.13.1:

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?

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

HuggingFaceDocBuilderDev commented Oct 24, 2022

The documentation is not available anymore as the PR was closed or merged.

@regisss regisss marked this pull request as ready for review October 24, 2022 18:57
@regisss regisss requested a review from echarlaix October 24, 2022 18:58
Copy link
Copy Markdown
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 for taking care of this @regisss !

Comment thread optimum/onnxruntime/quantization.py Outdated
mode=quantization_config.mode,
weight_qType=quantization_config.weights_dtype,
input_qType=quantization_config.activations_dtype,
activation_qType=quantization_config.activations_dtype,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In order for us to support onnxruntime version lower than 1.13.1, could you adapt the quantizer_factory behavior depending on which onnxruntime version is used ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're absolutely right, I just added it!

Copy link
Copy Markdown
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 a lot @regisss

@echarlaix echarlaix merged commit 9366f84 into huggingface:main Oct 25, 2022
@ghost
Copy link
Copy Markdown

ghost commented Oct 26, 2022

Thank you very much @regisss!

Especially since opimization is currently not working for me because of this missing field:

File "/srv/./app/steps/transformers/convert_transformer_to_onnx_step.py", line 43, in convert_transformer_to_onnx_step
    _ = ORTOptimizer.from_pretrained(
        │            └ <classmethod object at 0x7f9e158abf70>
        └ <class 'optimum.onnxruntime.optimization.ORTOptimizer'>

  File "/usr/local/lib/python3.9/site-packages/optimum/onnxruntime/optimization.py", line 128, in optimize
    optimization_options = FusionOptions.parse(optimization_config)
                           │             │     └ OptimizationConfig(optimization_level=1, optimize_for_gpu=False, fp16=False, optimize_with_onnxruntime_only=False, disable_ge...
                           │             └ <staticmethod object at 0x7f9e15633340>
                           └ <class 'onnxruntime.transformers.fusion_options.FusionOptions'>
  File "/usr/local/lib/python3.9/site-packages/onnxruntime/transformers/fusion_options.py", line 64, in parse
    if args.disable_shape_inference:
       └ OptimizationConfig(optimization_level=1, optimize_for_gpu=False, fp16=False, optimize_with_onnxruntime_only=False, disable_ge...

AttributeError: 'OptimizationConfig' object has no attribute 'disable_shape_inference'

Does anybody know a workaround or should I just wait for the patch? Will it be also cherry picked into 1.3.1 or only directly to 1.4.1?

Thanks!

@regisss regisss deleted the fixes branch October 26, 2022 07:34
@regisss
Copy link
Copy Markdown
Contributor Author

regisss commented Oct 26, 2022

Hi @nmaoez! If you need the fix ASAP, the best is to install Optimum from source as follows:

git clone https://github.com/huggingface/optimum.git
cd optimum/
pip install .[onnxruntime]

A patch is coming very soon but I don't know if this will be integrated to it. Maybe @echarlaix can tell more about this.

@echarlaix
Copy link
Copy Markdown
Collaborator

Hi @nmaoez @regisss, the optimum release 1.4.1 is out

@ghost
Copy link
Copy Markdown

ghost commented Oct 26, 2022

@echarlaix Amazing! Thanks!

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