We introduce an algorithm for efficiently representing convolution with zero-padding and stride as a sparse transformation matrix, applied to a vectorized input through sparse matrix-vector multiplication (SpMV). We provide a theoretical contribution with an explicit expression for the number of non-zero multiplications in convolutions with stride and padding, offering insight into the potential for leveraging sparsity in convolution operations. A proof-of-concept implementation is presented in Python, demonstrating the performance of our method on both CPU and GPU architectures. This work contributes to the broader exploration of sparse matrix techniques in convolutional algorithms, with a particular focus on leveraging matrix multiplications for parallelization. Our findings lay the groundwork for future advancements in exploiting sparsity to improve the efficiency of convolution operations in fields such as machine learning and signal processing.
翻译:本文提出一种高效算法,将带零填充和步长的卷积运算表示为稀疏变换矩阵,并通过稀疏矩阵-向量乘法(SpMV)作用于向量化输入。我们通过推导带步长与填充的卷积运算中非零乘法次数的显式表达式,为理解卷积操作中稀疏性利用潜力提供了理论依据。文中展示了基于Python的概念验证实现,在CPU和GPU架构上验证了该方法的性能。本研究为卷积算法中稀疏矩阵技术的广泛探索作出贡献,特别关注利用矩阵乘法实现并行化。我们的发现为未来在机器学习和信号处理等领域通过利用稀疏性提升卷积运算效率奠定了理论基础。