-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[ONNX 1] Add Backend section to the left page of Tutorials layout page #2550
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
Merged
svekars
merged 2 commits into
pytorch:main
from
thiagocrepaldi:thiagofc/create-onnx-section
Oct 4, 2023
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ONNX | ||
---- | ||
|
||
1. intro_onnx.py | ||
Introduction to ONNX | ||
https://pytorch.org/tutorials/onnx/intro_onnx.html | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
""" | ||
**Introduction to ONNX** | ||
|
||
Introduction to ONNX | ||
==================== | ||
|
||
Authors: | ||
`Thiago Crepaldi <https://github.com/thiagocrepaldi>`_, | ||
|
||
`Open Neural Network eXchange (ONNX) <https://onnx.ai/>`_ is an open standard | ||
format for representing machine learning models. The ``torch.onnx`` module provides APIs to | ||
capture the computation graph from a native PyTorch :class:`torch.nn.Module` model and convert | ||
it into an `ONNX graph <https://github.com/onnx/onnx/blob/main/docs/IR.md>`_. | ||
|
||
The exported model can be consumed by any of the many | ||
`runtimes that support ONNX <https://onnx.ai/supported-tools.html#deployModel>`_, | ||
including Microsoft's `ONNX Runtime <https://www.onnxruntime.ai>`_. | ||
|
||
.. note:: | ||
Currently, there are two flavors of ONNX exporter APIs, | ||
but this tutorial will focus on the ``torch.onnx.dynamo_export``. | ||
|
||
The TorchDynamo engine is leveraged to hook into Python's frame evaluation API and dynamically rewrite its | ||
bytecode into an `FX graph <https://pytorch.org/docs/stable/fx.html>`_. | ||
The resulting FX Graph is polished before it is finally translated into an | ||
`ONNX graph <https://github.com/onnx/onnx/blob/main/docs/IR.md>`_. | ||
|
||
The main advantage of this approach is that the `FX graph <https://pytorch.org/docs/stable/fx.html>`_ is captured using | ||
bytecode analysis that preserves the dynamic nature of the model instead of using traditional static tracing techniques. | ||
|
||
Dependencies | ||
------------ | ||
|
||
The ONNX exporter depends on extra Python packages: | ||
|
||
- `ONNX <https://onnx.ai>`_ | ||
- `ONNX Script <https://onnxscript.ai>`_ | ||
|
||
They can be installed through `pip <https://pypi.org/project/pip/>`_: | ||
|
||
.. code-block:: bash | ||
|
||
pip install --upgrade onnx onnxscript | ||
|
||
.. include:: /beginner_source/basics/onnx_toc.txt | ||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
""" |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.