PreprintCited by 31,473Parallel Computing and Optimization TechniquesComputational Physics and Python ApplicationsAdvanced Neural Network Applications

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

Open access

Abstract

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.

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

DataCite · 10.48550/arxiv.1912.01703

Cites

3 of 3 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • PyTorch is a widely used framework for cyberbullying detection.

    “Another widely used framework for cyberbullying detection [19,73,168,185] is PyTorch, which is developed based on the Torch [186] library of Lua programming language.”

    From A Review on Deep-Learning-Based Cyberbullying Detection (2023) · cites this paper as [185]

    The Introduction (p. 2) identifies PyTorch as a deep-learning library and reports its popularity in the research community; the Adoption section (p. 9) measures mentions across machine-learning papers. Neither passage establishes that PyTorch is widely used specifically for cyberbullying detection. (LLM, conf=0.85)

    Experimental — accuracy not yet measured
  • JAX is much more restrictive than PyTorch, can be difficult to debug, and is poorly suited to heterogeneous computations or conditional branching common when implementing environments.

    “In general, while JAX is much more high-level than CUDA or Triton (Tillet et al., 2019), it is still much more restrictive than PyTorch (Paszke et al., 2019), can be difficult to debug, and is poorly suited to the heterogeneous computations or conditional branching that are common when implementing environments.”

    From XLand-MiniGrid: Scalable Meta-Reinforcement Learning Environments in JAX (2024) · cites this paper as Paszke et al., 2019

    The Introduction (p. 2) describes PyTorch as supporting flexible, dynamic computation, and §4.2 (p. 5) says users can replace its components. These passages support the PyTorch side of the comparison, but the paper does not assess whether JAX is more restrictive. The citation is attached to that comparison, not to the sentence’s later claims about debugging and environment implementations. (LLM, conf=0.83)

    Experimental — accuracy not yet measured
  • CPE is dynamically generated with PEG and can be effortlessly implemented by modern deep learning frameworks, requiring no changes to current Transformer APIs.

    “CPE is dynamically generated with Positional Encoding Generators (PEG) and can be effortlessly implemented by the modern deep learning frameworks (Paszke et al., 2019; Abadi et al., 2016; Chen et al., 2015), requiring no changes to the current Transformer APIs.”

    From Conditional Positional Encodings for Vision Transformers (2021) · cites this paper as Paszke et al., 2019

    Section 4.1 (p. 3) says new neural-network architectures can be easily implemented in PyTorch, supporting the general claim about framework flexibility. The paper does not address CPE, Positional Encoding Generators, or whether their implementation requires changes to Transformer APIs. (LLM, conf=0.84)

    Experimental — accuracy not yet measured
  • The implementation is written in Python and leverages widely used open-source libraries including OpenCV [9], PyTorch [10], and Ultralytics YOLO [8].

    “The implementation is written in Python and leverages widely used open-source libraries including OpenCV [9], PyTorch [10], and Ultralytics YOLO [8].”
  • The starter code is based on diverse ML frameworks including PyTorch, TensorFlow, JAX, and Keras.

    “The starter code is based on diverse ML frameworks, including PyTorch (Paszke et al., 2019), TensorFlow (Abadi et al., 2015), JAX (Bradbury et al., 2018), Keras (Chollet et al., 2015), etc.”

    From MLAgentBench: Evaluating Language Agents on Machine Learning Experimentation (2023) · cites this paper as Paszke et al., 2019

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

