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

Adding ONNX support for ImageGPT #819

Merged

Conversation

adit299
Copy link
Contributor

@adit299 adit299 commented Feb 24, 2023

What does this PR do?

Fixes #555

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?

@adit299 adit299 changed the title Commenced work on adding ONNX support for ImageGPT Adding ONNX support for ImageGPT Feb 24, 2023
@adit299
Copy link
Contributor Author

adit299 commented Mar 3, 2023

Hello, I believe I have completed adding ONNX support for ImageGPT. I ran the tests mentioned here (but using imagegpt instead of resnet) and they pass:

Thank you @asrimanth ! You can try:

pip install -e .[tests,exporters]
pytest tests/exporters/onnx/test_*.py -k "regnet" -s

For slow tests:

pip install -e .[tests,exporters]
RUN_SLOW=1 pytest tests/exporters/onnx/test_*.py -k "regnet" -s -m "run_slow"

Please do let me know if everything is good with this PR!

@fxmarty @michaelbenayoun

@adit299 adit299 marked this pull request as ready for review March 3, 2023 02:09
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 3, 2023

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

Copy link
Contributor

@regisss regisss left a comment

Choose a reason for hiding this comment

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

Hi @adit299! It looks very good, just a few more things to do and we will be able to merge it :)

if self._behavior is ConfigBehavior.DECODER:
common_inputs["encoder_outputs"] = {0: "batch_size", 1: "encoder_sequence_length"}

Copy link
Contributor

Choose a reason for hiding this comment

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

The code quality test didn't pass. Can you run the command make style in the root of the Optimum repo (you'll need to have the right packages installed with pip install -e .[dev,exporters])?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -59,6 +59,7 @@
"gptj": "hf-internal-testing/tiny-random-GPTJModel",
"groupvit": "hf-internal-testing/tiny-random-groupvit",
"ibert": "hf-internal-testing/tiny-random-IBertModel",
"imagegpt": "hf-internal-testing/tiny-random-ImageGPTModel",
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you also add an entry below in PYTORCH_EXPORT_MODELS_LARGE for this model for instance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

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.

Thank you for the addition!

@fxmarty fxmarty merged commit 491a85e into huggingface:main Mar 3, 2023
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.

Community contribution - optimum.exporters.onnx support for new models!
4 participants