UniSparse:一种面向通用稀疏格式定制的中间语言
UniSparse: An Intermediate Language for General Sparse Format Customization
AI总结:
针对现有稀疏张量编程框架格式定制灵活性不足的问题,提出中间语言UniSparse,解耦稀疏张量逻辑表示与内存布局,结合基于MLIR的编译器实现异构架构下的格式定制与代码自动生成,经多硬件实验验证有效。
摘要:
硬件专业化的持续发展趋势使得在处理通常受内存限制的稀疏工作负载时,自定义数据格式的应用日益广泛。这些格式通过利用感知稀疏模式或目标的感知数据结构与布局,优化软件/硬件实现,从而改善内存访问延迟并提升带宽利用率。然而,现有的稀疏张量编程模型和编译器几乎无法为高效定制稀疏格式提供支持。此外,由于这些框架仅通过有限的维度属性集来表示格式,缺乏适配众多新型自定义稀疏数据结构与布局变体的灵活性。为弥补这一缺陷,我们提出UniSparse——一种为表示和定制稀疏格式提供统一抽象的中间语言。与现有基于属性的框架不同,UniSparse将稀疏张量的逻辑表示(即数据结构)与其底层内存布局解耦,实现了二者的可定制化。由此,丰富的格式定制操作可通过少量定义明确的查询、变异和布局原语简洁表达。我们还基于MLIR基础设施开发了一款编译器,支持格式的自适应定制,并能为异构架构自动生成格式转换与计算操作的代码。我们通过在多种不同硬件目标(包括Intel CPU、NVIDIA GPU、AMD Xilinx FPGA以及模拟存内计算(PIM)器件)上运行采用专用格式的常用稀疏线性代数运算的实验,验证了该方法的有效性。
英文摘要:
The ongoing trend of hardware specialization has led to a growing use of custom data formats when processing sparse workloads, which are typically memory-bound. These formats facilitate optimized software/hardware implementations by utilizing sparsity pattern- or target-aware data structures and layouts to enhance memory access latency and bandwidth utilization. However, existing sparse tensor programming models and compilers offer little or no support for productively customizing the sparse formats. Additionally, because these frameworks represent formats using a limited set of per-dimension attributes, they lack the flexibility to accommodate numerous new variations of custom sparse data structures and layouts. To overcome this deficiency, we propose UniSparse, an intermediate language that provides a unified abstraction for representing and customizing sparse formats. Unlike the existing attribute-based frameworks, UniSparse decouples the logical representation of the sparse tensor (i.e., the data structure) from its low-level memory layout, enabling the customization of both. As a result, a rich set of format customizations can be succinctly expressed in a small set of well-defined query, mutation, and layout primitives. We also develop a compiler leveraging the MLIR infrastructure, which supports adaptive customization of formats, and automatic code generation of format conversion and compute operations for heterogeneous architectures. We demonstrate the efficacy of our approach through experiments running commonly-used sparse linear algebra operations with specialized formats on multiple different hardware targets, including an Intel CPU, an NVIDIA GPU, an AMD Xilinx FPGA, and a simulated processing-in-memory (PIM) device.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。