Home

Awesome

New to Onnx

What is ONNX Runtime for PyTorch

ONNX Runtime for PyTorch gives you the ability to accelerate training of large transformer PyTorch models. The training time and cost are reduced with just a one line code change.

    from torch_ort import ORTModule
    model = ORTModule(model)

ONNX Runtime Training Examples

This repo has examples for using ONNX Runtime (ORT) for accelerating training of Transformer models. These examples focus on large scale model training and achieving the best performance in Azure Machine Learning service. ONNX Runtime has the capability to train existing PyTorch models (implemented using torch.nn.Module) through its optimized backend. The examples in this repo demonstrate how ORTModule can be used to switch the training backend.

Examples

Outline the examples in the repository.

ExamplePerformance ComparisonModel Change
HuggingFace BARTSee BARTNo model change required
HuggingFace BERTSee BERTNo model change required
HuggingFace DeBERTaSee DeBERTaSee this commit
HuggingFace DistilBERTSee DistilBERTNo model change required
HuggingFace GPT2See GPT2No model change required
HuggingFace RoBERTaSee RoBERTaSee this commit
t5-largeSee T5See this PR
<!-- | `CONTRIBUTING.md` | Guidelines for contributing to the sample. | -->

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.