Abstract
We introduce CryptGPU, a system for privacy-preserving machine learning that implements all operations on the GPU (graphics processing unit). Just as GPUs played a pivotal role in the success of modern deep learning, they are also essential for realizing scalable privacy-preserving deep learning. In this work, we start by introducing a new interface to losslessly embed cryptographic operations over secret-shared values (in a discrete domain) into floating-point operations that can be processed by highly-optimized CUDA kernels for linear algebra. We then identify a sequence of "GPU-friendly" cryptographic protocols to enable privacy-preserving evaluation of both linear and non-linear operations on the GPU. Our microbenchmarks indicate that our private GPU-based convolution protocol is over 150x faster than the analogous CPU-based protocol; for non-linear operations like the ReLU activation function, our GPU-based protocol is around 10x faster than its CPU analog. With CryptGPU, we support private inference and private training on convolutional neural networks with over 60 million parameters as well as handle large datasets like ImageNet. Compared to the previous state-of-the-art, when considering large models and datasets, our protocols achieve a 2x to 8x improvement in private inference and a 6x to 36x improvement for private training. Our work not only showcases the viability of performing secure multiparty computation (MPC) entirely on the GPU to enable fast privacy-preserving machine learning, but also highlights the importance of designing new MPC primitives that can take full advantage of the GPU's computing capabilities.
Introduction
Modern deep learning is fueled by massive datasets, many of which contain sensitive personal information, such as medical records or private photographs. While Secure Multi-Party Computation (MPC) provides a mathematical framework for computing functions over "secret-shared" data without exposing raw inputs, its practical application has been severely limited by computational overhead.
Standard deep learning has achieved its current scale largely due to the parallel processing power of GPUs. However, most Privacy-Preserving Machine Learning (PPML) frameworks have historically been restricted to the CPU. This creates a significant performance gap; for instance, training a standard AlexNet model privately on a CPU-based system could take over a year. The primary technical hurdle is that GPUs are optimized for floating-point arithmetic, whereas cryptographic protocols require exact integer arithmetic over discrete rings. CryptGPU addresses this disparity by bringing the entire PPML pipeline onto the GPU.
Methodology
Lossless Embedding with CUDALongTensor
To leverage highly optimized CUDA kernels (such as cuDNN) designed for floating-point math, CryptGPU introduces the CUDALongTensor abstraction. This interface decomposes 64-bit integers into smaller 16-bit blocks. Since 64-bit floating-point numbers (doubles) possess 52 bits of mantissa precision, they can perform exact multiplications on these smaller blocks without rounding errors. This allows the system to repurpose standard linear algebra kernels for exact cryptographic math, effectively "tricking" the hardware into performing integer-based MPC at GPU speeds.
GPU-Friendly Protocols
CryptGPU utilizes a 3-party, 2-out-of-3 replicated secret sharing scheme. The system is designed around "vectorized" protocols that minimize branching (if-then statements) and heavy modular reductions, both of which are traditionally slow on GPU architectures.
Crucially, CryptGPU implements end-to-end GPU execution. Previous frameworks often offloaded linear layers to the GPU but transferred data back to the CPU for non-linear operations like ReLU. CryptGPU eliminates these costly data transfer overheads by keeping the entire computation—both linear and non-linear—on the GPU device.
Robust Approximations
For complex functions like Softmax, CryptGPU avoids Taylor series expansions, which can diverge when handling large negative numbers. Instead, it employs a limit-based approximation: $f_m(x) = (1 + x/m)^m$. This approach is more robust and better suited for the parallel nature of GPU computation.
Experimental Evaluation
The framework was tested against standard computer vision benchmarks, scaling to significantly larger datasets than previous PPML works:
- MNIST & CIFAR-10: Used for baseline comparisons.
- Tiny ImageNet: 100,000 images across 200 classes.
- ImageNet: The industry standard for object recognition, featuring 1.2 million images and 1,000 classes.
Performance Results
CryptGPU demonstrates substantial improvements over previous state-of-the-art systems like CryptFlow and FALCON:
- Private Inference: On a ResNet-152 model (60 million parameters) using ImageNet data, CryptGPU completes inference in 25 seconds—a 2.3x improvement over CryptFlow.
- Private Training: The gains are most visible in training. For AlexNet on Tiny ImageNet, CryptGPU is 36x faster than FALCON. A task that would take a year on a CPU-based system can now be completed in approximately one week.
- Microbenchmarks: At the operation level, GPU-based convolutions are over 150x faster than CPU-based versions, while ReLU operations see a 10x speedup.
Key Insights
- Bottleneck Shift: In traditional CPU-based PPML, linear layers (convolutions) consume 86–99% of processing time. By accelerating these layers by up to 72x, CryptGPU balances the computational cost between linear and non-linear layers.
- Exactness via Decomposition: The research proves that dedicated integer kernels are not a prerequisite for GPU-accelerated cryptography. Careful bit-width management and block-wise decomposition allow standard floating-point hardware to serve as a high-performance cryptographic engine.
- Architectural Optimization: The authors found that replacing Max Pooling with Average Pooling results in negligible accuracy loss while providing a significant speed boost, as Average Pooling is linear and more efficient in an MPC context.
Limitations and Future Work
Despite its success, CryptGPU faces challenges regarding memory overhead. The block-wise decomposition required for precision increases memory consumption, limiting the maximum batch size on a single GPU. Additionally, the current version does not support private batch normalization during training, a key component of modern architectures like ResNet. While CryptGPU significantly narrows the gap, a ~2000x "privacy tax" still exists between private and plaintext training, suggesting that the next frontier lies in designing even more "GPU-native" MPC primitives.
Summary updated