PyTorch ONNX Export Support - Lara Haidar, Microsoft

PyTorch · Beginner ·📰 AI News & Updates ·6y ago

Key Takeaways

The PyTorch ONNX exporter allows trained models to be easily exported to the ONNX model format, with increased model coverage, improved performance, and support for multiple ONNX opset versions for multiple backends.

Full Transcript

good morning my name is Lara I'm a software engineer at Microsoft in the AI frameworks team in AI frameworks we have teams working on different aspects of pi touch I am part of the PI touch annex team and have been contributing to PI touch to enrich the native onyx exporter as many of you may know onyx is a format represent deep learning and machine learning models it allows to export models from one framework to another making the step from research to production very flexible onyx also allows running models on some of the best hardware available on the market and improved their runtime at Microsoft onyx run time is also getting a lot of attention onyx runtime is a back-end engine that implements the unexpect runs inference on any onyx model today we have billions of requests and hundreds of millions of devices running onyx runtime and you were able to see up to fourteen point six times performance gains on some models running on onyx one time compared to their original frameworks so given these numbers we have many first party customers that are betting on onyx many of which have chosen pi torch as their training frameworks so our mission had been to assist these customers to find an amazing feature in the exporter and enable them let's look into where the onyx exposure fits within the Python code base the onyx exporter provides a simple API that requires that the trained model and the sample input the on the export consists in two main steps the first one is fully orchestrated by the jet tracer in this step we're on a jet trace on the model with the sample input the second step is downstream from the existing jet compiler this is mainly where we have been contributing in the exporter and in this layer we used the torch IR resulted from the jet race and we translated into an onyx IR to which we execute some optimizations to finally get the onyx file we have been working with the fighters team to improve the exporter for more than a year now and we have seen a lot of improvements there are three areas which we aimed to improve on one side we worked towards increasing model coverage and to achieve that we added missing export support for multiple PI torch operators we also worked with many teams who are asking for the ability to support custom operators which we enabled in the exporter we also added support for exporting models with inputs and outputs of variable lengths and finally we made some updates on Onix when the unexpected did not allow us to represent some by touch operators also a priority for Onix is to maintain the high performance of the models so we invested on some optimizations such as constant folding lastly we wanted Onix run on multiple backends and different backends required different versions of Onix previously with fighters we could only export models to one onyx version the oxide version 9 and since we were working with some customers using Wynn ml that even runs with previous versions of onyx we extended the exporter to fully support all ups and versions 7 8 9 and 10 with all these updates were able to enable and improve the performance of multiple production models we count multiple speech models and models for being such as clip classification and connective services models for tagging images and content moderation and many more so we have come far and we still have a lot of projects to improve the exporter once a once again we are aiming on increasing model coverage for that who are currently enabling it onyx is latest up set up set 11 and you will keep on adding with onyx since new updates we are also contributing to the torch vision repo with the help of the PI Church team to make the models onyx its portable on the other side who are making it our priority to improve user experience by limiting the number of user code changes required to export models to tip up to our making some improvements on the export of tensor indexing and you also have some projects involving custom loops for advanced models so these are our updates for onyx I want to take a moment to thank the PI touch team especially Lou thank Michael sOooo Francisco Massa and Joseph a snack and all the people in the beta team who have been helping us and reviewing our work so please use the exporter try it out and we would love to hear your feedback and see any contribution in the Onyx export layer thank you [Applause] [Music]

Original Description

The PyTorch ONNX exporter allows trained models to be easily exported to the ONNX model format. Learn about the latest updates including increased model coverage, improved performance, and support for multiple ONNX opset versions for multiple backends.
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from PyTorch · PyTorch · 25 of 60

