将带填充和步幅的卷积转化为稀疏矩阵乘法,提升计算效率。
A Simple Sparse Matrix Vector Multiplication Approach to Padded Convolution
- 用稀疏矩阵表示带填充和步幅的卷积,通过SpMV实现向量化计算。
- 理论推导出非零乘法次数,揭示了卷积中可利用的稀疏性。
- 支持CPU与GPU,适合关注高效卷积实现的研究者。
我们提出一种高效表示带零填充和步幅卷积的方法,将其转化为稀疏变换矩阵,并通过稀疏矩阵-向量乘法(SpMV)作用于向量化输入。本文给出带步幅和填充卷积中非零乘法次数的显式表达式,为挖掘卷积操作中的稀疏性提供理论依据。在Python中实现概念验证,展示该方法在CPU和GPU架构上的性能表现。本工作推动了稀疏矩阵技术在卷积算法中的应用,尤其聚焦于利用矩阵乘法实现并行化。研究成果为未来在机器学习和信号处理领域利用稀疏性提升卷积效率奠定了基础。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。