Saved in:
Bibliographic Details
Main Authors: Estep, Sam, Ni, Wode, Rothkopf, Raven, Sunshine, Joshua
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2402.17743
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914867264356352
author Estep, Sam
Ni, Wode
Rothkopf, Raven
Sunshine, Joshua
author_facet Estep, Sam
Ni, Wode
Rothkopf, Raven
Sunshine, Joshua
contents Reverse-mode automatic differentiation (autodiff) has been popularized by deep learning, but its ability to compute gradients is also valuable for interactive use cases such as bidirectional computer-aided design, embedded physics simulations, visualizing causal inference, and more. Unfortunately, the web is ill-served by existing autodiff frameworks, which use autodiff strategies that perform poorly on dynamic scalar programs, and pull in heavy dependencies that would result in unacceptable webpage sizes. This work introduces Rose, a lightweight autodiff framework for the web using a new hybrid approach to reverse-mode autodiff, blending conventional tracing and transformation techniques in a way that uses the host language for metaprogramming while also allowing the programmer to explicitly define reusable functions that comprise a larger differentiable computation. We demonstrate the value of the Rose design by porting two differentiable physics simulations, and evaluate its performance on an optimization-based diagramming application, showing Rose outperforming the state-of-the-art in web-based autodiff by multiple orders of magnitude.
format Preprint
id arxiv_https___arxiv_org_abs_2402_17743
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Rose: Composable Autodiff for the Interactive Web
Estep, Sam
Ni, Wode
Rothkopf, Raven
Sunshine, Joshua
Programming Languages
Reverse-mode automatic differentiation (autodiff) has been popularized by deep learning, but its ability to compute gradients is also valuable for interactive use cases such as bidirectional computer-aided design, embedded physics simulations, visualizing causal inference, and more. Unfortunately, the web is ill-served by existing autodiff frameworks, which use autodiff strategies that perform poorly on dynamic scalar programs, and pull in heavy dependencies that would result in unacceptable webpage sizes. This work introduces Rose, a lightweight autodiff framework for the web using a new hybrid approach to reverse-mode autodiff, blending conventional tracing and transformation techniques in a way that uses the host language for metaprogramming while also allowing the programmer to explicitly define reusable functions that comprise a larger differentiable computation. We demonstrate the value of the Rose design by porting two differentiable physics simulations, and evaluate its performance on an optimization-based diagramming application, showing Rose outperforming the state-of-the-art in web-based autodiff by multiple orders of magnitude.
title Rose: Composable Autodiff for the Interactive Web
topic Programming Languages
url https://arxiv.org/abs/2402.17743