Compiling the Model
Paraphrasing one of the famous presenters: “It’s time!” After completing our initial steps toward performance improvement, it is time to learn a new capability of PyTorch 2.0 to accelerate the training and inference of deep learning models.
We are talking about the Compile API, which was presented in PyTorch 2.0 as one of the most exciting capabilities of this new version. In this chapter, we will learn how to use this API to build a faster model to optimize the execution of its training phase.
Here is what you will learn as part of this chapter:
- The benefits of graph mode over eager mode
- How to use the API to compile a model
- The components, workflow, and backends used by the API