Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

PyTorch: An Imperative Style, High-Performance Deep Learning Library

About

Deep learning frameworks have often focused on either usability or speed, but not both. PyTorch is a machine learning library that shows that these two goals are in fact compatible: it provides an imperative and Pythonic programming style that supports code as a model, makes debugging easy and is consistent with other popular scientific computing libraries, while remaining efficient and supporting hardware accelerators such as GPUs. In this paper, we detail the principles that drove the implementation of PyTorch and how they are reflected in its architecture. We emphasize that every aspect of PyTorch is a regular Python program under the full control of its user. We also explain how the careful and pragmatic implementation of the key components of its runtime enables them to work together to achieve compelling performance. We demonstrate the efficiency of individual subsystems, as well as the overall speed of PyTorch on several common benchmarks.

Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas K\"opf, Edward Yang, Zach DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, Soumith Chintala• 2019

Related benchmarks

TaskDatasetResultRank
Image ClassificationCIFAR-100--
691
Image ClassificationImageNet-100 (val)
Top-1 Accuracy82.23
250
Image ClassificationSTL-10
Top-1 Accuracy82.28
146
Image ClassificationCIFAR-10
Top-1 Accuracy79.83
124
Medical Image SegmentationISIC
DICE77.1
114
Attention Operator ThroughputLlama 405B (128 Q-heads/8 KV-heads/128 Head-dimension) 3.1--
62
Training Efficiency MeasurementLlama S=512 on B200 3.1-8B (base variant)
Peak Memory Usage (GiB)6.7
58
Efficiency BenchmarkingLlama 8B base variant on H200 3.1
Per-step Latency (ms)150.9
49
Training Efficiency ProfilingQwen3 family S=512 (train profiling)
Per-Step Latency (ms)107.3
43
Training Efficiency ProfilingQwen3 family S=1024 (train profiling)
Per-Step Latency (ms)106.4
42
Showing 10 of 108 rows
...

Other info

Follow for update