Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Public Access

Automatic quantization for physics-based simulation

Published: 22 July 2022 Publication History

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

MOV File
supplemental material
MOV File
presentation
SRT File
presentation
ZIP File
supplemental material

References

[1]
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.
[2]
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.
[3]
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.
[4]
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.
[5]
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.
[6]
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.
[7]
E Richard Cohen. 1998. An introduction to error analysis: The study of uncertainties in physical measurements.
[8]
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.
[9]
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.
[10]
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.
[11]
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.
[12]
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.
[13]
Jonas Degrave, Michiel Hermans, Joni Dambre, et al. 2019. A differentiable physics engine for deep learning in robotics. Frontiers in Neurorobotics 13 (2019), 6.
[14]
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.
[15]
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.
[16]
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.
[17]
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.
[18]
Robert M Gray. 1990. Quantization noise spectra. IEEE Transactions on Information Theory 36, 6 (1990), 1220--1244.
[19]
Andreas Griewank. 1992. Achieving logarithmic growth of temporal and spatial complexity in reverse automatic differentiation. Optimization Methods and Software 1, 1 (1992), 35--54.
[20]
David Hahn and Chris Wojtan. 2015. High-resolution brittle fracture simulation with boundary elements. ACM Trans. Graph. 34, 4, Article 151 (2015), 12 pages.
[21]
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.
[22]
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).
[23]
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.
[24]
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.
[25]
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.
[26]
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.
[27]
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.
[28]
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.
[29]
Nuggehally S. Jayant and P. Noll. 1990. Digital Coding of Waveforms: Principles and Applications to Speech and Video. Prentice Hall Professional Technical Reference.
[30]
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.
[31]
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.
[32]
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).
[33]
Junbang Liang, Ming C. Lin, and Vladlen Koltun. 2019. Differentiable Cloth Simulation for Inverse Problems. In Advances in Neural Information Processing Systems. 771--780.
[34]
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.
[35]
Antoine McNamara, Adrien Treuille, Zoran Popović, and Jos Stam. 2004. Fluid control using the adjoint method. ACM Trans. Graph. 23, 3 (2004), 449--456.
[36]
Ramon E Moore and CT Yang. 1996. Interval analysis. Vol. 2. Prentice-Hall Englewood Cliffs, NJ.
[37]
Ken Museth. 2013. VDB: High-resolution sparse volumes with dynamic topology. ACM Trans. Graph. 32, 3, Article 27 (2013), 22 pages.
[38]
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.
[39]
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.
[40]
Leonard Schuchman. 1964. Dither signals and their effect on quantization noise. IEEE Transactions on Communication Technology 12, 4 (1964), 162--165.
[41]
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.
[42]
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.
[43]
Barbara Solenthaler and Markus Gross. 2011. Two-Scale Particle Simulation. ACM Trans. Graph. 30, 4, Article 81 (2011), 8 pages.
[44]
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.
[45]
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.
[46]
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.
[47]
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.
[48]
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.
[49]
Rob Wannamaker, Stanley Lipshitz, John Vanderkooy, and J. Wright. 2000. A theory of nonsubtractive dither. IEEE Transactions on Signal Processing 48 (2000), 499--516.
[50]
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.
[51]
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.
[52]
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.
[53]
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.

Cited By

View all
  • (2024)Unifying Graph Neural Networks with a Generalized Optimization FrameworkACM Transactions on Information Systems10.1145/366085242:6(1-32)Online publication date: 19-Aug-2024
  • (2024)TransRec: Learning Transferable Recommendation from Mixture-of-Modality FeedbackWeb and Big Data10.1007/978-981-97-7235-3_13(193-208)Online publication date: 31-Aug-2024
  • (2023)TransLOProceedings of the Thirty-Seventh AAAI Conference on Artificial Intelligence and Thirty-Fifth Conference on Innovative Applications of Artificial Intelligence and Thirteenth Symposium on Educational Advances in Artificial Intelligence10.1609/aaai.v37i2.25256(1683-1691)Online publication date: 7-Feb-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Graphics
ACM Transactions on Graphics  Volume 41, Issue 4
July 2022
1978 pages
ISSN:0730-0301
EISSN:1557-7368
DOI:10.1145/3528223
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 22 July 2022
Published in TOG Volume 41, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. GPU programming
  2. physics-based simulation
  3. quantized computation

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)167
  • Downloads (Last 6 weeks)9
Reflects downloads up to 10 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Unifying Graph Neural Networks with a Generalized Optimization FrameworkACM Transactions on Information Systems10.1145/366085242:6(1-32)Online publication date: 19-Aug-2024
  • (2024)TransRec: Learning Transferable Recommendation from Mixture-of-Modality FeedbackWeb and Big Data10.1007/978-981-97-7235-3_13(193-208)Online publication date: 31-Aug-2024
  • (2023)TransLOProceedings of the Thirty-Seventh AAAI Conference on Artificial Intelligence and Thirty-Fifth Conference on Innovative Applications of Artificial Intelligence and Thirteenth Symposium on Educational Advances in Artificial Intelligence10.1609/aaai.v37i2.25256(1683-1691)Online publication date: 7-Feb-2023
  • (2023)Multimodal Image Synthesis and Editing: The Generative AI EraIEEE Transactions on Pattern Analysis and Machine Intelligence10.1109/TPAMI.2023.330524345:12(15098-15119)Online publication date: 25-Aug-2023
  • (2023)Continuously Controllable Facial Expression Editing in Talking Face VideosIEEE Transactions on Affective Computing10.1109/TAFFC.2023.333451115:3(1400-1413)Online publication date: 18-Dec-2023

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media