GPU simulator调研

1 文献合辑

gem5-gpu

2014 IEEE Comput. Archit
结合gem5和GPGPU-Sim,实现对CPU-GPU异构系统的模拟。
代码:https://github.com/gem5-gpu

Multi2Sim

2017 ISPASS
最初为单GPU设计,但现在也加入了HSA

GCN3 GPU model (in gem5)

2018 HPCA
研究机构:AMD,普渡大学
gem5内置GPU。GCN是AMD GPU的架构系列,被用于A厂的独显和APU(CPU+GPU)。

MGPUSim

2019 ISCA
代码:https://gitlab.com/akita/mgpusim go
关注多GPU simulation,模拟了AMD的GCN3架构
精度:cycle-accurate
有不少基于它的工作

Analyzing Machine Learning Workloads Using a Detailed GPU Simulator

2019 ISPASS
将GPGPU优化,可用cuDNN

Accel-sim

2020 ISCA
新的前端支持对NVIDIA的mISA进行trace-driven simulation,并更新了GPGPU-Sim的性能模型。它将machine ISA转化为独立于ISA的中间表示,再输入性能模型进行分析,因此也支持execution-driven simulation。
精度:cycle-accurate
代码:https://accel-sim.github.io,是GPGPU-Sim 4.0的一部分

NVAS

2021 HPCA
介绍了英伟达开发内部系统级GPU模拟器NVArchSim (NVAS)过程中的一些经验。NVAS的整体架构基本和GPU的微架构对应,不同component有不同保真度以达到性能和准确度的平衡。
精度:loose cycle accurate。component根据其内部设计规范Design Specification做仿真,而不是保留cycle精度的细节。大部分components根据Roofline model做模拟,而没有展现出明显的Roofline效应的component,用最小的细节去仿真。
代码:当然不开源…

2 仿真原理介绍

2.1 GPU微架构

此部分参考参考链接

NVIDIA GA100 GPU 由多个 Graphics Processing Cluster(GPC)、Texture Processing Cluster(TPC)、Stream multi-Processor( SMs 流多处理器)和 HBM2 内存控制器组成。两个SM组成一个TPC,八个TPC组成一个GPC,8个GPC构成一个GPU,相乘可以得到一个GPU有128个SM流多处理器,而每个SM内又有多个SP,对应于GPU线程。
在这里插入图片描述

2.2 GPU编译过程

此部分参考参考链接

编译过程大体分为两步:

第一步:将cuda/opencl代码转化成中间语言,vISA((virtual Instruction Set Architecture)虚拟指令集架构,这是机器无关的

第二部:Just in time编译将vISA转换成具体硬件相关的mISA(machine Instruction Set Architecture)

在nVidia的定义中,它的PTX文件对应于vISA,SASS(source and Assembly)对应于mISA。cuDNN和cuBlas等的优化往往和具体的硬件有关,对SASS依赖更强,一些优化较好的深度学习复杂比未优化前可以快50%以上。英伟达的工具ptxas将PTX转化成SASS,但不开源,也没有很多实现细节,因此过去SASS级别的的开源模拟器是缺少的,在英伟达的帮助下GPGPU SIM 4.0以及基于它的Accel-Sim也提供了SASS级别的仿真。
在这里插入图片描述

2.3 仿真方法——按input type分类

2.3.1 Functional Simulation

  • Models only the functional characteristics of ISA
    • No timing issue is considered
    • Basically a instruction-set emulator
  • One important application is validation of the design
    • Rather than evaluating system performance characteristics
  • It can also generate instruction and address traces
    • Can be used as inputs to other simulation tools!

2.3.2 Trace-Driven Simulation

  • Takes program instruction and address traces into a detailed microarchitecture timing simulator
  • Separates functional simulation from the timing simulation
  • Disadvantages:
    • The need to store the trace files (can be huge)
    • Will not accurately model the effects along mis-predicted paths

在这里插入图片描述

2.3.3 Execution-Driven Simulation

  • The de-facto simulation approach today
  • Combines functional with timing simulation
  • Achieves higher accuracy than trace-driven simulation
  • At the cost of increased development/evaluation time

2.3.4 Full system simulation

  • Trace-driven simulation and execution-driven simulation

2.4 仿真方法——按level of details分类

2.4.1 cycle-accurate simulator

2.4.2 instruction set simulator (ISS)

3 趋势

HSA: Heterogeneous System Architecture,异构系统架构,感觉是包含了异构系统的硬件标准,以及在此之上的软件生态。HSA基金会已经宣布未来支持异构统一内存访问(hUMA, heterogeneous uniform memory access)。hUMA为程序员提供了一个CPU和GPU之间的共享虚拟地址空间。
来自AMD2018的slide

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值