DiffTaichi: Differentiable Programming for Physical Simulation

Yuanming Hu, Luke Anderson, Tzu-Mao Li, Qi Sun, Nathan Carr +2 more
10/1/2019
cs.LGcs.GRphysics.comp-ph

Official code: taichi-dev/taichi (28,425 stars, Apache-2.0, last commit 2026-10-05). 1 more implementation below.

Abstract

We present DiffTaichi, a new differentiable programming language tailored for building high-performance differentiable physical simulators. Based on an imperative programming language, DiffTaichi generates gradients of simulation steps using source code transformations that preserve arithmetic intensity and parallelism. A light-weight tape is used to record the whole simulation program structure and replay the gradient kernels in a reversed order, for end-to-end backpropagation. We demonstrate the performance and productivity of our language in gradient-based learning and optimization tasks on 10 different physical simulators. For example, a differentiable elastic object simulator written in our language is 4.2x shorter than the hand-engineered CUDA version yet runs as fast, and is 188x faster than the TensorFlow implementation. Using our differentiable programs, neural network controllers are typically optimized within only tens of iterations.

View on arXivView PDF

Code Implementations(2)

taichi-dev/taichiOfficial100%
Apache-2.0

Productive, portable, and performant GPU programming in Python.

28,4252,390C, C++Nov 24, 20162 weeks agoApache-2.0
computer-graphicsdifferentiable-programminggpugpu-programmingsparse-computation+1 more

10 differentiable physical simulators built with Taichi differentiable programming (DiffTaichi, ICLR 2020)

2,756267Dec 3, 20192 years ago
differentiable-programminggpugraphicsroboticssimulation+1 more

Similar Papers

Cite this paper

@article{hu2019difftaichi,
  title  = {DiffTaichi: Differentiable Programming for Physical Simulation},
  author = {Yuanming Hu and Luke Anderson and Tzu-Mao Li and Qi Sun and Nathan Carr and Jonathan Ragan-Kelley and Frédo Durand},
  year   = {2019},
  eprint = {1910.00935},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1910.00935}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1910.00935.svg)](https://codeofpaper.com/paper/1910.00935)

Discussion