PyTorch 1.5 adds C++ power, distributed training

PyTorch, the Python framework for quick-and-easy creation of deep learning models, is now out in version 1.5.

PyTorch 1.5 brings a major update to PyTorch’s C++ front end, the C++ interface to PyTorch functionality. The C++ front end now offers complete feature parity with the Python API. Normally one would write PyTorch applications exclusively in Python, but this change makes it readily possible to prototype the application in Python, then move it to C++ without losing any features, or to freely mix C++ and Python.

PyTorch 1.5 also adds a way to bind custom C++ classes to TorchScript and Python. TorchScript lets you create models in Python and run them without Python dependencies—e.g., in C++. The new binding system allows your C++ code to be visible to TorchScript, so C++ objects and memory spaces can be created and manipulated using TorchScript or Python. This feature is still considered experimental.

PyTorch 1.5 also drops support for Python 2 and requires Python 3.5 and higher. This is in line with other major Python frameworks, as Python 2 is now at end-of-life status and is no longer receiving any updates.

Finally, PyTorch 1.5 brings a stable version of the distributed RPC framework and RPC API. Introduced in PyTorch 1.4 as an experimental feature, the RPC framework provides mechanisms for running PyTorch functions on remote machines and thus allows training models across multiple machines for faster training results. 

With PyTorch 1.5, the RPC framework can be used to build training applications that make use of distributed architectures if they’re available. The RPC framework is designed to minimize the amount of data copying across nodes, so work is always done as close to the data as possible.

Copyright © 2020 IDG Communications, Inc.

Source link