JuliaCon 2026

What's new in Chmy.jl: tensor expressions and automatic optimisation of finite-difference codes
2026-08-13 , Room 3

Chmy.jl is a Julia package for developing scalable, architecture-agnostic finite-difference codes. It provides modules for structured staggered grids, differential and interpolation operators, and boundary conditions. Chmy.jl v0.2 introduces functionality for expressing equations in a coordinate-independent tensor form and automatically generating kernels from lists of expressions, with kernel reordering and fusion to maximise memory throughput.


On modern hardware, most physics computations are memory-bound rather than compute-bound, making memory throughput the primary performance metric rather than the number of floating-point operations. While optimising for a specific architecture is challenging, we use effective memory throughput as a simple heuristic for assessing the performance of architecture-agnostic code. At the core of Chmy.jl is a domain-specific language (DSL) for expressing operations on structured grids. This allows users to write finite-difference approximations to PDEs in a math-like notation, which is then lowered to efficient Julia code executable on CPUs, GPUs, and distributed clusters.

To maximise performance, we apply a constrained combinatorial optimisation algorithm that determines the ordering and grouping of Chmy.jl expressions into kernels that maximise effective memory throughput. The resulting kernels are generated using KernelAbstractions.jl. With this approach, we achieve 80–95% of peak memory throughput for kernels implementing linear and nonlinear Poisson and Stokes equations, which are key building blocks in computational fluid mechanics.

I'm an applied mathematician working in the field of computational glaciology. My interests include GPU computing, supercomputing, computational fluid dynamics, numerical analysis, to name a few.