Skip to content

NPUFHE: An Efficient CKKS Execution System for Ascend NPUs

Ke Changke, Jian Wang, Xuan Xu, Yijing Zong, Jiqiang Liu

cs.CR

Abstract

Fully homomorphic encryption (FHE) enables computation directly on encrypted data, but its substantial computational cost hinders adoption in privacy-preserving artificial intelligence (AI) applications. Neural processing units (NPUs) already deployed in AI infrastructure provide a practical platform for FHE acceleration. However, after mapping the number theoretic transform (NTT) to matrix multiplications on Ascend NPUs, modular arithmetic and representation conversion on the Vector backend still incur substantial overhead at stage boundaries. Evaluation-key material of key switching also increases storage and data-transfer costs, and whole-limb task assignment causes tail load imbalance. We present NPUFHE, an end-to-end CKKS execution system optimized for Ascend NPUs. To reduce modular recovery and twiddle costs in NTT, we propose Boundary-Optimized NTT, which eliminates intra-axis modular recovery, compiles intra-axis twiddle factors into matrix constants, and introduces two-level folded modular recovery at axis endpoints. To alleviate evaluation-key storage and transfer pressure, we design Compact Shoup encoding, which halves the key representation through local coefficient recovery. Finally, we propose Cost-Aware Parallel Tiling to mitigate tail load imbalance caused by whole-limb task assignment. It uses a cost model to adaptively partition tail tasks and smooth stepwise latency increases. We integrate the above designs into OpenFHE. On one Ascend 910B4, full-packing CKKS bootstrapping with real evaluation keys takes 0.95 s, encrypted CIFAR-10 ResNet-20 inference with bootstrapping requires 9.87 s per image, and encrypted MNIST inference achieves an amortized latency of 19.81 ms per image. The peak NTT throughput of NPUFHE reaches up to 184.22×184.22\times, 2.04×2.04\times, and 4.46×4.46\times that of OpenFHE on CPU, TensorFHE, and CROSS, respectively.

Create a lesson