UFO: 解锁超高效的量化隐私推理与协议和算法联合优化
UFO: Unlocking Ultra-Efficient Quantized Private Inference with Protocol and Algorithm Co-Optimization
AI总结:
UFO通过联合优化协议和算法,解决了隐私推理中卷积层的通信和精度问题,实现高效量化推理。
摘要:
基于安全多方计算(2PC)的隐私卷积神经网络(CNN)推理存在较高的通信和延迟开销,尤其是卷积层。在本文中,我们提出了UFO,一种量化2PC推理框架,旨在联合优化2PC协议和量化算法。UFO的特点是提出了一种新的2PC协议,系统地将高效的Winograd卷积算法与量化结合,以提高推理效率。然而,我们发现直接结合量化和Winograd卷积面临以下挑战:1)从推理角度看,Winograd变换引入了大量的加法运算,并需要频繁的位宽转换以避免推理溢出,导致通信开销不可忽略;2)从训练角度看,Winograd变换引入了权重异常值,使量化感知训练(QAT)变得困难,导致模型精度较差。为了解决这些挑战,我们联合优化协议和算法。1)在协议层面,我们提出了一系列图层面的优化以最小化通信。2)在算法层面,我们开发了一种基于层敏感度的混合精度QAT算法,以在通信限制下优化模型精度。为了适应这些异常值,我们进一步引入了一种适用于2PC的位重加权算法,以增加表示范围而不显式增加位宽。通过广泛的实验,UFO在通信减少方面相比最先进的框架SiRNN、COINN和CoPriv分别实现了11.7倍、3.6倍和6.3倍的减少,并在精度上分别提高了1.29%、1.16%和1.29%。
英文摘要:
Private convolutional neural network (CNN) inference based on secure two-party computation (2PC) suffers from high communication and latency overhead, especially from convolution layers. In this paper, we propose UFO, a quantized 2PC inference framework that jointly optimizes the 2PC protocols and quantization algorithm. UFO features a novel 2PC protocol that systematically combines the efficient Winograd convolution algorithm with quantization to improve inference efficiency. However, we observe that naively combining quantization and Winograd convolution faces the following challenges: 1) From the inference perspective, Winograd transformations introduce extensive additions and require frequent bit width conversions to avoid inference overflow, leading to non-negligible communication overhead; 2) From the training perspective, Winograd transformations introduce weight outliers that make quantization-aware training (QAT) difficult, resulting in inferior model accuracy. To address these challenges, we co-optimize both protocol and algorithm. 1) At the protocol level, we propose a series of graph-level optimizations for 2PC inference to minimize the communication. 2) At the algorithm level, we develop a mixed-precision QAT algorithm based on layer sensitivity to optimize model accuracy given communication constraints. To accommodate the outliers, we further introduce a 2PC-friendly bit re-weighting algorithm to increase the representation range without explicitly increasing bit widths. With extensive experiments, UFO demonstrates 11.7x, 3.6x, and 6.3x communication reduction with 1.29%, 1.16%, and 1.29% higher accuracy compared to state-of-the-art frameworks SiRNN, COINN, and CoPriv, respectively.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。