FHEFusion: Enabling Operator Fusion in FHE Compilers for Depth-Efficient DNN Inference
This program is tentative and subject to change.
Operator fusion is essential for accelerating FHE-based DNN inference because it reduces multiplicative depth and, in turn, lowers the cost of ciphertext operations by keeping them at lower ciphertext levels. Existing approaches either rely on manual optimizations, which miss cross-operator opportunities, or on compiler pattern matching, which lacks generality. Standard DNN graphs omit FHE-specific behaviors, while fully lowering to primitive FHE operations introduces excessive granularity and obstructs effective optimization.
We present FHEFusion, a compiler framework for the CKKS scheme that enables fusion through a new IR. This IR preserves high-level DNN semantics while introducing FHE-aware operators—masking and compaction ($\mathsf{Strided_Slice}$)—that are central to CKKS, thereby exposing broader fusion opportunities. Guided by algebraic rules and an FHE-aware cost model, FHEFusion reduces multiplicative depth and identifies profitable fusions. Integrated into ANT-ACE, a state-of-the-art FHE compiler, FHEFusion outperforms nGraph, the only framework with graph-level fusion, achieving up to $3.02\times$ (average $1.40\times$) speedup across seven DNNs (13 variants from different RELU approximations) on CPUs, while maintaining inference accuracy.