arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2105.03949cs.CLcs.MScs.PLcs.SC
收藏

通过多重分派实现高性能符号-数字运算

High-performance symbolic-numerics via multiple dispatch

Massachusetts Institute of Technology(麻省理工学院);Julia Computing(朱莉娅计算公司);University of Pisa(比萨大学)

Shashi Gowda, Yingbo Ma, Alessandro Cheli, Maja Gwozdz, Viral B. Shah, Alan Edelman, Christopher Rackauckas

摘要:

随着数学计算在高级语言中变得更加民主化,高性能的符号数字系统对于领域科学家和工程师来说是必要的,以便在没有深入的代码优化知识的情况下从他们的机器中获得最佳性能。当然,用户需要不同的术语类型,或者使它们具有不同的代数属性,或者使用有效的数据结构。为此,我们开发了Symbolics.jl,这是一个可扩展的符号系统,它使用动态多分派来根据域需求改变行为。在这项工作中,我们详细介绍了一个底层的抽象术语接口,允许速度而不牺牲一般性。我们表明,通过形式化一个通用的API的行动独立的实现,我们可以追溯添加优化的数据结构到我们的系统,而不改变预先存在的长期重写。我们展示了如何使用它来优化术语构造,并在一般符号转换上提供113倍的加速。此外,我们表明,这样一个通用的API允许互补项重写实现。我们证明了经典的长期重写的增音器和基于电子图的长期重写增音器之间的交换能力。我们展示了一个电子图规则,它最大限度地减少了表达式计算过程中的CPU周期数,并演示了它如何简化了现实世界的反应网络模拟,使运行时间减半。此外,我们展示了一个反应扩散偏微分方程求解器,它能够通过多个调度跟踪自动转换为符号表达式,随后加速和并行化,以提供157倍的模拟加速比。总之,这将Symbolics.jl作为面向建模和仿真的下一代符号数字计算环境。

英文摘要:

As mathematical computing becomes more democratized in high-level languages, high-performance symbolic-numeric systems are necessary for domain scientists and engineers to get the best performance out of their machine without deep knowledge of code optimization. Naturally, users need different term types either to have different algebraic properties for them, or to use efficient data structures. To this end, we developed Symbolics.jl, an extendable symbolic system which uses dynamic multiple dispatch to change behavior depending on the domain needs. In this work we detail an underlying abstract term interface which allows for speed without sacrificing generality. We show that by formalizing a generic API on actions independent of implementation, we can retroactively add optimized data structures to our system without changing the pre-existing term rewriters. We showcase how this can be used to optimize term construction and give a 113x acceleration on general symbolic transformations. Further, we show that such a generic API allows for complementary term-rewriting implementations. We demonstrate the ability to swap between classical term-rewriting simplifiers and e-graph-based term-rewriting simplifiers. We showcase an e-graph ruleset which minimizes the number of CPU cycles during expression evaluation, and demonstrate how it simplifies a real-world reaction-network simulation to halve the runtime. Additionally, we show a reaction-diffusion partial differential equation solver which is able to be automatically converted into symbolic expressions via multiple dispatch tracing, which is subsequently accelerated and parallelized to give a 157x simulation speedup. Together, this presents Symbolics.jl as a next-generation symbolic-numeric computing environment geared towards modeling and simulation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