DOI: 10.1145/3849480 ISSN: 1544-3566

Supporting Optimization and Cross-compilation of Dataflow Actor Networks via an Intermediate Representation in MLIR

Gareth Callanan, Michail Boulasikis, Favius Gruian

The actor model of computation is an attractive representation for many applications because it explicitly captures concurrency and supports compile-time analyses such as buffer sizing and static scheduling. However, descriptions of applications in this model are often tied to specific frameworks and programming languages, making it difficult to integrate other frontends or target alternative architectures.

To address this, we present an intermediate representation (IR) for describing actor networks, inspired by the CAL actor language. Implemented as an MLIR dialect, it uses MLIR’s existing infrastructure while introducing actor-specific transformations and analyses. Multiple frontends can target this dialect and reuse these optimizations. We transform this dialect to LLVM IR for CPU execution with multicore support. To show portability, we support GPU execution. We demonstrate the dialect’s versatility by generating descriptions in it from two frontends: one based on CAL and another on a framework for solving partial differential equations.

We demonstrate that actor-level analyses can be performed directly on this IR by giving an example of a new algorithm for inferring finite-state machines (FSMs) from actors. These inferred FSMs enable static scheduling, leading to more than double the performance compared to dynamic scheduling. The IR also supports non-primitive data types such as tensors, which can be offloaded to GPUs for a significant speedup relative to CPU execution. As an alternative, we also support runtime scheduling which achieves performance comparable to other actor-based compilers when tested on the Savina Benchmark Suite.

Overall, representing the actor model within MLIR allows analyses and compiler pipelines to be reused across languages and frameworks, improving interoperability and scalability.