Skip to main content
QUICK REVIEW

[Paper 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 ComputingEngineering7 citations
TL;DR

CINM (Cinnamon) is a novel, end-to-end compilation infrastructure that enables device-agnostic and device-aware optimization for heterogeneous compute-in-memory (CIM) and compute-near-memory (CNM) architectures. By leveraging MLIR-based hierarchical lowering and reusable abstractions, CINM generates high-performance code that outperforms hand-optimized implementations on both UPMEM (CNM) and memristor-based CIM accelerators, achieving up to 5.1× speedup over CPU-optimized baselines.

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.

Motivation & Objective

  • Address the critical challenge of programmability in emerging heterogeneous CIM and CNM systems, which currently rely on low-level, device-specific programming models.
  • Enable high-level, portable programming of diverse CIM and CNM hardware by abstracting low-level device details through reusable compiler abstractions.
  • Develop a unified compilation pipeline that supports both device-agnostic and device-aware optimizations across heterogeneous memory-centric architectures.
  • Demonstrate the effectiveness of the framework by generating optimized code for real-world targets, including UPMEM (CNM) and memristor-based CIM accelerators.
  • Bridge the gap between emerging non-von-Neumann hardware and application developers by enabling productivity through concise, high-level code.

Proposed method

  • Employ MLIR (Multi-Level Intermediate Representation) to build a hierarchical lowering pipeline that progressively transforms high-level kernels into device-specific code.
  • Introduce the CINM abstraction layer that generalizes over all CIM and CNM devices, enabling selection of hardware targets via a unified interface.
  • Define domain-specific dialects—'cnm' and 'cim'—to represent device-specific types, operations, and functions tailored to CNM and CIM hardware.
  • Apply reusable, composable optimizations such as tiling, partial result management, and memory access pattern analysis to improve data locality and reduce off-chip movement.
  • Leverage existing and novel MLIR patterns to perform load balancing, data layout transformations, and memory hierarchy-aware code generation.
  • Support both general-purpose and domain-specific workloads by enabling code generation for diverse benchmarks including GEMM, BFS, and DNN kernels.

Experimental results

Research questions

  • RQ1How can a unified compilation infrastructure be designed to support both compute-in-memory (CIM) and compute-near-memory (CNM) architectures in a device-agnostic manner?
  • RQ2What abstractions and compiler techniques are necessary to enable high-level programming of heterogeneous CIM and CNM systems while preserving performance?
  • RQ3To what extent can a MLIR-based lowering pipeline with reusable components outperform hand-optimized implementations on real-world CIM and CNM accelerators?
  • RQ4How does the framework’s optimization strategy, particularly in managing partial results and tiling, impact performance across diverse workloads?
  • RQ5Can the framework significantly reduce lines of code compared to low-level device-specific implementations, thereby improving programmer productivity?

Key findings

  • CINM-generated code achieves up to 5.1× speedup over CPU-optimized configurations on the UPMEM CNM system, with average improvements of 1.6× to 2.0× over hand-optimized PrIM implementations.
  • On average, CINM-generated code is 15× more concise than low-level UPMEM C/C++ device code, significantly improving programmer productivity and maintainability.
  • For the hst-l kernel, CINM reduces execution time by 3.7× compared to the PrIM-optimized version, primarily due to superior WRAM utilization and partial result management.
  • In the va kernel, CINM achieves 1.23× better performance than PrIM on average, with the highest gains observed in data-parallel, dependency-free workloads.
  • The framework demonstrates consistent performance improvements across diverse benchmarks, including 22.33× fewer lines of code for the hst-l kernel compared to hand-optimized C/C++.
  • CINM’s hierarchical lowering and reusable abstractions enable effective optimization across multiple hardware targets, including memristor-based CIM and UPMEM CNM systems, with minimal porting effort.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.