arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.12445cs.PF
收藏

可扩展的打包布局用于向量长度无关的机器学习代码生成

Scalable Packed Layouts for Vector-Length-Agnostic ML Code Generation

RooflineAI;RWTH Aachen University(亚琛工业大学)

Ege Beysel, Maximilian Bartel, Jan Moritz Joseph

AI总结:

本文提出了一种基于向量长度感知的打包数据布局和编译器扩展的方法,用于在端到端的机器学习编译流水线中实现向量长度无关的代码生成,通过在MLIR/IREE中集成这些机制,扩展了tiling、融合和向量化操作以支持可扩展的向量长度,实验表明该方法在实际机器学习工作负载上生成的SVE代码性能优于现有的NEON代码生成,且在生产编译器环境中表现出色。

摘要:

可扩展的向量指令集,如Arm SVE,使向量长度无关(VLA)执行成为可能,允许单个实现适应不同向量长度的硬件。然而,它们使编译器代码生成变得更加复杂,因为tiling和数据布局决策不能再在编译时固定。我们提出了一种方法,通过向量长度感知的打包数据布局和相应的编译器扩展,在端到端的机器学习编译流水线中实现VLA代码生成。我们将这些机制集成到MLIR/IREE中,并扩展tiling、融合和向量化以操作可扩展的向量长度。在实际的机器学习工作负载上评估,我们的方法生成的SVE代码在IREE中与现有的NEON代码生成竞争,并在某些情况下表现更优,达到最高1.45倍的加速。我们还优于PyTorch生态系统框架,包括ExecuTorch、TorchInductor和eager执行,证明了可扩展向量化的有效性。基于模拟器的研究进一步表明,生成的代码在计算密集型工作负载上随着SVE向量长度的增加而扩展,支持在不同硬件配置上的性能可移植性。

英文摘要:

Scalable vector instruction sets such as Arm SVE enable vector-length-agnostic (VLA) execution, allowing a single implementation to adapt across hardware with different vector lengths. However, they complicate compiler code generation, as tiling and data layout decisions can no longer be fixed at compile time. We present an approach for enabling VLA code generation in an end-to-end ML compilation pipeline through vector-length-aware packed data layouts and corresponding compiler extensions. We integrate these mechanisms into MLIR/IREE and extend tiling, fusion, and vectorization to operate with scalable vector lengths. Evaluated on real-world ML workloads on Arm CPUs, our approach generates SVE code that is competitive with, and often outperforms, existing NEON-based code generation within IREE, achieving up to $1.45\times$ speedup. We also outperform PyTorch ecosystem frameworks, including ExecuTorch, TorchInductor, and eager execution, demonstrating the effectiveness of scalable vectorization in a production compiler setting. A simulator-based study further shows that the generated code scales with increasing SVE vector length on compute-bound workloads, supporting performance portability across hardware configurations.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