optimum icon indicating copy to clipboard operation
optimum copied to clipboard

Create class AutoOnnxConfig

Open JingyaHuang opened this issue 3 years ago • 3 comments

What does this PR do?

Add AutoOnnxConfig class to optimum.onnx.auto to enable automatic instantiation of onnx configuration.

Changes

  • Add optimum/onnx/auto/configuartion_onnx_auto.py with the definition of the AutoOnnxConfig class
  • Update optimum/onnx/auto/__init__.py
  • Add the corresponding test in tests/onnx/test_configuration_auto.py

Goal

Wrap the XXXOnnxConfig directly on the top of transformers configuration.

Reviewers

@echarlaix @michaelbenayoun @mfuntowicz

JingyaHuang avatar Feb 04 '22 00:02 JingyaHuang

@JingyaHuang is this PR still needed? I can have a deeper look to merge and close

mfuntowicz avatar May 30 '22 12:05 mfuntowicz

@JingyaHuang is this PR still needed? I can have a deeper look to merge and close

Hi @mfuntowicz, Yes, I think so. Besides, at this point, I think that would be even more interesting as we are having more and more wrappers for the basic OnnxConfig. I am thinking of refactoring this according to the updates recently, WDYT?

JingyaHuang avatar Jun 01 '22 13:06 JingyaHuang

Pinging @mfuntowicz for a review. A refactoring of AutoOnnxConfig is done. Can you take a look? Then it will be ready to merge. Currently, it can just wraps the corresponding xxxOnnxConfig over the xxxxConfig. As now we have wrappers to include non-default inputs (eg. OnnxConfigWithLoss), does it make sense to you to add some flags in AutoOnnxConfig like this:

from optimum import AutoOnnxConfig
onnx_config = AutoOnnxConfig("bert-base-uncased", with_loss=True)

JingyaHuang avatar Jun 15 '22 16:06 JingyaHuang

Close as outdated.

JingyaHuang avatar Nov 24 '22 14:11 JingyaHuang