Skip to main content
QUICK REVIEW

[论文解读] TSFC: a structure-preserving form compiler

Miklós Homolya, Lawrence Mitchell|arXiv (Cornell University)|May 10, 2017
Parallel Computing and Optimization Techniques参考文献 32被引用 6
一句话总结

TSFC 是一种用于有限元方法的新型形式编译器,能够在编译过程中保持弱形式表达式的结构完整性,从而支持高级优化。通过采用两阶段流程——首先将有限元结构降低为张量代数,然后调度操作——它比以往的编译器更长时间地保持张量结构,从而在复杂和非仿射问题中实现更优的编译性能。

ABSTRACT

A form compiler takes a high-level description of the weak form of partial differential equations and produces low-level code that carries out the finite element assembly. In this paper we present the Two-Stage Form Compiler (TSFC), a new form compiler with the main motivation to maintain the structure of the input expression as long as possible. This facilitates the application of optimizations at the highest possible level of abstraction. TSFC features a novel, structure-preserving method for separating the contributions of a form to the subblocks of the local tensor in discontinuous Galerkin problems. This enables us to preserve the tensor structure of expressions longer through the compilation process than other form compilers. This is also achieved in part by a two-stage approach that cleanly separates the lowering of finite element constructs to tensor algebra in the first stage, from the scheduling of those tensor operations in the second stage. TSFC also efficiently traverses complicated expressions, and experimental evaluation demonstrates good compile-time performance even for highly complex forms.

研究动机与目标

  • 解决在有限元代码生成过程中保持高级表达式结构的挑战,以支持高级优化。
  • 改善复杂有限元形式的编译时间性能,特别是针对非仿射几何映射和高阶单元的情况。
  • 实现将有限元结构降低为张量代数与操作调度之间的清晰分离,以提升可扩展性和优化能力。
  • 通过在局部张量中保持块结构,实现不连续伽辽金方法的高效编译。
  • 通过确保形式编译时间保持在亚秒级,支持交互式科学计算工作流,即使面对复杂形式也是如此。

提出的方法

  • 引入两阶段编译流水线:首先将 UFL 表达式转换为张量代数中间表示,然后调度张量操作。
  • 实现一种结构保持方法,以隔离不连续伽辽金公式中局部张量子块的贡献。
  • 使用高效的表达式遍历算法,以最小化复杂形式和非仿射单元的编译开销。
  • 将张量代数降低与操作调度解耦,以支持对调度的独立优化,或与下游工具集成。
  • 利用 UFL 对弱形式和离散函数空间的高层规格作为输入,通过编译过程保持数学结构。
  • 同时支持 C 和 FFC 兼容表示,实现与现有 FEniCS/Firedrake 堆栈的最小干扰集成。

实验结果

研究问题

  • RQ1如何在有限元形式编译过程中保持弱形式的结构语义,以支持高层优化?
  • RQ2在处理复杂或非仿射有限元形式时,传统编译器(如 FFC)会面临哪些性能损失,以及如何缓解?
  • RQ3两阶段编译方法在多大程度上提升了形式编译器的可维护性与优化机会?
  • RQ4结构保持编译是否能显著缩短高阶和不连续伽辽金有限元问题的编译时间?
  • RQ5在形式复杂度不断增加的情况下,TSFC 的性能与 UFLACS 和 FFC 变体相比如何,特别是在编译时间可扩展性方面?

主要发现

  • TSFC 的编译时间与 UFLACS 和 FFC 处于同一数量级,但在复杂形式上表现出显著更好的可扩展性。
  • 在最复杂的测试案例(3D 中的 Holzapfel-Ogden 模型)中,TSFC 的编译时间为 3.7 秒,通过禁用某些优化可缩短至 2.2 秒。
  • 修改后的 FFC 积分表示(fd_bendy)在 64GB 内存下运行 6 小时后耗尽内存,凸显了其可扩展性问题。
  • 即使面对高度复杂的形式,TSFC 的编译时间性能依然可接受,所有测试案例均在标准 CPU 上于 4 秒内完成编译。
  • 两阶段设计实现了降低与调度的清晰分离,有利于未来优化以及与 COFFEE 等工具的集成。
  • 在非仿射几何映射和高阶单元方面,TSFC 在编译时间效率上优于传统的 FFC 表示。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。