1 What is PyTorch?
What is PyTorch?
PyTorch
2 PyTorch Tutorial: A Quick Preview
PyTorch Tutorial: A Quick Preview
PyTorch
3 PyTorch Summer Hackathon 2019
PyTorch Summer Hackathon 2019
PyTorch
4 Tips and Tricks on Hacking with PyTorch: A Quick Tutorial by Brad Heintz
Tips and Tricks on Hacking with PyTorch: A Quick Tutorial by Brad Heintz
PyTorch
5 PyTorch 1.2 and PyTorch Hub: A Quick Introduction by Soumith Chintala and Ailing Zhang
PyTorch 1.2 and PyTorch Hub: A Quick Introduction by Soumith Chintala and Ailing Zhang
PyTorch
6 Torchtext 0.4 with Supervised Learning Datasets: A Quick Introduction by George Zhang
Torchtext 0.4 with Supervised Learning Datasets: A Quick Introduction by George Zhang
PyTorch
7 Torchaudio 0.3 with Kaldi Compatibility, New Transforms: A Quick Introduction by Jason Lian
Torchaudio 0.3 with Kaldi Compatibility, New Transforms: A Quick Introduction by Jason Lian
PyTorch
8 Torchvision 0.4 with Support for Video: A Quick Introduction by Francisco Massa
Torchvision 0.4 with Support for Video: A Quick Introduction by Francisco Massa
PyTorch
9 Introduction to Machine Learning for Developers at F8 2019
Introduction to Machine Learning for Developers at F8 2019
PyTorch
10 Powered by PyTorch at F8 2019
Powered by PyTorch at F8 2019
PyTorch
11 Developing and Scaling AI Experiences at Facebook with PyTorch at F8 2019
Developing and Scaling AI Experiences at Facebook with PyTorch at F8 2019
PyTorch
12 New Approaches to Image and Video Reconstruction Using Deep Learning at Facebook at F8 2019
New Approaches to Image and Video Reconstruction Using Deep Learning at Facebook at F8 2019
PyTorch
13 PyTorch Developer Conference 2018: Recap
PyTorch Developer Conference 2018: Recap
PyTorch
14 PyTorch Developer Conference 2018: Keynote & Deep Dive
PyTorch Developer Conference 2018: Keynote & Deep Dive
PyTorch
15 PyTorch Developer Conference 2018: Production & Research Sessions
PyTorch Developer Conference 2018: Production & Research Sessions
PyTorch
16 PyTorch Developer Conference 2018: Cloud & Academia Sessions
PyTorch Developer Conference 2018: Cloud & Academia Sessions
PyTorch
17 PyTorch Developer Conference 2018: Enterprise, Education, & Future of AI Panel
PyTorch Developer Conference 2018: Enterprise, Education, & Future of AI Panel
PyTorch
18 PyTorch Developer Conference 2019 | Full Livestream
PyTorch Developer Conference 2019 | Full Livestream
PyTorch
19 PyTorch Developer Conference 2019: Recap
PyTorch Developer Conference 2019: Recap
PyTorch
20 PyTorch Developer Conference Keynote - Mike Schroepfer
PyTorch Developer Conference Keynote - Mike Schroepfer
PyTorch
21 What’s new in PyTorch 1.3 - Lin Qiao
What’s new in PyTorch 1.3 - Lin Qiao
PyTorch
22 PyTorch Front-End Features: Named Tensors and Type Promotion - Gregory Chanan
PyTorch Front-End Features: Named Tensors and Type Promotion - Gregory Chanan
PyTorch
23 Research to Production: PyTorch JIT/TorchScript Updates - Michael Suo
Research to Production: PyTorch JIT/TorchScript Updates - Michael Suo
PyTorch
24 Quantization - Dmytro Dzhulgakov
Quantization - Dmytro Dzhulgakov
PyTorch
PyTorch ONNX Export Support - Lara Haidar, Microsoft
PyTorch ONNX Export Support - Lara Haidar, Microsoft
PyTorch
26 Apex -  Michael Carilli, NVIDIA
Apex - Michael Carilli, NVIDIA
PyTorch
27 Dataloader Design for PyTorch - Tongzhou Wang, MIT
Dataloader Design for PyTorch - Tongzhou Wang, MIT
PyTorch
28 Linear Algebra in PyTorch - Vishwak Srinivasan, CMU
Linear Algebra in PyTorch - Vishwak Srinivasan, CMU
PyTorch
29 PyTorch Mobile - David Reiss
PyTorch Mobile - David Reiss
PyTorch
30 Model Interpretability with Captum - Narine Kokhilkyan
Model Interpretability with Captum - Narine Kokhilkyan
PyTorch
31 Detectron2 - Next Gen Object Detection Library - Yuxin Wu
Detectron2 - Next Gen Object Detection Library - Yuxin Wu
PyTorch
32 Speech Extensions to Fairseq - Dmytro Okhonko
Speech Extensions to Fairseq - Dmytro Okhonko
PyTorch
33 PyTorch on Google Cloud TPUs - Google, Salesforce, Facebook
PyTorch on Google Cloud TPUs - Google, Salesforce, Facebook
PyTorch
34 PyTorch Summer Hackathon Winners - Joe Spisak, Sebastien Arnold, Tristan Deleu
PyTorch Summer Hackathon Winners - Joe Spisak, Sebastien Arnold, Tristan Deleu
PyTorch
35 PyTorch in Robotics - Yisong Yue, Caltech
PyTorch in Robotics - Yisong Yue, Caltech
PyTorch
36 StanfordNLP - Yuhao Zhang, Stanford
StanfordNLP - Yuhao Zhang, Stanford
PyTorch
37 Sotabench for Reproducible Research - Robert Stojnic, Papers with Code
Sotabench for Reproducible Research - Robert Stojnic, Papers with Code
PyTorch
38 Collaborative Natural Language Inference - Sasha Rush, Cornell
Collaborative Natural Language Inference - Sasha Rush, Cornell
PyTorch
39 Privacy Preserving AI - Andrew Trask, OpenMined
Privacy Preserving AI - Andrew Trask, OpenMined
PyTorch
40 CrypTen - Laurens van der Maaten
CrypTen - Laurens van der Maaten
PyTorch
41 PyTorch at Uber - Sidney Zhang, Uber
PyTorch at Uber - Sidney Zhang, Uber
PyTorch
42 PyTorch at Tesla - Andrej Karpathy, Tesla
PyTorch at Tesla - Andrej Karpathy, Tesla
PyTorch
43 PyTorch at Microsoft - Saurabh Tiwary, Microsoft
PyTorch at Microsoft - Saurabh Tiwary, Microsoft
PyTorch
44 PyTorch at Dolby Labs - Vivek Kumar, Dolby Labs
PyTorch at Dolby Labs - Vivek Kumar, Dolby Labs
PyTorch
45 PyTorch Developer Conference 2019 - Panel Discussion
PyTorch Developer Conference 2019 - Panel Discussion
PyTorch
46 Using deep learning and PyTorch to power next gen aircraft at Caltech
Using deep learning and PyTorch to power next gen aircraft at Caltech
PyTorch
47 Named Tensors, Model Quantization, and the Latest PyTorch Features - Part 1
Named Tensors, Model Quantization, and the Latest PyTorch Features - Part 1
PyTorch
48 TorchScript and PyTorch JIT | Deep Dive
TorchScript and PyTorch JIT | Deep Dive
PyTorch
49 Announcing the PyTorch Global Summer Hackathon 2020
Announcing the PyTorch Global Summer Hackathon 2020
PyTorch
50 Opening Up the Black Box: Model Understanding with Captum and PyTorch
Opening Up the Black Box: Model Understanding with Captum and PyTorch
PyTorch
51 PyTorch Mobile Runtime for Android
PyTorch Mobile Runtime for Android
PyTorch
52 Torchvision in 5 minutes
Torchvision in 5 minutes
PyTorch
53 3D Deep Learning with PyTorch3D
3D Deep Learning with PyTorch3D
PyTorch
54 What is Torchtext?
What is Torchtext?
PyTorch
55 TorchAudio: A Quick Intro
TorchAudio: A Quick Intro
PyTorch
56 PyTorch Mobile Runtime for iOS
PyTorch Mobile Runtime for iOS
PyTorch
57 PySlowFast: Deep learning with Video
PySlowFast: Deep learning with Video
PyTorch
58 PyTorch Pruning | How it's Made by Michela Paganini
PyTorch Pruning | How it's Made by Michela Paganini
PyTorch
59 Measuring Fairness in Machine Learning Systems
Measuring Fairness in Machine Learning Systems
PyTorch
60 PyTorch for Hackathons
PyTorch for Hackathons
PyTorch

The PyTorch ONNX exporter enables easy export of trained models to the ONNX format, with improved performance and support for multiple backends. This allows for flexible deployment of models from research to production.

Key Takeaways
  1. Install PyTorch and ONNX
  2. Train a model using PyTorch
  3. Export the model to ONNX format using the PyTorch ONNX exporter
  4. Optimize the model for performance
  5. Deploy the model to a production environment
💡 The PyTorch ONNX exporter provides a simple API for exporting trained models to the ONNX format, allowing for improved performance and flexible deployment to multiple backends.

Related AI Lessons

Up next
Man dies after horror Gold Coast house fire; high-speed Sydney motorway pursuit | 9 News Australia
9 News Australia
Watch →