IRILL - Research and Innovation on Free Software

20211008 - Weaving Synchronous Reactions Into the Fabric of SSA-Form Compilers

"20211008 - Weaving Synchronous Reactions Into the Fabric of SSA-Form Compilers"
by Hugo Pompougnac,
Download MP4 format

Orateur : Hugo Pompougnac (Inria)

Autres auteurs : Dumitru Potop (Inria) et Albert Cohen (Google)

Titre : Weaving Synchronous Reactions Into the Fabric of SSA-Form Compilers

abstract :

We investigate the programming of reactive control, real-time systems combining typical signal processing and closed-loop control with performance-intensive components such as Machine Learning (ML). Enabling functional and non-functional correctness guarantees is a strong requirement for many embedded control systems. Extending such levels of assurance to computationally-intensive code remains an open issue, which we tackle by unifying concepts and algorithms from synchronous languages with abstractions commonly found in general-purpose and ML compilers. This unification across embedded and high-performance computing enables a high degree of compiler code reuse.

We first recall commonalities between dataflow synchronous languages and the SSA form of general-purpose/ML compilers. We highlight the key mechanisms of synchronous languages that SSA does not cover---denotational concepts such as synchronizing computations with an external time base, cyclic and reactive I/O, as well as the operational notions of relaxing control flow dominance and the modeling of absent values to represent variables whose initialization does not follow structural rules. We discover that initialization-related static analyses and code generation aspects specific to the synchronous semantics can be fully decoupled from memory allocation and causality analysis, the latter being covered by existing dominance-based algorithms of SSA-form compilers.

We show how the SSA form in its MLIR implementation can be seamlessly extended to cover synchronous-specific aspects, enabling the application of all SSA-based transformations and optimizations on reactive programs with synchronous concurrency. From this principled unification, we derive a compilation flow suitable for both high-performance and reactive aspects of a control application. We illustrate this unification on an MLIR-embedding of the Lustre dataflow synchronous language. The resulting language allows the modeling of signal processing and deep neural network inference in the (closed) loop of feedback-directed control systems. With only a minor time investment in using MLIR's optimization support, generated code surpasses in speed state-of-the-art synchronous language compilers.