Skip to main content

Tapeflow: Streaming gradient tapes in automatic differentiation

Resource type
Thesis type
(Thesis) M.Sc.
Date created
2023-06-21
Authors/Contributors
Abstract
Computing gradients is a fundamental task in a variety of fields, ranging from machine learning to physics simulations and scientific computing. Automatic differentiation (AD) is a widely used technique for computing gradients of arbitrary imperative code. In AD, the gradient tape is an auxiliary data structure that is used to transfer intermediary values required for gradient computation. However, managing the gradient tape in memory presents a significant challenge, as existing approaches suffer from limitations in spatial reuse, on-chip energy consumption, and cache size requirements. These limitations highlight the need for a new and efficient solution. We present Tapeflow, a novel compiler framework that efficiently orchestrates and manages the gradient tape. Our approach offers three key contributions. First, we introduce the concept of regions, which transform the tape layout into an array-of-structs format, enhancing spatial reuse. Second, we schedule the execution into layers and explicitly orchestrate the tape operands using a scratchpad, effectively reducing required cache size and on-chip energy. Third, we stream the tape from the DRAM by organizing it into a FIFO of tiles, with tape operands arriving just-in-time for each layer. To evaluate the effectiveness of our approach, we conducted experiments on a wide range of algorithms across various domains. Our results show that Tapeflow outperforms Enzyme, the state-of-the-art compiler, by 1.3-2.5×, reduces on-chip SRAM usage by 5-40×, and saves 8× on-chip energy. By providing a general solution that does not rely on domain-specific knowledge, Tapeflow has the potential to significantly improve gradient tape management in various applications.
Document
Extent
61 pages.
Identifier
etd22532
Copyright statement
Copyright is held by the author(s).
Permissions
This thesis may be printed or downloaded for non-commercial research and scholarly purposes.
Supervisor or Senior Supervisor
Thesis advisor: Shriraman, Arrvindh
Language
English
Member of collection
Download file Size
etd22532.pdf 1.38 MB

Views & downloads - as of June 2023

Views: 0
Downloads: 0