Fast matrix multiplication for binary and ternary CNNs on ARM CPU
Moscow Institute of Physics and Technology(莫斯科物理技术学院);Federal Research Center “Computer Science and Control” of Russian Academy of Sciences(俄罗斯科学院计算机科学与控制联邦研究中心);Smart Engines Service LLC(Smart Engines服务有限责任公司);Institute for Information Transmission Problems, RAS(俄罗斯科学院信息传输问题研究所)
Anton Trusov, Elena Limonova, Dmitry Nikolaev, Vladimir V. Arlazarov
备注:
Accepted to 26th International Conference on Pattern Recognition (ICPR 2022)
Low-bit quantized neural networks are of great interest in practical applications because they significantly reduce the consumption of both memory and computational resources. Binary neural networks are memory and computationally efficient as they require only one bit per weight and activation and can be computed using Boolean logic and bit count operations. QNNs with ternary weights and activations and binary weights and ternary activations aim to improve recognition quality compared to BNNs while preserving low bit-width. However, their efficient implementation is usually considered on ASICs and FPGAs, limiting their applicability in real-life tasks. At the same time, one of the areas where efficient recognition is most in demand is recognition on mobile devices using their CPUs. However, there are no known fast implementations of TBNs and TNN, only the daBNN library for BNNs inference. In this paper, we propose novel fast algorithms of ternary, ternary-binary, and binary matrix multiplication for mobile devices with ARM architecture. In our algorithms, ternary weights are represented using 2-bit encoding and binary - using one bit. It allows us to replace matrix multiplication with Boolean logic operations that can be computed on 128-bits simultaneously, using ARM NEON SIMD extension. The matrix multiplication results are accumulated in 16-bit integer registers. We also use special reordering of values in left and right matrices. All that allows us to efficiently compute a matrix product while minimizing the number of loads and stores compared to the algorithm from daBNN. Our algorithms can be used to implement inference of convolutional and fully connected layers of TNNs, TBNs, and BNNs. We evaluate them experimentally on ARM Cortex-A73 CPU and compare their inference speed to efficient implementations of full-precision, 8-bit, and 4-bit quantized matrix multiplications.
Caffe con Troll: Shallow Ideas to Speed Up Deep Learning
Stanford University(斯坦福大学);University of Wisconsin-Madison(威斯康星大学麦迪逊分校)
我们提出了Caffe con Troll(CcT),这是一个完全兼容的端到端版本的流行框架Caffe,具有重建的内部结构。我们构建了CcT来检查在不同硬件架构上训练和部署通用卷积神经网络的性能特征。我们发现,通过对CPU训练进行标准的优化,我们在CaffeNet等流行网络上实现了比Caffe高4.5倍的吞吐量提升。此外,通过这些改进,CNN的端到端训练时间与CPU提供的FLOPS成正比,这使我们能够有效地为CNN训练混合CPU-GPU系统。
Spectra 1.1: Scaling Laws and Efficient Inference for Ternary Language Models
Nolano AI;Mila- Quebec AI institute(Mila- Quebec AI研究所);Université de Montréal(蒙特利尔大学);McGill University(麦吉尔大学);École de technologie supérieure, Université du Québec(魁北克大学工程学院);Google, India(谷歌(印度));Morgan Stanley(摩根大通)
Do Newer Lightweight CNNs Perform Better Under Resource Constraints? A Controlled Multigenerational Study of Architecture, Initialization, Training Budget, and Efficiency