[论文解读] SymX: Energy-based Simulation from Symbolic Expressions
SymX 是一个符号微分框架,可自动计算基于物理模拟中能量函数的一阶和二阶导数,实时编译优化的向量化代码,并并行组装全局导数。该框架可实现高性能、生产就绪的模拟,用户投入极少,相比现有最先进框架,在高阶有限元模拟中实现高达两个数量级的加速。
Optimization time integrators are effective at solving complex multi-physics problems including deformable solids with non-linear material models, contact with friction, strain limiting, etc. For challenging problems, Newton-type optimizers are often used, which necessitates first- and second-order derivatives of the global non-linear objective function. Manually differentiating, implementing, testing, optimizing, and maintaining the resulting code is extremely time-consuming, error-prone, and precludes quick changes to the model, even when using tools that assist with parts of such pipeline. We present SymX, an open source framework that computes the required derivatives of the different energy contributions by symbolic differentiation, generates optimized code, compiles it on-the-fly, and performs the global assembly. The user only has to provide the symbolic expression of each energy for a single representative element in its corresponding discretization and our system will determine the assembled derivatives for the whole simulation. We demonstrate the versatility of SymX in complex simulations featuring different non-linear materials, high-order finite elements, rigid body systems, adaptive discretizations, frictional contact, and coupling of multiple interacting physical systems. SymX's derivatives offer performance on par with SymPy, an established off-the-shelf symbolic engine, and produces simulations at least one order of magnitude faster than TinyAD, an alternative state-of-the-art integral solution.
研究动机与目标
- 自动化推导并高效实现复杂物理模拟中基于优化的时间积分器所必需的一阶和二阶导数。
- 消除在多物理场系统中对非线性能量函数进行手动、易出错的符号微分和代码级微分的需要。
- 通过提供快速编译和高性能导数评估,实现模拟开发中的快速原型设计与迭代。
- 支持灵活集成到现有模拟流水线中,支持自定义数据类型和求解器。
- 处理因接触、断裂或自适应加密等引起的系统拓扑和稀疏性模式动态变化的系统。
提出的方法
- 该框架使用符号表达式表示单个单元(如有限元或约束)的局部能量函数。
- 通过符号微分自动推导能量相对于自由度的一阶和二阶解析导数。
- 生成的导数代码经过向量化处理,并通过即时(JIT)编译管道实时编译,以实现高性能。
- 系统自动并行组装单元级贡献,形成全局残差矩阵和海森矩阵。
- 支持任意数据类型,并可与现有优化求解器和模拟后端无缝集成。
- 该框架可处理系统拓扑和稀疏性模式的动态变化,如由接触或自适应加密引入的变化。
实验结果
研究问题
- RQ1符号微分与实时代码生成能否在复杂物理模拟中产生与手写优化代码性能相当的导数?
- RQ2自动导数计算在多物理场模拟系统中能在多大程度上减少开发时间和错误率?
- RQ3该框架在不同材料模型、单元类型和系统复杂度下的可扩展性如何?
- RQ4系统能否高效处理因接触或拓扑变化导致稀疏性模式动态变化的系统?
- RQ5与现有自动微分工具相比,在高阶有限元方法中可实现多大的性能提升?
主要发现
- SymX 的性能可与手写优化代码相媲美,在高阶有限元模拟中,相比最先进的框架最高可实现两个数量级的加速。
- 该框架显著提升了模拟开发速度,仅需极少代码即可表达复杂能量函数,其形式与数学表达式高度一致。
- 对于五阶梁单元,SymX 生成了 23,824 个导数项和 51,565 次运算,编译为 1002 kB 的优化代码,效率极高。
- 在包含九种不同能量类型的复杂汽车漂移模拟中,SymX 成功管理了刚体、可变形固体和接触约束之间全局导数的组装。
- 在自适应布料和投石机模拟中,系统表现出鲁棒性,能稳定处理动态变化和复杂耦合,性能一致。
- 尽管在处理非可微中间表达式(如范数或平方根)时存在局限,SymX 会发出警告,并支持稳定近似以减轻数值不稳定性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。