π€ AI Summary
Homomorphic encryption (HE) has long lacked a unified platform supporting multiple technical approaches, hardware-software co-design, and systematic optimization evaluation. To address this, we propose HEIRβthe first general-purpose HE compiler framework built on MLIR. Our method introduces a hierarchical HE-specific intermediate representation (IR) spanning the full stack, from high-level frontends (e.g., Python) to heterogeneous hardware backends. It systematically integrates dozens of optimization techniques from the literature and enables rapid prototyping of novel algorithms. Furthermore, HEIR provides unified compilation and benchmarking across HE libraries (e.g., SEAL, TFHE) and hardware targets (CPU, GPU, FPGA). Experimental results demonstrate that HEIR significantly improves compilation efficiency and scalability for complex HE workloads. It has become a de facto standard infrastructure for both HE research and engineering practice.
π Abstract
This work presents Homomorphic Encryption Intermediate Representation (HEIR), a unified approach to building homomorphic encryption (HE) compilers. HEIR aims to support all mainstream techniques in homomorphic encryption, integrate with all major software libraries and hardware accelerators, and advance the field by providing a platform for research and benchmarking. Built on the MLIR compiler framework, HEIR introduces HE-specific abstraction layers at which existing optimizations and new research ideas may be easily implemented. Although many HE optimization techniques have been proposed, it remains difficult to combine or compare them effectively. HEIR provides a means to effectively explore the space of HE optimizations. HEIR addresses the entire HE stack and includes support for various frontends, including Python. The contribution of this work includes: (1) We introduce HEIR as a framework for building HE compilers. (2) We validate HEIR's design by porting a large fraction of the HE literature to HEIR, and we argue that HEIR can tackle more complicated and diverse programs than prior literature. (3) We provide evidence that HEIR is emerging as the de facto HE compiler for academic research and industry development.