利用多面体变换优化预编译内核以实现CGRA编译
Exposing Embedded Matrix Multiplication with polyhedral transformations for CGRA compilation
AI总结:
本文提出一种利用多面体变换提取隐含矩阵乘法并优化CGRA编译的方法,通过参数化调度提升资源利用率和运行效率。
摘要:
现代计算任务常涉及矩阵乘法作为核心计算模式。粗粒度可重构阵列(CGRAs)能灵活高效支持此类任务,因其结合了操作级可重构性和高能效。然而,将包含矩阵乘法的计算内核映射到最新编译策略时通常会产生次优结果,因为其多维结构阻碍了内在并行性的揭示,最终影响运行性能。本文提出一种专门针对矩阵乘法的CGRA内核调度方法,可在不同CGRA尺寸下参数化。然后描述了一种新的编译方法,通过多面体变换分析复杂计算模式,利用循环重排和拆分暴露隐藏的矩阵乘法操作。识别出的模式被替换为优化的汇编代码,而剩余程序部分则独立编译。生成CGRA配置,包括预编译和编译部分。我们的策略在矩阵乘法不直接出现在源代码时也能最大化资源利用率和运行性能。实验结果表明,在包含隐含矩阵乘法和不同大小CGRA实例的基准测试中,速度提升了最高9.1倍。
英文摘要:
Matrix-matrix multiplication (mmul) is a dominant computing pattern in edge workloads, but in real applications it is often embedded within larger affine programs and intertwined with other operations. Coarse-Grained Reconfigurable Arrays (CGRAs) can flexibly and efficiently support it, since they combine operation-level reconfigurability and high energy efficiency. However, mapping computational kernels that include mmul with state-of-the-art compilation strategies often leads to suboptimal results, since its multi-dimensional structure hampers the uncovering of its inherent parallelism and, ultimately, runtime performance. This paper presents Kernel-CGRA, a compiler flow that uses polyhedral transformations to expose legal affine mmul subspaces, lower each accepted region to a back-end-independent operation, and preserve the surrounding computation in the generic CDFG path. For CGRA execution, the operation is instantiated as a parametric output-stationary kernel, while residual regions are reconnected through context generation and live-value preservation. The matcher is intentionally strict: only regions proven to match the supported affine mmul form are rewritten. Across canonical, fused, and application-level benchmarks, Kernel-CGRA achieves runtime speedups of up to 10.2x over state-of-the-art CGRA CDFG compilation with modulo scheduling and loop unrolling.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。