Devito: Symbolic Finite Difference Computation

Devito is a domain-specific Language (DSL) and code generation framework for the design of highly optimised finite difference kernels for use in inversion methods. Devito utilises SymPy to allow the definition of operators from high-level symbolic equations and generates optimised and automatically tuned code specific to a given target architecture.

Symbolic computation is a powerful tool that allows users to:

  • Build complex solvers from only a few lines of high-level code
  • Use automated performance optimisation for generated code
  • Adjust stencil discretisation at runtime as required
  • (Re-)development of solver code in hours rather than months

Seismic Inversion using Devito

Devito is primarily designed to create wave propagation kernels for use in seismic inversion problems. A tutorial for the generation of a modelling operator using an acoustic wave equation can be found here and a paper outlining the verification procedures of the acoustic operator can be found here.

True velocity model (Marmousi-ii)

Initial velocity model for FWI

FWI inverted velocity model


Optimisation and Performance

Devito provides a set of automated performance optimizations during code generation that allow user applications to fully utilise the target hardware without changing the model specification:

  • Vectorisation (via OpenMP)
  • Shared-memory parallelism (via OpenMP), including nested parallelism and non-affine loop support
  • Loop blocking, including hierarchical blocking
  • Auto-tuning (e.g., block-shape, threads per parallel region)
  • Symbolic optimisations:
    • Common sub-expression elimination (CSE)
    • Cross-iteration redundancy elimination (CIRE)
    • Expression hoisting
    • Factorization

Devito also supports distributed-memory parallelism via MPI. Several halo-exchange schemes are available; classic optimisations such as computation-communication overlap (relying on asynchronous progress engine) are implemented.