QuanTaichi: a compiler for quantized simulations

<jats:p> 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, by enabling flexi...

Full description

Bibliographic Details
Main Authors: Hu, Yuanming, Liu, Jiafeng, Yang, Xuanda, Xu, Mingkuan, Kuang, Ye, Xu, Weiwei, Dai, Qiang, Freeman, William T, Durand, Frédo
Other Authors: Massachusetts Institute of Technology. Computer Science and Artificial Intelligence Laboratory
Format: Article
Language:English
Published: Association for Computing Machinery (ACM) 2022
Online Access:https://hdl.handle.net/1721.1/143474
_version_ 1811069477999083520
author Hu, Yuanming
Liu, Jiafeng
Yang, Xuanda
Xu, Mingkuan
Kuang, Ye
Xu, Weiwei
Dai, Qiang
Freeman, William T
Durand, Frédo
author2 Massachusetts Institute of Technology. Computer Science and Artificial Intelligence Laboratory
author_facet Massachusetts Institute of Technology. Computer Science and Artificial Intelligence Laboratory
Hu, Yuanming
Liu, Jiafeng
Yang, Xuanda
Xu, Mingkuan
Kuang, Ye
Xu, Weiwei
Dai, Qiang
Freeman, William T
Durand, Frédo
author_sort Hu, Yuanming
collection MIT
description <jats:p> 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, by enabling flexible and aggressive <jats:italic>quantization.</jats:italic> Low-precision ("quantized") numerical data types are used and packed to represent simulation states, leading to reduced memory space and bandwidth consumption. Quantized simulation allows higher resolution simulation with less memory, which is especially attractive on GPUs. Implementing a quantized simulator that has high performance and packs the data tightly for aggressive storage reduction would be extremely labor-intensive and error-prone using a traditional programming language. To make the creation of quantized simulation practical, we have developed a new set of language abstractions and a compilation system. A suite of tailored domain-specific optimizations ensure quantized simulators often run as fast as the full-precision simulators, despite the overhead of encoding-decoding the packed quantized data types. Our programming language and compiler, based on <jats:italic>Taichi</jats:italic> , allow developers to effortlessly switch between different full-precision and quantized simulators, to explore the full design space of quantization schemes, and ultimately to achieve a good balance between space and precision. The creation of quantized simulation with our system has large benefits in terms of memory consumption and performance, on a variety of hardware, from mobile devices to workstations with high-end GPUs. We can simulate with levels of resolution that were previously only achievable on systems with much more memory, such as multiple GPUs. For example, on a <jats:italic>single</jats:italic> GPU, we can simulate a Game of Life with 20 billion cells (8× compression per pixel), an Eulerian fluid system with 421 million active voxels (1.6× compression per voxel), and a hybrid Eulerian-Lagrangian elastic object simulation with 235 million particles (1.7× compression per particle). At the same time, quantized simulations create physically plausible results. Our quantization techniques are <jats:italic>complementary</jats:italic> to existing acceleration approaches of physical simulation: they can be used in combination with these existing approaches, such as sparse data structures, for even higher scalability and performance. </jats:p>
first_indexed 2024-09-23T08:11:04Z
format Article
id mit-1721.1/143474
institution Massachusetts Institute of Technology
language English
last_indexed 2024-09-23T08:11:04Z
publishDate 2022
publisher Association for Computing Machinery (ACM)
record_format dspace
spelling mit-1721.1/1434742023-03-29T20:05:10Z QuanTaichi: a compiler for quantized simulations Hu, Yuanming Liu, Jiafeng Yang, Xuanda Xu, Mingkuan Kuang, Ye Xu, Weiwei Dai, Qiang Freeman, William T Durand, Frédo Massachusetts Institute of Technology. Computer Science and Artificial Intelligence Laboratory <jats:p> 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, by enabling flexible and aggressive <jats:italic>quantization.</jats:italic> Low-precision ("quantized") numerical data types are used and packed to represent simulation states, leading to reduced memory space and bandwidth consumption. Quantized simulation allows higher resolution simulation with less memory, which is especially attractive on GPUs. Implementing a quantized simulator that has high performance and packs the data tightly for aggressive storage reduction would be extremely labor-intensive and error-prone using a traditional programming language. To make the creation of quantized simulation practical, we have developed a new set of language abstractions and a compilation system. A suite of tailored domain-specific optimizations ensure quantized simulators often run as fast as the full-precision simulators, despite the overhead of encoding-decoding the packed quantized data types. Our programming language and compiler, based on <jats:italic>Taichi</jats:italic> , allow developers to effortlessly switch between different full-precision and quantized simulators, to explore the full design space of quantization schemes, and ultimately to achieve a good balance between space and precision. The creation of quantized simulation with our system has large benefits in terms of memory consumption and performance, on a variety of hardware, from mobile devices to workstations with high-end GPUs. We can simulate with levels of resolution that were previously only achievable on systems with much more memory, such as multiple GPUs. For example, on a <jats:italic>single</jats:italic> GPU, we can simulate a Game of Life with 20 billion cells (8× compression per pixel), an Eulerian fluid system with 421 million active voxels (1.6× compression per voxel), and a hybrid Eulerian-Lagrangian elastic object simulation with 235 million particles (1.7× compression per particle). At the same time, quantized simulations create physically plausible results. Our quantization techniques are <jats:italic>complementary</jats:italic> to existing acceleration approaches of physical simulation: they can be used in combination with these existing approaches, such as sparse data structures, for even higher scalability and performance. </jats:p> 2022-06-17T17:57:51Z 2022-06-17T17:57:51Z 2021 2022-06-17T17:36:00Z Article http://purl.org/eprint/type/JournalArticle https://hdl.handle.net/1721.1/143474 Hu, Yuanming, Liu, Jiafeng, Yang, Xuanda, Xu, Mingkuan, Kuang, Ye et al. 2021. "QuanTaichi: a compiler for quantized simulations." ACM Transactions on Graphics, 40 (4). en 10.1145/3450626.3459671 ACM Transactions on Graphics Creative Commons Attribution 4.0 International license https://creativecommons.org/licenses/by/4.0/ application/pdf Association for Computing Machinery (ACM) ACM
spellingShingle Hu, Yuanming
Liu, Jiafeng
Yang, Xuanda
Xu, Mingkuan
Kuang, Ye
Xu, Weiwei
Dai, Qiang
Freeman, William T
Durand, Frédo
QuanTaichi: a compiler for quantized simulations
title QuanTaichi: a compiler for quantized simulations
title_full QuanTaichi: a compiler for quantized simulations
title_fullStr QuanTaichi: a compiler for quantized simulations
title_full_unstemmed QuanTaichi: a compiler for quantized simulations
title_short QuanTaichi: a compiler for quantized simulations
title_sort quantaichi a compiler for quantized simulations
url https://hdl.handle.net/1721.1/143474
work_keys_str_mv AT huyuanming quantaichiacompilerforquantizedsimulations
AT liujiafeng quantaichiacompilerforquantizedsimulations
AT yangxuanda quantaichiacompilerforquantizedsimulations
AT xumingkuan quantaichiacompilerforquantizedsimulations
AT kuangye quantaichiacompilerforquantizedsimulations
AT xuweiwei quantaichiacompilerforquantizedsimulations
AT daiqiang quantaichiacompilerforquantizedsimulations
AT freemanwilliamt quantaichiacompilerforquantizedsimulations
AT durandfredo quantaichiacompilerforquantizedsimulations