[论文解读] Efficient and Generic 1D Dilated Convolution Layer for Deep Learning
本论文提出了一种针对x86 CPU的优化通用1D空洞卷积层,利用LIBXSMM的BRGEMM内核,结合Intel AVX-512与bfloat16指令,使Cascade Lake和Cooper Lake CPU的理论峰值效率达到最高80%。在端到端基因组学训练中,其性能相比八张V100 GPU最高提升2.27倍,且在大规模数据集和多种超参数下表现出线性可扩展性。
Convolutional neural networks (CNNs) have found many applications in tasks involving two-dimensional (2D) data, such as image classification and image processing. Therefore, 2D convolution layers have been heavily optimized on CPUs and GPUs. However, in many applications - for example genomics and speech recognition, the data can be one-dimensional (1D). Such applications can benefit from optimized 1D convolution layers. In this work, we introduce our efficient implementation of a generic 1D convolution layer covering a wide range of parameters. It is optimized for x86 CPU architectures, in particular, for architectures containing Intel AVX-512 and AVX-512 BFloat16 instructions. We use the LIBXSMM library's batch-reduce General Matrix Multiplication (BRGEMM) kernel for FP32 and BFloat16 precision. We demonstrate that our implementation can achieve up to 80% efficiency on Intel Xeon Cascade Lake and Cooper Lake CPUs. Additionally, we show the generalization capability of our BRGEMM based approach by achieving high efficiency across a range of parameters. We consistently achieve higher efficiency than the 1D convolution layer with Intel oneDNN library backend for varying input tensor widths, filter widths, number of channels, filters, and dilation parameters. Finally, we demonstrate the performance of our optimized 1D convolution layer by utilizing it in the end-to-end neural network training with real genomics datasets and achieve up to 6.86x speedup over the oneDNN library-based implementation on Cascade Lake CPUs. We also demonstrate the scaling with 16 sockets of Cascade/Cooper Lake CPUs and achieve significant speedup over eight V100 GPUs using a similar power envelop. In the end-to-end training, we get a speedup of 1.41x on Cascade Lake with FP32, 1.57x on Cooper Lake with FP32, and 2.27x on Cooper Lake with BFloat16 over eight V100 GPUs with FP32.
研究动机与目标
- 解决基因组学与语音处理中基于CPU的深度学习工作负载缺乏高效通用1D卷积实现的问题。
- 针对x86 CPU,利用AVX-512与bfloat16指令优化1D空洞卷积层,以提升性能与能效。
- 在各种输入宽度、滤波器大小、空洞率与通道配置下实现高性能。
- 在大规模基因组学数据集上,利用多插槽CPU系统展示可扩展性与效率。
- 在真实世界训练场景中超越现有的oneDNN库与基于GPU的实现。
提出的方法
- 利用LIBXSMM的批量归约GEMM(BRGEMM)内核进行单精度(FP32)与bfloat16(BF16)精度计算。
- 应用JIT代码生成与缓存分块技术,优化内存访问模式,提升数据局部性。
- 通过im2col变换将1D空洞卷积映射为GEMM操作,从而重用高度优化的GEMM内核。
- 利用AVX-512与AVX-512 bfloat16指令,充分发挥现代Intel CPU的向量级并行性。
- 设计通用接口,支持可变的输入宽度、滤波器大小、空洞率与通道数。
- 将优化后的层集成到真实基因组学模型(如AtacWorks)的端到端训练流水线中。
实验结果
研究问题
- RQ1能否通过基于GEMM的方法与现代指令集,在x86 CPU上高效实现通用1D空洞卷积层?
- RQ2在多种超参数下,所提实现与oneDNN及基于GPU(V100)实现的性能相比如何?
- RQ3该优化后的1D卷积层在数据集规模增大与多插槽CPU配置下,其可扩展性如何?
- RQ4在基于CPU的基因组学训练工作负载中,使用AVX-512与bfloat16精度能获得多大性能提升?
- RQ5在内存受限场景下,该优化层能否处理极长输入序列而不会出现内存不足错误?
主要发现
- 优化后的1D卷积层在Intel Xeon Cascade Lake与Cooper Lake CPU上最高达到80%的理论峰值性能。
- 在16个插槽的Cascade Lake CPU上,使用AtacWorks模型进行FP32训练时,性能相比八张V100 GPU提升1.41倍。
- 使用bfloat16精度时,16个插槽的Cooper Lake CPU相比八张V100 GPU实现2.27倍性能提升,证明了bfloat16在CPU上的优势。
- 在所有测试的输入宽度、滤波器大小、空洞率与通道数配置下,该实现均优于oneDNN库。
- 该方法在数据集规模上表现出线性可扩展性:当训练集规模增加9.16倍时,每轮训练时间仅增加约9.16倍,性能保持一致。
- 该实现成功在60万碱基的信号轨迹片段上完成训练,未出现内存不足错误,而V100 GPU因内存限制失败。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。