Skip to main content
QUICK REVIEW

[Paper Review] Zygote: A Differentiable Programming System to Bridge Machine Learning and Scientific Computing

Mike Innes, Alan Edelman|arXiv (Cornell University)|Jul 17, 2019
Parallel Computing and Optimization TechniquesComputer Science39 references63 citations
TL;DR

Zygote is a differentiable programming system implemented in Julia that enables automatic differentiation across general program structures, including control flow, recursion, and mutation, without user intervention. It supports high-performance, staged computation and integrates seamlessly with scientific computing libraries, enabling a unified framework for machine learning and scientific computing through expressive, differentiable programming.

ABSTRACT

Scientific computing is increasingly incorporating the advancements in machine learning and the ability to work with large amounts of data. At the same time, machine learning models are becoming increasingly sophisticated and exhibit many features often seen in scientific computing, stressing the capabilities of machine learning frameworks. Just as the disciplines of scientific computing and machine learning have shared common underlying infrastructure in the form of numerical linear algebra, we now have the opportunity to further share new computational infrastructure, and thus ideas, in the form of Differentiable Programming. We describe Zygote, a Differentiable Programming system that is able to take gradients of general program structures. We implement this system in the Julia programming language. Our system supports almost all language constructs (control flow, recursion, mutation, etc.) and compiles high-performance code without requiring any user intervention or refactoring to stage computations. This enables an expressive programming model for deep learning, but more importantly, it enables us to incorporate a large ecosystem of libraries in our models in a straightforward way. We discuss our approach to automatic differentiation, including its support for advanced techniques such as mixed-mode, complex and checkpointed differentiation, and present several examples of differentiating programs.

Motivation & Objective

  • To bridge machine learning and scientific computing by enabling differentiable programming across general program structures.
  • To support automatic differentiation in Julia with minimal user overhead, avoiding the need for refactoring or staging computations.
  • To enable seamless integration of scientific computing libraries into machine learning models through a unified, expressive programming model.
  • To extend automatic differentiation to advanced techniques such as mixed-mode, complex, and checkpointed differentiation.
  • To demonstrate that differentiable programming can be both performant and general, supporting real-world scientific and machine learning workloads.

Proposed method

  • Zygote compiles high-performance code by leveraging Julia's multiple dispatch and metaprogramming capabilities to generate efficient gradient computations.
  • It uses source-to-source transformation to automatically differentiate arbitrary Julia programs, including those with control flow, recursion, and mutable state.
  • The system employs a reverse-mode automatic differentiation engine that supports mixed-mode and complex differentiation through symbolic manipulation of the abstract syntax tree.
  • Checkpointing is implemented to reduce memory usage during backpropagation by selectively recomputing intermediate values.
  • Zygote integrates with Julia's existing ecosystem of numerical and scientific computing libraries, enabling end-to-end differentiability of complex scientific workloads.
  • The framework is designed to be extensible, allowing users to define custom differentiable operations with minimal boilerplate.

Experimental results

Research questions

  • RQ1Can a differentiable programming system support general-purpose programming constructs such as control flow, recursion, and mutation without requiring code refactoring?
  • RQ2How efficiently can a differentiable programming system compile and execute gradients for complex scientific computing workloads?
  • RQ3To what extent can automatic differentiation be extended to support mixed-mode and complex number differentiation in a general-purpose language?
  • RQ4Can differentiable programming be used to seamlessly integrate scientific computing libraries into machine learning models?
  • RQ5What performance and usability trade-offs arise when enabling full program differentiability in a high-level language like Julia?

Key findings

  • Zygote successfully differentiates general Julia programs, including those with complex control flow and mutation, without requiring any user intervention or code restructuring.
  • The system achieves high performance by compiling efficient, low-level code for gradient computation, avoiding runtime overhead in most cases.
  • Mixed-mode and complex number differentiation are natively supported through symbolic manipulation of the program's abstract syntax tree.
  • Checkpointing is effectively integrated, reducing memory consumption during backpropagation while maintaining computational efficiency.
  • The framework enables direct use of scientific computing libraries—such as those for ODE solvers and linear algebra—within differentiable models, enhancing expressivity and reusability.
  • Zygote demonstrates that differentiable programming can unify machine learning and scientific computing in a single, performant, and user-friendly system.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.