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.
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 language | English |
|---|---|
| Title of host publication | PPoPP '26: Proceedings of the 31st ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming |
| Editors | Tony Hosking, Madan Musuvathi, Kenjiro Taura |
| Place of Publication | New York |
| Publisher | ACM |
| Pages | 452 - 465 |
| Number of pages | 14 |
| ISBN (Electronic) | 9798400723100 |
| DOIs | |
| Publication status | Published - 31 Jan 2026 |
| Event | ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming - Sydney, Australia Duration: 30 Jan 2026 → 4 Feb 2026 https://ppopp26.sigplan.org/ |
Conference
| Conference | ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming |
|---|---|
| Abbreviated title | PPoPP 2026 |
| Country/Territory | Australia |
| City | Sydney |
| Period | 30/01/26 → 4/02/26 |
| Internet address |
Bibliographical note
The source code is publicly available at https://github.com/roastduck/FreeTensorFunding
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).
| Funders | Funder number |
|---|---|
| National Key Research and Development Program of China | 2024YFE0210800 |
| National Natural Science Foundation of China | 62225206, 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
- APA
- Standard
- Harvard
- Vancouver
- Author
- BIBTEX
- RIS