cs.CRNov 24, 2025

CrypTorch: Unified PyTorch-based Auto-tuning Compiler for Private Machine Learning Inference

Authors: Jinyu Liu, Gang Tan, Kiwan Maeng

Organizations: The Pennsylvania State University, University Park, PA, USA

Abstract

MPC-based ML uses secure multi-party computation (MPC) to execute machine learning (ML) workloads across multiple parties without requiring any party to reveal its private data or model parameters. Our characterization study finds that the performance of state-of-the-art MPC frameworks is often dominated by operator-approximation strategies, where ML operators not natively supported by MPC are replaced with iterative methods or polynomials. These approximations are typically chosen heuristically by each framework and applied globally. As a result, they can be unnecessarily expensive in some cases, yet insufficiently accurate in others. We find that the best approximation choice depends on the context, target framework, and application, making a single globally fixed approximation fundamentally suboptimal. To address this problem, we design CrypTorch, a multi-stage compiler for MPC-based ML that supports multiple MPC frameworks as backends. At the core of CrypTorch is its auto-tuning stage, which extracts cost estimates from the target MPC backend and quality estimates from a proxy PyTorch execution, and uses them to automatically select a set of approximations that maximizes performance while satisfying the given quality constraint. We show that CrypTorch's auto-tuner improves performance across multiple MPC backends by 1.14--1.60x without degrading accuracy, and by 1.17--1.92x with less than 3% accuracy degradation. CrypTorch's unified design also improves programmability and usability by allowing multiple backends to share other common compiler functionality and optimizations. We further show that the auto-tuner extends to a related fully homomorphic encryption (FHE) backend, reducing the number of bootstrapping operations by 1.31--1.65x.

Figures & tables

Explore similar work

CardsList
  1. LRD-MPC: Efficient MPC Inference through Low-rank Decomposition

    Feb 16, 2026Tingting Tang, Yongqin Wang, Murali AnnavaramPrivacy-Preserving MLEfficient Neural Network Inference