Going MLIR-native: Demonstrating a Future for DSL compilers on a NumPy-like Example

πŸ“… 2026-04-21
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF

career value

192K/year
πŸ€– AI Summary
This work addresses the lack of a unified framework in existing domain-specific language (DSL) compilers, which leads to redundant development, maintenance challenges, and difficulty meeting production-grade requirements. The paper presents the first fully MLIR-based NumPy-like DSL, featuring native implementation of both front-end parsing and semantic analysis within MLIR. It introduces a novel dialect-agnostic type checker and a parallelism-first lowering strategy that seamlessly integrates with MLIR’s dataflow dialects. By doing so, this approach not only advances the standardization of DSLs within the MLIR ecosystem but also demonstrates strong performance on real-world Fortran applications in domains such as weather modeling and computational fluid dynamics.

Technology Category

Application Category

πŸ“ Abstract
Compilers for general-purpose languages have been shown to be at a disadvantage when it comes to specialized application domains as opposed to their Domain-Specific Language (DSL) counterparts. However, the field of DSL compilers features little consolidation in terms of compiler frameworks and adjacent software ecosystems. As a result, considerable work is duplicated, lost to maintenance issues, or remains undiscovered, and most DSLs are never considered "production-ready". One notable development is the introduction of the Multi-Level Intermediate Representation (MLIR), which promises a similar impact on DSL compilers as LLVM had on general-purpose tooling. In this work, we present a NumPy-like DSL made for offloading numeric tensor kernels that is entirely MLIR-native. In a first for open-source, it implements all frontend actions and semantic analyses directly within MLIR. Most notably, this is made possible by our new dialect-agnostic MLIR type checker, created for the future of DSLs in MLIR. We implement a simple, yet effective, parallel-first lowering scheme that connects our language to another MLIR dataflow dialect for seamless offloading. We show that our approach performs well in real-world use cases from the domain of weather modeling and Computational Fluid Dynamics (CFD) in Fortran.
Problem

Research questions and friction points this paper is trying to address.

DSL compilers
compiler frameworks
software ecosystems
production-ready
code reuse
Innovation

Methods, ideas, or system contributions that make the work stand out.

MLIR-native
dialect-agnostic type checker
DSL compiler
parallel-first lowering
tensor kernel offloading
πŸ”Ž Similar Papers
2024-04-02International Conference on Architectural Support for Programming Languages and Operating SystemsCitations: 4