Skip to main content
QUICK REVIEW

[论文解读] CINM (Cinnamon): A Compilation Infrastructure for Heterogeneous Compute In-Memory and Compute Near-Memory Paradigms

Asif Khan, Hamid Farzaneh|arXiv (Cornell University)|Dec 25, 2022
Advanced Memory and Neural Computing被引用 7
一句话总结

CINM(Cinnamon)是一种新颖的端到端编译基础设施,可为异构计算内存(CIM)和计算近内存(CNM)架构实现设备无关和设备感知的优化。通过利用基于MLIR的分层降低和可重用抽象,CINM生成的高性能代码在UPMEM(CNM)和基于忆阻器的CIM加速器上均优于手写优化实现,相较于CPU优化基线最高可提升5.1倍性能。

ABSTRACT

The rise of data-intensive applications exposed the limitations of conventional processor-centric von-Neumann architectures that struggle to meet the off-chip memory bandwidth demand. Therefore, recent innovations in computer architecture advocate compute-in-memory (CIM) and compute-near-memory (CNM), non-von- Neumann paradigms achieving orders-of-magnitude improvements in performance and energy consumption. Despite significant technological breakthroughs in the last few years, the programmability of these systems is still a serious challenge. Their programming models are too low-level and specific to particular system implementations. Since such future architectures are predicted to be highly heterogenous, developing novel compiler abstractions and frameworks become necessary. To this end, we present CINM (Cinnamon), a first end-to-end compilation flow that leverages the hierarchal abstractions to generalize over different CIM and CNM devices and enable device-agnostic and device-aware optimizations. Cinnamon progressively lowers input programs and performs optimizations at each level in the lowering pipeline. To show its efficacy, we evaluate CINM on a set of benchmarks for the well-known UPMEM CNM system and the memristors-based CIM accelerators. We show that Cinnamon, supporting multiple hardware targets, generates high-performance code comparable to or better than state-of-the-art implementations.

研究动机与目标

  • 解决新兴异构CIM和CNM系统中可编程性的关键挑战,这些系统目前依赖低级、设备特定的编程模型。
  • 通过抽象低级设备细节并利用可重用的编译器抽象,实现对多样化CIM和CNM硬件的高级、可移植编程。
  • 开发一个统一的编译管道,支持在异构内存为中心的架构中实现设备无关和设备感知的优化。
  • 通过为真实目标(包括UPMEM(CNM)和基于忆阻器的CIM加速器)生成优化代码,证明该框架的有效性。
  • 通过支持简洁的高级代码,弥合新兴非冯·诺依曼硬件与应用开发者之间的鸿沟,提升开发效率。

提出的方法

  • 采用MLIR(多级中间表示)构建分层降低管道,将高级内核逐步转换为设备特定代码。
  • 引入CINM抽象层,对所有CIM和CNM设备进行泛化,通过统一接口实现硬件目标的选择。
  • 定义领域特定的方言——'cnm'和'cim'——以表示针对CNM和CIM硬件定制的设备特定类型、操作和函数。
  • 应用可重用、可组合的优化技术,如分块、部分结果管理以及内存访问模式分析,以提升数据局部性并减少片外数据移动。
  • 利用现有和新型MLIR模式,实现负载均衡、数据布局转换以及内存层次结构感知的代码生成。
  • 通过支持通用和领域特定工作负载,实现对包括GEMM、BFS和DNN内核在内的多样化基准的代码生成。

实验结果

研究问题

  • RQ1如何设计统一的编译基础设施,以在设备无关的前提下支持计算内存(CIM)和计算近内存(CNM)架构?
  • RQ2为实现对异构CIM和CNM系统的高级编程并保持性能,需要哪些抽象和编译技术?
  • RQ3基于MLIR的降低管道结合可重用组件,在真实世界的CIM和CNM加速器上,其性能能否显著优于手写优化实现?
  • RQ4该框架的优化策略,特别是部分结果管理和分块机制,对多样化工作负载的性能影响如何?
  • RQ5该框架能否显著减少代码行数,从而相比低级设备特定实现大幅提升程序员生产力?

主要发现

  • 在UPMEM CNM系统上,CINM生成的代码相较于CPU优化配置最高可实现5.1倍性能提升,平均优于手写优化的PrIM实现1.6至2.0倍。
  • CINM生成的代码平均比低级UPMEM C/C++设备代码简洁15倍,显著提升了程序员生产力和可维护性。
  • 对于hst-l内核,CINM相比PrIM优化版本将执行时间减少3.7倍,主要得益于更优的WRAM利用率和部分结果管理。
  • 在va内核中,CINM平均性能比PrIM高出1.23倍,尤其在数据并行、无依赖的工作负载中提升最为显著。
  • 该框架在多样化基准测试中表现出一致的性能提升,例如hst-l内核的代码行数相比手写优化的C/C++实现减少了22.33倍。
  • CINM的分层降低和可重用抽象机制,使在基于忆阻器的CIM和UPMEM CNM系统等多种硬件目标上实现高效优化成为可能,且移植工作量极小。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。