Skip to main navigation Skip to search Skip to main content

ParDiff: Efficiently Parallelizing Reverse-Mode Automatic Differentiation with Direct Indexing

  • Shuhong Huang* (Corresponding Author)
  • , Shizhi Tang* (Corresponding Author)
  • , Yuan Wen
  • , Huanqi Cao
  • , Ruibai Tang
  • , Yidong Chen
  • , Jiping Yu
  • , Yang Li
  • , Chao Jiang
  • , Limin Xiao
  • , Jidong Zhai* (Corresponding Author)
  • *Corresponding author for this work
  • Tsinghua University
  • Qingcheng.AI
  • Wuhan University
  • Lenovo

Research output: Chapter in Book/Report/Conference proceedingPublished conference contribution

Abstract

Automatic Differentiation (AD) is a technique that computes the derivatives of numerical programs by systematically applying the chain rule, playing a critical role in domains such as machine learning, simulation, and control systems. However, parallelizing differentiated programs remains a significant challenge due to the conflict between tapes (a data structure for intermediate variable storage) and summations: the differentiation process inherently introduces inter-thread summation patterns, which require prohibitively expensive atomic operations; and traditional tape designs tightly couple data retrieval with the program’s control flow, preventing code restructuring needed to eliminate these costly dependencies.
To address these challenges, we present ParDiff, a novel AD system with a direct-indexed tape design, which enables summation-aware loop transformations and various parallel schemes for differentiated programs. This results in a higher degree of parallelization, less synchronization, and reduced inter-thread data movement. We conduct comprehensive experiments on both multi-core CPUs and GPUs. Results show that ParDiff delivers up to 483.21× (geometric mean: 30.88×) speedup over the state-of-the-art fully-AD system, Enzyme. It also achieves a speedup of 2.05× and 2.06× over PyTorch on CPU and GPU, respectively. The source code is publicly available at https://github.com/roastduck/FreeTensor.
Original languageEnglish
Title of host publicationPPoPP '26: Proceedings of the 31st ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming
EditorsTony Hosking, Madan Musuvathi, Kenjiro Taura
Place of PublicationNew York
PublisherACM
Pages452 - 465
Number of pages14
ISBN (Electronic)9798400723100
DOIs
Publication statusPublished - 31 Jan 2026
EventACM SIGPLAN Symposium on Principles and Practice of Parallel Programming - Sydney, Australia
Duration: 30 Jan 20264 Feb 2026
https://ppopp26.sigplan.org/

Conference

ConferenceACM SIGPLAN Symposium on Principles and Practice of Parallel Programming
Abbreviated titlePPoPP 2026
Country/TerritoryAustralia
CitySydney
Period30/01/264/02/26
Internet address

Bibliographical note

The source code is publicly available at https://github.com/roastduck/FreeTensor

Funding

Wewould like to thank the anonymous reviewers for their insightful comments. This work is supported by the National Key R&D Program of China under Grant 2024YFE0210800, NSFC forDistinguished Young Scholar under Grant 62225206, National Natural Science Foundation of China under Grants 62532006, 62495062, U23A6007, 6250070824, Beijing Natural Science Foundation under Grant L242017, and China Postdoctoral Science Fund (NO. 2024M761688).

FundersFunder number
National Key Research and Development Program of China 2024YFE0210800
National Natural Science Foundation of China62225206, 62532006, 62495062, U23A6007, 6250070824

    Fingerprint

    Dive into the research topics of 'ParDiff: Efficiently Parallelizing Reverse-Mode Automatic Differentiation with Direct Indexing'. Together they form a unique fingerprint.

    Cite this