<p>Convolution algorithms based on the Winograd implementation can reduce computational complexity and are widely used in CNNs. As an emerging GPU-like accelerator, DCU has achieved some performance optimization for the Winograd algorithm, but it fails to fully exploit the Matrix Cores of DCU to further enhance the efficiency of Winograd convolution computations. This paper proposes an improved fused Winograd convolution optimization scheme that integrates all transformation stages into a single kernel, which is specifically designed to exploit the characteristics of Matrix Cores. In the input transformation stage, we design an efficient data reuse mechanism that reduces redundant global memory accesses. In the element-wise matrix multiplication stage, we transform Hadamard products into batched GEMMs, boosting computational intensity and complying with the data layout requirements of Matrix Cores. During kernel fusion, we eliminate shared memory bank conflicts by reorganizing thread layout and further introduce software pipelining to effectively mask memory access latency. The results show that our method achieves average speedups of <InlineEquation ID="IEq1"> <EquationSource Format="TEX">\(1.35 \times \)</EquationSource> </InlineEquation>and <InlineEquation ID="IEq2"> <EquationSource Format="TEX">\(1.72 \times \)</EquationSource> </InlineEquation> (up to <InlineEquation ID="IEq3"> <EquationSource Format="TEX">\(1.81\times \)</EquationSource> </InlineEquation> and <InlineEquation ID="IEq4"> <EquationSource Format="TEX">\(2.78 \times \)</EquationSource> </InlineEquation>) over the Winograd and Implicit GEMM algorithms in MIOpen under FP16 mode, and <InlineEquation ID="IEq5"> <EquationSource Format="TEX">\(1.22 \times \)</EquationSource> </InlineEquation> and <InlineEquation ID="IEq6"> <EquationSource Format="TEX">\(1.53 \times \)</EquationSource> </InlineEquation> (up to <InlineEquation ID="IEq7"> <EquationSource Format="TEX">\(1.55 \times \)</EquationSource> </InlineEquation> and <InlineEquation ID="IEq8"> <EquationSource Format="TEX">\(1.88 \times \)</EquationSource> </InlineEquation>) under FP32 mode.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Optimizing winograd-based convolution with DCU’s matrix cores

  • Jiandong Shang,
  • Fuchang Gao,
  • Zhaopeng Li,
  • Yizhe Sui,
  • Gang Wu,
  • Nan Wang,
  • Lingling Wang,
  • Dujuan Zhang

摘要

Convolution algorithms based on the Winograd implementation can reduce computational complexity and are widely used in CNNs. As an emerging GPU-like accelerator, DCU has achieved some performance optimization for the Winograd algorithm, but it fails to fully exploit the Matrix Cores of DCU to further enhance the efficiency of Winograd convolution computations. This paper proposes an improved fused Winograd convolution optimization scheme that integrates all transformation stages into a single kernel, which is specifically designed to exploit the characteristics of Matrix Cores. In the input transformation stage, we design an efficient data reuse mechanism that reduces redundant global memory accesses. In the element-wise matrix multiplication stage, we transform Hadamard products into batched GEMMs, boosting computational intensity and complying with the data layout requirements of Matrix Cores. During kernel fusion, we eliminate shared memory bank conflicts by reorganizing thread layout and further introduce software pipelining to effectively mask memory access latency. The results show that our method achieves average speedups of \(1.35 \times \) and \(1.72 \times \) (up to \(1.81\times \) and \(2.78 \times \) ) over the Winograd and Implicit GEMM algorithms in MIOpen under FP16 mode, and \(1.22 \times \) and \(1.53 \times \) (up to \(1.55 \times \) and \(1.88 \times \) ) under FP32 mode.