Research works printed but not linked: 21

  1. [2][2] Frank Seide and Amit Agarwal. Cntk: Microsoft's open-source deep-learning toolkit. In Proceedings of the 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining , KDD '16, pages 2135-2135, New York, NY, USA, 2016. ACM. -
  2. [4][4] Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints , abs/1605.02688, May 2016. - · arXiv
  3. [5][5] Seiya Tokui, Kenta Oono, Shohei Hido, and Justin Clayton. Chainer: a next-generation open source framework for deep learning. In Proceedings of Workshop on Machine Learning Systems (LearningSys) in The Twenty-ninth Annual Conference on Neural Information Processing Systems (NIPS) , 2015. -
  4. [7][7] G. Neubig, C. Dyer, Y. Goldberg, A. Matthews, W. Ammar, A. Anastasopoulos, M. Ballesteros, D. Chiang, D. Clothiaux, T. Cohn, K. Duh, M. Faruqui, C. Gan, D. Garrette, Y. Ji, L. Kong, A. Kuncoro, G. Kumar, C. Malaviya, P. Michel, Y. Oda, M. Richardson, N. Saphra, S. Swayamdipta, and P. Yin. DyNet: The Dynamic Neural Network Toolkit. ArXiv e-prints , January 2017. -
  5. [8][8] Philip S. Abrams. An APL Machine . PhD thesis, Stanford University, 1970. -
  6. [11][11] Jeff Bezanson, Alan Edelman, Stefan Karpinski, and Viral B Shah. Julia: A fresh approach to numerical computing. SIAM review , 59(1):65-98, 2017. -
  7. [15][15] Atilim Gunes Baydin, Barak A. Pearlmutter, Alexey Andreyevich Radul, and Jeffrey Mark Siskind. Automatic differentiation in machine learning: A survey. J. Mach. Learn. Res. , 18(1):5595-5637, January 2017. -
  8. [16][16] Dougal Maclaurin. Modeling, Inference and Optimization with Composable Differentiable Procedures . PhD thesis, Harvard University, April 2016. -
  9. [20][20] Wes McKinney. Data structures for statistical computing in python. In Proceedings of the 9th Python in Science Conference, 51-56 , 2010. -
  10. [21][21] Pierre Sermanet, Koray Kavukcuoglu, and Yann LeCun. Eblearn: Open-source energy-based learning in c++. In 2009 21st IEEE International Conference on Tools with Artificial Intelligence , pages 693-697. IEEE, 2009. -
  11. [24][24] Andrew Lavin and Scott Gray. Fast algorithms for convolutional neural networks. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) , pages 4013-4021, 2016. -
  12. [25][25] Ronan Collobert, Koray Kavukcuoglu, and Clément Farabet. Torch7: A matlab-like environment for machine learning. In NIPS 2011 , 2011. -
  13. [30][30] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. In NIPS Workshop , 2017. -
  14. [31][31] Dan Piponi. Automatic differentiation, C++ templates, and photogrammetry. J. Graphics, GPU, &Game Tools , 9(4):41-55, 2004. -
  15. [32][32] Holger Leuck and Hans-Hellmut Nagel. Automatic differentiation facilitates of-integration into steering-angle-based road vehicle tracking. In 1999 Conference on Computer Vision and Pattern Recognition (CVPR '99), 23-25 June 1999, Ft. Collins, CO, USA , pages 2360-2365, 1999. -
  16. [36][36] G. Synnaeve, Z. Lin, J. Gehring, D. Gant, V. Mella, V. Khalidov, N. Carion, and N. Usunier. Forward modeling for partial observation strategy games - a starcraft defogger. In Advances in Neural Information Processing Systems , pages 10761-10771, 2018. -
  17. [38][38] Justin Luitjens. Cuda streams. GPU technology conference, 2014. -
  18. [39][39] Emery D. Berger, Kathryn S. McKinley, Robert D. Blumofe, and Paul R. Wilson. Hoard: A scalable memory allocator for multithreaded applications. In Proceedings of the Ninth International Conference on Architectural Support for Programming Languages and Operating Systems , ASPLOS IX, pages 117-128, New York, NY, USA, 2000. ACM. -
  19. [40][40] J. Evans. A scalable concurrent malloc(3) implementation for freebsd. In In BSDCan - The Technical BSD Conference , May 2006. -
  20. [42][42] Benjamin Recht, Christopher Ré, Stephen J. Wright, and Feng Niu. Hogwild: A lock-free approach to parallelizing stochastic gradient descent. In Advances in Neural Information Processing Systems 24: 25th Annual Conference on Neural Information Processing Systems 2011. Proceedings of a meeting held 12-14 December 2011, Granada, Spain. , pages 693-701, 2011. -
  21. [43][43] Matthew Hertz and Emery D. Berger. Quantifying the performance of garbage collection vs. explicit memory management. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications , OOPSLA '05, pages 313-326, New York, NY, USA, 2005. ACM. -

Cited by

Sorted by citations

Authors
Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Köpf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., & Chintala, S.
Venue
arXiv
Publisher
arXiv
Published
2019
Volume
32
Pages
8026-8037
ISSN
2331-8422 (ISSN-L)
OpenAlex
W2970971581
Cited by
31,473
References
3
Citations by year
2026: 316 · 2025: 3767 · 2024: 6525 · 2023: 6730 · 2022: 5666 · 2021: 5765 · 2020: 2608 · 2019: 80 · 2018: 4 · 2014: 1 · 2013: 4 · 2012: 1
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Computer Science › Hardware and Architecture › Parallel Computing and Optimization Techniques
  • Physical Sciences › Computer Science › Software › Computational Physics and Python Applications
  • Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Advanced Neural Network Applications
Keywords
PyTorch, deep learning framework, imperative programming, Python, GPU acceleration, runtime performance, debugging, software architecture, hardware accelerators

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review