Although prior art has demonstrated negligible accuracy drop in sub-byte quantization -- where weights and/or activations are represented by less than 8 bits -- popular SIMD instructions of CPUs do not natively support these datatypes. While recent methods, such as ULPPACK, are already using sub-byte quantization on general-purpose CPUs with vector units, they leave out several empty bits between the sub-byte values in memory and in vector registers to avoid overflow to the neighbours during the operations. This results in memory footprint and bandwidth-usage inefficiencies and suboptimal performance. In this paper, we present memory layouts for storing, and mechanisms for processing sub-byte (4-, 2-, or 1-bit) models that utilize all the bits in the memory as well as in the vector registers for the actual data. We provide compute kernels for the proposed layout for the GEMV (GEneral Matrix-Vector multiplication) operations between weights and activations of different datatypes (e.g., 8-bit activations and 4-bit weights). For evaluation, we extended the TFLite package and added our methods to it, then ran the models on the cycle-accurate gem5 simulator to compare detailed memory and CPU cycles of each method. We compare against nine other methods that are actively used in production including GEMLOWP, Ruy, XNNPack, and ULPPACK. Furthermore, we explore the effect of different input and output sizes of deep learning layers on the performance of our proposed method. Experimental results show 0.96-2.1x speedup for small sizes and 1.2-6.7x speedup for mid to large sizes. Applying our proposal to a real-world speech recognition model, Mozilla DeepSpeech, we proved that our method achieves 1.56-2.11x end-to-end speedup compared to the state-of-the-art, depending on the bit-width employed.
翻译:虽然先前的艺术在子byte 量化中显示的精确度下降微不足道, 重量和(或)激活值代表不到8位, 但广受欢迎的 SIMD 速度比值指示并不支持这些数据类型。 虽然最近的方法, 如 ULPPACK, 已经在一般用途的 CPU 和矢量单位上使用次byt 量化, 但是在存储和矢量登记册中留下几个小点, 以避免在操作期间向邻居溢出。 这导致记忆足迹和带宽使用效率低和亚优性性能。 在本文件中, 我们展示存储的存储的记忆规模, 以及处理亚byte (4, 2, 或 1位位) 速度比值模型的机制。 虽然最近的方法, 如 ULPACK, 已经在使用一般用途的 CPU Puc 和 矢量登记册中的所有位数进行次次次次次次次次量化的量化, 我们为 GMMV( Gneral- ter- Ventrick 倍增) 操作的重量和不同数据类型( 例如、 8 启动和4位数 重量比值 ) 等数据型的计算方法, 显示我们使用的RILIL 的计算结果, 我们的每个运行的计算方法, 我们的每个的运行的运行的运行的计算法的计算方法, 也显示了一次数的进度化的计算。