Skip to main content
QUICK REVIEW

[Paper Review] Exposing and exploiting structure: optimal code generation for high-order finite element methods

Miklós Homolya, Robert C. Kirby|arXiv (Cornell University)|Nov 7, 2017
Advanced Numerical Methods in Computational MathematicsEngineering4 references17 citations
TL;DR

This paper introduces FInAT, a smarter finite element library that exposes structural properties of high-order finite elements, enabling the Two-Stage Form Compiler (TSFC) in Firedrake to automatically apply sum factorization and other optimizations. The result is optimal algorithmic complexity for high-order finite element assembly, achieving near-ideal performance on cuboid cells for continuous, discontinuous, H(div), and H(curl) elements.

ABSTRACT

Code generation based software platforms, such as Firedrake, have become popular tools for developing complicated finite element discretisations of partial differential equations. We extended the code generation infrastructure in Firedrake with optimisations that can exploit the structure inherent to some finite elements. This includes sum factorisation on cuboid cells for continuous, discontinuous, H(div) and H(curl) conforming elements. Our experiments confirm optimal algorithmic complexity for high-order finite element assembly. This is achieved through several novel contributions: the introduction of a more powerful interface between the form compiler and the library providing the finite elements; a more abstract, smarter library of finite elements called FInAT that explicitly communicates the structure of elements; and form compiler algorithms to automatically exploit this exposed structure.

Motivation & Objective

  • Address the performance gap between hand-optimized spectral element codes and automatically generated finite element codes at high orders.
  • Overcome the limitations of FIAT, which lacks the ability to expose structural properties of finite elements necessary for advanced optimizations.
  • Enable automatic exploitation of mathematical structure in finite elements—such as tensor-product structure and sum factorization—within a code generation pipeline.
  • Achieve optimal algorithmic complexity for high-order finite element assembly using automated, form compiler-driven optimizations.
  • Support efficient matrix-free operator applications in high-order finite element methods by eliminating costly matrix assembly.

Proposed method

  • Design and implement FInAT, a new finite element library that explicitly exposes structural properties (e.g., tensor-product structure) of finite elements through a novel, richer interface.
  • Extend the TSFC form compiler to detect and exploit structural information from FInAT elements, enabling automatic application of sum factorization on hexahedral cells.
  • Introduce a new compilation mode, 'spectral mode', in TSFC that applies structure-aware loop transformations and code generation for high-order elements.
  • Implement underintegration-aware evaluation at collocated quadrature points to reduce computational cost without sacrificing accuracy.
  • Develop and integrate a new code generation pipeline that produces highly optimized C kernels from UFL weak forms, leveraging structural insights from FInAT.
  • Benchmark the performance of the new pipeline against FIAT-based compilation and hand-optimized spectral codes to validate optimality.

Experimental results

Research questions

  • RQ1Can structural properties of high-order finite elements be exposed in a way that enables automatic optimization by a form compiler?
  • RQ2To what extent can sum factorization and other optimizations be automatically applied in a code generation framework for high-order FEM?
  • RQ3Does exposing element structure via a new library interface (FInAT) enable optimal algorithmic complexity in finite element assembly?
  • RQ4How does the performance of the new code generation pipeline compare to hand-optimized spectral element codes at high polynomial degrees?
  • RQ5Can matrix-free operator applications achieve optimal performance in high-order FEM without costly matrix assembly?

Key findings

  • The new FInAT library successfully exposes structural properties of finite elements, such as tensor-product structure, enabling advanced optimizations previously only possible in hand-written code.
  • TSFC's 'spectral mode' achieves optimal algorithmic complexity for high-order finite element assembly on hexahedral cells, with performance matching or exceeding hand-optimized spectral codes.
  • Matrix-free operator applications in the new pipeline scale efficiently with polynomial degree, maintaining near-constant cost per degree of freedom up to order 8–10.
  • The use of FIAT for high-order elements results in unmanageably large kernels (over 100MB), making compilation infeasible, whereas FInAT-based compilation remains efficient.
  • The form compilation time overhead is minimal—under 6 seconds for complex hyperelastic models—making the pipeline practical for real-world applications.
  • The spectral mode in TSFC outperforms both vanilla and coffee compilation modes, and is recommended as the default for all cases, even at low polynomial orders.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.