Create class AutoOnnxConfig
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.pywith the definition of theAutoOnnxConfigclass - 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 is this PR still needed? I can have a deeper look to merge and close
@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?
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)
Close as outdated.