PIM Simulator

PIM 模拟器的基本分类

技术路线 代表
全系统模拟 gem5
基于平台无关的PIM的trace代码的模拟 Sinuca (HPCC’15)
Host端为真实机器,只模拟PIM端 $Sim^2PIM$ (DATE’21)
PIMSim( IEEE Computer Architecture Letters’19)

memory operations采集

  1. Intel’s Pin Software 采集 user-mode memory operations
  2. Bochs full system emulator / ZSim / gem5

各种PIM论文里的模拟器环境

文献 环境 特点
CoNDA(ISCA ’19) gem5(X86 full-system) + DRAMSim2 魔改了gem5的内存模型
Accelerating Neural Network Inference with Processing-in-DRAM: From the Edge to the Cloud(IEEE Micro) 讨论了三种PIM架构1. UPMEM(真实系统) 2. Mensa(Google’s Edge TPU in-house simulator) 3. SIMDRAM(gem5)
Ambit: In-Memory Accelerator for Bulk Bitwise Operations Using Commodity DRAM Technology(Micro 17) gem5
GraphPIM: Enabling Instruction-Level PIM Offloading in Graph Computing Frameworks Structural Simulation Toolkit (SST) [28] with MacSim [29], a cycle-level architecture simulator. HMC is simulated by VaultSim, a 3D-stacked memory simulator. We extend VaultSim with extra timing models based on DRAMSim2
ProPRAM: Exploiting the Transparent Logic Resources in Non-Volatile Memory for Near Data Computing Multi2Sim + DRAMSim2 + NVSim
Operand Size Reconfiguration for Big Data Processing in Memory(RVU 架构 DATE 17 B会) SiNUCA(类似gem5)

越来越多的工作在real PIM system上开展,基于专门的PIM模拟器的貌似很少???为什么无法满足定制的要求吗?

PIM 编译器

A compiler for automatic selection of suitable processing-in-memory instructions,

PIM cache coherence实现

Providing plug n’ play for processing-in-memory accelerators,

LazyPIM: An Efficient Cache Coherence Mechanism for Processing-in-Memory,

各种的PIM模拟器

比较,优点和局限性

模拟器名称 文献 代码 特点
ZSim + Ramulator Processing-in-memory: A workload-driven perspective https://github.com/CMU-SAFARI/ramulator-pim/ ZSim(类似gem5)+Ramulator(HMC logic layer add PIM core) 了解实现原理后,其memory端的拓展性值得期待
Sim2PIM 暂无 可以将任意PIM架构和任意host端结合,多线程very fast as perf(通过利用Host系统OS的pthread和硬件计数器来实现)缺点:Host端的cache策略等不能任意定制
gem5 SiNUCA文章指出gem5的DRAM模拟误差可以达到36%
Sinuca(HPCC 15) Sinuca: A validated micro-architecture simulator use real trace-based simulator(但是不能采OS和多线程的)
PinTools Pin: Building customized program analysis tools with dynamic instrumentation, 类似上面的,JIT执行
MultiPIM Multipim: A detailed and configurable multistack processing-in-memory simulator
Pimsim Pimsim: A flexible and detailed processing-in-memory simulator 太慢
Hmc-sim-2.0: A simulation platform for exploring custom memory cube operations 特定架构
Cycle Accurate Parallel PIM Simulator (CLAPPS) A generic processing in memory cycle accurate simulator under hybrid memory cube architecture 依赖system模拟器(SystemC HMC simulation)
Mnsim: Simulation platform for memristor-based neuromorphic computing system 不是全系统的模拟(忆阻器PIM 模拟器)
Cim-sim Non-Volatile Memory(忆阻器PIM 模拟器)

ZSim + Ramulator 功能

host CPU cores and general-purpose PIM cores.

The PIM cores are placed in the logic layer of a 3D-stacked memory (Ramulator’s HMC model).

The simulation framework does not currently support concurrent execution on host and PIM cores.

