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.5x memory compression without noticeable degradation of visual quality in the results. Our code and data are available at https://github.com/Hanke98/AutoQuantizer.
翻译:在高分辨率和大尺度的模拟中,量化证明是有效的,因为高分辨率和大尺度的模拟能够从比特级记忆保存中受益。然而,确定符合精确和记忆效率要求的量化办法需要尝试和错误。在本文件中,我们提议了一个新框架,使用户能够通过简单指定一个错误约束或记忆压缩率来获得量化办法。根据错误传播理论,我们的方法利用自动计量法来估计每个量化操作对全部错误的贡献。我们把任务设计成一个有限的优化问题,可以通过线性目标函数的分析公式来有效解决。我们的工作流程扩展了Taichi编译器并引入了抖动法,以提高定量模拟的精确性。我们通过几个具有挑战性的物理模拟实例来展示我们方法的一般性和效率,这种模拟达到2.5x记忆压缩,而不会明显降低结果的视觉质量。我们的代码和数据可以在 https://github.com/Hanke98/AutoQuantizer查阅。