Serdar Yegulalp
Senior Writer

PyTorch 1.5 adds C++ power, distributed training

news
Apr 22, 20202 mins

The powerful deep learning system for Python now makes it easier to integrate high performance C++ code and train models on multiple machines at once

fire match ignite flame
Credit: Comfreak

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.

Serdar Yegulalp

Serdar Yegulalp is a senior writer at InfoWorld. A veteran technology journalist, Serdar has been writing about computers, operating systems, databases, programming, and other information technology topics for 30 years. Before joining InfoWorld in 2013, Serdar wrote for Windows Magazine, InformationWeek, Byte, and a slew of other publications. At InfoWorld, Serdar has covered software development, devops, containerization, machine learning, and artificial intelligence, winning several B2B journalism awards including a 2024 Neal Award and a 2025 Azbee Award for best instructional content and best how-to article, respectively. He currently focuses on software development tools and technologies and major programming languages including Python, Rust, Go, Zig, and Wasm. Tune into his weekly Dev with Serdar videos for programming tips and techniques and close looks at programming libraries and tools.

More from this author