主机CPU核和通用PIM核的计算系统。PIM核心被放置在一个3d堆叠存储器(Ramulator的HMC模型)的逻辑层中。通过这个模拟框架,我们可以模拟主机CPU核和通用PIM核,目的是比较两者对于一个应用程序或其部分的性能。该仿真框架目前不支持主机和PIM核心上的并发执行。

use ZSim to generate memory traces that are fed to Ramulator.

Zim跟踪内存的使用,还可以模拟主机的缓存层次结构(包括coherence协议)。ZSim还可以模拟硬件预取器。

Ramulator simulates the memory accesses of the host cores and the PIM cores

Ramulator contains simple models of out-of-order and in-order cores that can be used for simulation of host and PIM.

需要进一步的研究学习

暂无

遇到的问题

暂无

开题缘由、总结、反思、吐槽~~

参考文献

Processing In/near Memory

缘由

  1. 指令为中心,数据移动带来的功耗墙,性能墙
  2. 内存计算的经典模式
    1. 3D的内存技术
      1. Through silicon vias
    2. ReRAM 新型结构

PIM分类

  1. 按照PIM core和memory的距离分类

  2. 新的内存工艺使得内存的最小电路单元具有计算能力(忆阻器)

  3. 基于现有的商业DRAM和处理器的设计(加速的上限低一些,但是落地推广应用的阻力也越小, 应用范围更广,编程困难低)

  4. 基于3D堆叠memory(HMC)的设计(Starting from HMC 2.0, it supports the execution of
    18 atomic operations in its logic layer.)

    1. 在每个最小存储单元融入计算能力(可以结合忆阻器)
    2. 完整的处理器核,有cache hierarchy
    3. 简单一点的应用相关的硬件计算单元
    4. 或者更简单的Functional Units (FUs)

关键技术

  1. 传统器件
    1. 地址翻译
      1. 三种不同解决思路
        1. 全部由CPU负责指令的发射和翻译
        2. 使能PIM侧页表管理,翻译机制
        3. 物理地址空间隔离(交互时需要拷贝),PIM独立管理地址空间
    2. 数据映射
      1. 物理内存地址排列的冲突(比如 GPUbank)
        1. CPU高带宽访存(会把数据分散来实现高带宽) vs PIM空间局部性(连续数据会跨多个颗粒)
      2. 纯软件方案或者软硬件结合大方案
    3. 安全性
      1. 物理内存被暴露在PIM core下,需要新的机制来确保内存安全。
    4. 数据一致性
      1. 现有一致性协议拓展差
      2. 核数量超级多,成千上万
      3. 解决方法
        1. 内存空间隔离,避免共享
        2. 弱化一致性问题,只处理特殊条件下一致性(eg.任务迁移)
        3. 批量处理一致性请求
  2. 新型器件
    1. 计算误差
    2. 外围电路大
    3. 异构编程模型
  3. 应用场景和编程模型
    1. 高能效比
    2. 高并行和NUMA访问
    3. 识别PIM函数的条件(什么函数适合用PIM做)
      1. 在所有函数中能耗最高
      2. 数据移动占据应用大比例,或者说是唯一的
      3. 访存密集型(通过LLC miss rate来判断)

根据PIM距离Memory的距离分成三类

  1. NDP GPU

论文1

https://arxiv.org/pdf/2110.01709.pdf

论文2

hardware architecture and software stack for pim based on commercial dram technology

论文3

pim-enabled instructions a low-overhead locality-aware processing-in-memory architecture

论文4

展望





问题

  1. 由于核很小,不支持OS
  2. 但是可以支持message pass(reduce等)
  3. HPC应用经过数学变化后有些变成稀疏计算的,这时候变成memory-bound。所以PIM减少了数据移动,这时提升比较大。
  4. PIM的优势在于能效比,功耗的降低。而不是绝对性能。
  5. 单chip多核怎么通过PIM的思想,软件调度来实现?(不就是减少数据移动,和更近)

需要进一步的研究学习

暂无

遇到的问题

暂无

开题缘由、总结、反思、吐槽~~

参考文献