The PyTorch team has released version 2.0 of the open source machine learning framework. The second main version reflects – after an earlier migration of various components to C++ – more on the programming language Python: The compilation mode torch.compile written in Python has arrived in beta status and now forms the main API of the framework.
Trend-setting and backward compatible
PyTorch’s new direction, with torch.compile towards Python, was what prompted it to be named version 2.0, according to the development team. The new compilation mode torch.compile is intended to significantly increase performance and is based on the new technologies TorchDynamo, AOTAutograd, PrimTorch and TorchInductor written in Python. The development team announced the switch to Python-based compilation mode and how it works in December 2022 and experimentally provided access to it in Nightly Builds.
With PyTorch 2.0, torch.compile has reached beta status. Despite its use as the new main API, the release should be fully backwards compatible, as this is an optional, additive feature. Developers can continue to use the familiar Eager Execution if they choose. However, according to measurements by the PyTorch team using various open source models, the speedup times of the new compilation mode should offer a speed advantage of between 38 and 76 percent.
Stable API and more beta features
In addition to some other beta features such as the PyTorch MPS backend for GPU-accelerated training on Mac platforms and the integration of the funktorch APIs in the torch.func module, the new release also introduces a stable, high-performance implementation of the PyTorch Transformer API one.
With the release of PyTorch 2.0, the PyTorch domain libraries have also received numerous new beta features. For example, in TorchAudio 2.0, new operators are available at torchaudio.functional and torchaudio.transforms. They can be used to synthetically diversify training data to improve the generalizability of downstream models.
The PyTorch blog lists the highlights of version 2.0 and the new library functions. If you want to go into more detail, you can find the complete release notes on GitHub.
To home page
Leave a Reply