Abstract
Quantization has proven effective in high-resolution and large-scale simulations, which benefit from bit-level memory saving. However, identifying a quantization scheme that meets the requirement of both precision and memory efficiency requires trial and error. In this paper, we propose a novel framework to allow users to obtain a quantization scheme by simply specifying either an error bound or a memory compression rate. Based on the error propagation theory, our method takes advantage of auto-diff to estimate the contributions of each quantization operation to the total error. We formulate the task as a constrained optimization problem, which can be efficiently solved with analytical formulas derived for the linearized objective function. Our workflow extends the Taichi compiler and introduces dithering to improve the precision of quantized simulations. We demonstrate the generality and efficiency of our method via several challenging examples of physics-based simulation, which achieves up to 2.5× memory compression without noticeable degradation of visual quality in the results. Our code and data are available at https://github.com/Hanke98/AutoQantizer.
Supplemental Material
- Mridul Aanjaneya, Ming Gao, Haixiang Liu, Christopher Batty, and Eftychios Sifakis. 2017. Power diagrams and sparse paged grids for high resolution adaptive liquids. ACM Trans. Graph. 36, 4, Article 140 (2017), 12 pages.Google Scholar
Digital Library
- Sai Praveen Bangaru, Jesse Michel, Kevin Mu, Gilbert Bernstein, Tzu-Mao Li, and Jonathan Ragan-Kelley. 2021. Systematically differentiating parametric discontinuities. ACM Trans. Graph. 40, 4, Article 107 (2021), 18 pages.Google Scholar
Digital Library
- Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, et al. 2016. Interaction networks for learning about objects, relations and physics. In Advances in Neural Information Processing Systems. 4509--4517.Google Scholar
Digital Library
- Sofien Bouaziz, Sebastian Martin, Tiantian Liu, Ladislav Kavan, and Mark Pauly. 2014. Projective dynamics: Fusing constraint projections for fast simulation. ACM Trans. Graph. 33, 4, Article 154 (2014), 11 pages.Google Scholar
Digital Library
- Thierry Braconnier and Philippe Langlois. 2002. From rounding error estimation to automatic correction with automatic differentiation. In Automatic Differentiation of Algorithms: From Simulation to Optimization. 351--357.Google Scholar
- Francky Catthoor, Hugo De Man, and Joos Vandewalle. 1988. Simulated-annealing-based optimization of coefficient and data word-lengths in digital filters. International Journal of Circuit Theory and Applications 16, 4 (1988), 371--390.Google Scholar
Cross Ref
- E Richard Cohen. 1998. An introduction to error analysis: The study of uncertainties in physical measurements.Google Scholar
- George A Constantinides. 2003. Perturbation analysis for word-length optimization. In 11th Annual IEEE Symposium on Field-Programmable Custom Computing Machines, 2003. FCCM 2003. IEEE, 81--90.Google Scholar
Cross Ref
- George A Constantinides. 2006. Word-length optimization for differentiable nonlinear systems. ACM Transactions on Design Automation of Electronic Systems (TODAES) 11, 1 (2006), 26--43.Google Scholar
Digital Library
- George A Constantinides, Peter YK Cheung, and Wayne Luk. 2001. The multiple wordlength paradigm. In The 9th Annual IEEE Symposium on Field-Programmable Custom Computing Machines (FCCM'01). IEEE, 51--60.Google Scholar
Digital Library
- Filipe de Avila Belbute-Peres, Kevin Smith, Kelsey Allen, Josh Tenenbaum, and J Zico Kolter. 2018. End-to-end differentiable physics for learning and control. In Advances in Neural Information Processing Systems. 7178--7189.Google Scholar
- Fernando De Goes, Corentin Wallez, Jin Huang, Dmitry Pavlov, and Mathieu Desbrun. 2015. Power particles: an incompressible fluid solver based on power diagrams. ACM Trans. Graph. 34, 4, Article 50 (2015), 11 pages.Google Scholar
- Jonas Degrave, Michiel Hermans, Joni Dambre, et al. 2019. A differentiable physics engine for deep learning in robotics. Frontiers in Neurorobotics 13 (2019), 6.Google Scholar
Cross Ref
- Tao Du, Kui Wu, Pingchuan Ma, Sebastien Wah, Andrew Spielberg, Daniela Rus, and Wojciech Matusik. 2021. Diffpd: Differentiable projective dynamics. ACM Trans. Graph. 41, 2, Article 13 (2021), 21 pages.Google Scholar
- Florian Ferstl, Rüdiger Westermann, and Christian Dick. 2014. Large-scale liquid simulation on adaptive hexahedral grids. IEEE Transactions on Visualization and Computer Graphics 20, 10 (2014), 1405--1417.Google Scholar
Cross Ref
- Ming Gao, Xinlei Wang, Kui Wu, Andre Pradhana, Eftychios Sifakis, Cem Yuksel, and Chenfanfu Jiang. 2018. GPU optimization of material point methods. ACM Trans. Graph. 37, 6, Article 254 (2018), 12 pages.Google Scholar
Digital Library
- Moritz Geilinger, David Hahn, Jonas Zehnder, Moritz Bächer, Bernhard Thomaszewski, and Stelian Coros. 2020. ADD: analytically differentiable dynamics for multi-body systems with frictional contact. ACM Trans. Graph. 39, 6, Article 190 (2020), 15 pages.Google Scholar
Digital Library
- Robert M Gray. 1990. Quantization noise spectra. IEEE Transactions on Information Theory 36, 6 (1990), 1220--1244.Google Scholar
Digital Library
- Andreas Griewank. 1992. Achieving logarithmic growth of temporal and spatial complexity in reverse automatic differentiation. Optimization Methods and Software 1, 1 (1992), 35--54.Google Scholar
Cross Ref
- David Hahn and Chris Wojtan. 2015. High-resolution brittle fracture simulation with boundary elements. ACM Trans. Graph. 34, 4, Article 151 (2015), 12 pages.Google Scholar
Digital Library
- Konrad Hejn and Andrzej Pacut. 1996. Generalized model of the quantization error-a unified approach. IEEE Transactions on Instrumentation and Measurement 45, 1 (1996), 41--44.Google Scholar
Cross Ref
- Yuanming Hu, Luke Anderson, Tzu-Mao Li, Qi Sun, Nathan Carr, Jonathan Ragan-Kelley, and Frédo Durand. 2020. Diff Taichi: Differentiable Programming for Physical Simulation. In International Conference on Learning Representations (ICLR).Google Scholar
- Yuanming Hu, Yu Fang, Ziheng Ge, Ziyin Qu, Yixin Zhu, Andre Pradhana, and Chenfanfu Jiang. 2018. A moving least squares material point method with displacement discontinuity and two-way rigid body coupling. ACM Trans. Graph. 37, 4, Article 150 (2018), 14 pages.Google Scholar
Digital Library
- Yuanming Hu, Tzu-Mao Li, Luke Anderson, Jonathan Ragan-Kelley, and Frédo Durand. 2019a. Taichi: a language for high-performance computation on spatially sparse data structures. ACM Trans. Graph. 38, 6, Article 201 (2019), 16 pages.Google Scholar
Digital Library
- Yuanming Hu, Jiancheng Liu, Andrew Spielberg, Joshua B Tenenbaum, William T Freeman, Jiajun Wu, Daniela Rus, and Wojciech Matusik. 2019b. Chainqueen: A realtime differentiable physical simulator for soft robotics. In International Conference on Robotics and Automation (ICRA). IEEE, 6265--6271.Google Scholar
Digital Library
- Yuanming Hu, Jiafeng Liu, Xuanda Yang, Mingkuan Xu, Ye Kuang, Weiwei Xu, Qiang Dai, William T. Freeman, and Frédo Durand. 2021. QuanTaichi: A Compiler for Quantized Simulations. ACM Trans. Graph. 40, 4, Article 182 (2021), 16 pages.Google Scholar
Digital Library
- Libo Huang, Ziyin Qu, Xun Tan, Xinxin Zhang, Dominik L. Michels, and Chenfanfu Jiang. 2021. Ships, splashes, and waves on a vast ocean. ACM Trans. Graph. 40, 6 (2021), 203:1--203:15.Google Scholar
Digital Library
- Doug L James and Dinesh K Pai. 1999. Artdefo: accurate real time deformable objects. In Proceedings of the 26th Annual Conference on Computer Graphics and Interactive Techniques. 65--72.Google Scholar
Digital Library
- Nuggehally S. Jayant and P. Noll. 1990. Digital Coding of Waveforms: Principles and Applications to Speech and Video. Prentice Hall Professional Technical Reference.Google Scholar
- Todd Keeler and Robert Bridson. 2015. Ocean Waves Animation Using Boundary Integral Equations and Explicit Mesh Tracking. In Proceedings of the ACM SIGGRAPH/Eurographics Symposium on Computer Animation. 11--19.Google Scholar
- D-U Lee, Altaf Abdul Gaffar, Ray CC Cheung, Oskar Mencer, Wayne Luk, and George A Constantinides. 2006. Accuracy-guaranteed bit-width optimization. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 25, 10 (2006), 1990--2000.Google Scholar
Digital Library
- Yunzhu Li, Jiajun Wu, Russ Tedrake, Joshua B Tenenbaum, and Antonio Torralba. 2019. Learning Particle Dynamics for Manipulating Rigid Bodies, Deformable Objects, and Fluids. In International Conference on Learning Representations (ICLR).Google Scholar
- Junbang Liang, Ming C. Lin, and Vladlen Koltun. 2019. Differentiable Cloth Simulation for Inverse Problems. In Advances in Neural Information Processing Systems. 771--780.Google Scholar
- Haixiang Liu, Nathan Mitchell, Mridul Aanjaneya, and Eftychios Sifakis. 2016. A scalable schur-complement fluids solver for heterogeneous compute platforms. ACM Trans. Graph. 35, 6, Article 201 (2016), 12 pages.Google Scholar
Digital Library
- Antoine McNamara, Adrien Treuille, Zoran Popović, and Jos Stam. 2004. Fluid control using the adjoint method. ACM Trans. Graph. 23, 3 (2004), 449--456.Google Scholar
Digital Library
- Ramon E Moore and CT Yang. 1996. Interval analysis. Vol. 2. Prentice-Hall Englewood Cliffs, NJ.Google Scholar
- Ken Museth. 2013. VDB: High-resolution sparse volumes with dynamic topology. ACM Trans. Graph. 32, 3, Article 27 (2013), 22 pages.Google Scholar
Digital Library
- Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, and Ming C. Lin. 2020. Scalable Differentiable Physics for Learning and Control. In International Conference on Machine Learning (ICML). 7847--7856.Google Scholar
- Alvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovec, and Peter Battaglia. 2020. Learning to simulate complex physics with graph networks. In International Conference on Machine Learning. 8459--8468.Google Scholar
- Leonard Schuchman. 1964. Dither signals and their effect on quantization noise. IEEE Transactions on Communication Technology 12, 4 (1964), 162--165.Google Scholar
Cross Ref
- Rajsekhar Setaluri, Mridul Aanjaneya, Sean Bauer, and Eftychios Sifakis. 2014. SPGrid: A sparse paged grid structure applied to adaptive smoke simulation. ACM Trans. Graph. 33, 6, Article 205 (2014), 12 pages.Google Scholar
Digital Library
- Changchun Shi and Robert W Brodersen. 2004. A perturbation theory on statistical quantization effects in fixed-point DSP with non-stationary inputs. In 2004 IEEE International Symposium on Circuits and Systems (IEEE Cat. No. 04CH37512), Vol. 3. IEEE, III--373.Google Scholar
- Barbara Solenthaler and Markus Gross. 2011. Two-Scale Particle Simulation. ACM Trans. Graph. 30, 4, Article 81 (2011), 8 pages.Google Scholar
Digital Library
- Wonyong Sung and Ki-Il Kum. 1995. Simulation-based word-length optimization method for fixed-point digital signal processing systems. IEEE Transactions on Signal Processing 43, 12 (1995), 3087--3090.Google Scholar
Digital Library
- Andre Pradhana Tampubolon, Theodore Gast, Gergely Klár, Chuyuan Fu, Joseph Teran, Chenfanfu Jiang, and Ken Museth. 2017. Multi-species simulation of porous sand and water mixtures. ACM Trans. Graph. 36, 4, Article 105 (2017), 11 pages.Google Scholar
Digital Library
- Shervin Vakili, JM Pierre Langlois, and Guy Bois. 2013. Enhanced precision analysis for accuracy-aware bit-width optimization using affine arithmetic. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 32, 12 (2013), 1853--1865.Google Scholar
Digital Library
- Xinlei Wang, Yuxing Qiu, Stuart R Slattery, Yu Fang, Minchen Li, Song-Chun Zhu, Yixin Zhu, Min Tang, Dinesh Manocha, and Chenfanfu Jiang. 2020. A massively parallel and scalable multi-GPU material point method. ACM Trans. Graph. 39, 4, Article 30 (2020), 15 pages.Google Scholar
Digital Library
- Zhendong Wang, Longhua Wu, Marco Fratarcangeli, Min Tang, and Huamin Wang. 2018. Parallel multigrid for nonlinear cloth simulation. Computer Graphics Forum 37, 7 (2018), 131--141.Google Scholar
Cross Ref
- Rob Wannamaker, Stanley Lipshitz, John Vanderkooy, and J. Wright. 2000. A theory of nonsubtractive dither. IEEE Transactions on Signal Processing 48 (2000), 499--516.Google Scholar
Digital Library
- B. Widrow. 1961. Statistical analysis of amplitude-quantized sampled-data systems. Transactions of the American Institute of Electrical Engineers, Part II: Applications and Industry 79, 6 (1961), 555--568.Google Scholar
Cross Ref
- Jun Wu, Christian Dick, and Rüdiger Westermann. 2015. A system for high-resolution topology optimization. IEEE Transactions on Visualization and Computer Graphics 22, 3 (2015), 1195--1208.Google Scholar
Digital Library
- Kui Wu, Nghia Truong, Cem Yuksel, and Rama Hoetzlein. 2018. Fast fluid simulations with sparse volumes on the GPU. Computer Graphics Forum 37, 2 (2018), 157--167.Google Scholar
Cross Ref
- Jonas Zehnder, Rahul Narain, and Bernhard Thomaszewski. 2018. An advection-reflection solver for detail-preserving fluid simulation. ACM Trans. Graph. 37, 4, Article 85 (2018), 8 pages.Google Scholar
Digital Library
Index Terms
Automatic quantization for physics-based simulation
Recommendations
QuanTaichi: a compiler for quantized simulations
High-resolution simulations can deliver great visual quality, but they are often limited by available memory, especially on GPUs. We present a compiler for physical simulation that can achieve both high performance and significantly reduced memory costs,...
Approximating vector quantisation by transformation and scalar quantisation
Vector quantisation provides better rate‐distortion performance over scalar quantisation even for a random vector with independent dimensions. However, the design and implementation complexity of vector quantisers is much higher than that of scalar ...
A fractional bit encoding technique for the GMM-based block quantisation of images
In this paper, a simple technique for encoding fractional bit components used in fixed-rate Gaussian mixture model-based (GMM) block quantisers is presented. While block transform image coding has not been very popular lately in the presence of current ...





Comments