type
status
date
slug
summary
tags
category
icon
password
下面ppt来源于超算中心Theta的介绍。
 
notion image
先运行amplifier snapshot,再针对各部分profile
notion image
 
第一步 VTune Amplifier
该工具不对代码逐行分析,只分析计数器
notion image
 
notion image
 
notion image
 
猜测该项目集成到了snapshot,但是不知道为什么不包括mpi
 

Advisor

现代HPC处理器不同层次的并行:core、in core
notion image
roofline 指示了代码的可能提升空间
memory 指示了依赖和需要的数据结构依赖
 
notion image
 
notion image
notion image
 

cache aware roofline

上限由存储带宽等级决定,上下由SIMD指令决定,roofline指示了可能的提升
  1. scalar 线以下,缺少向量化
  1. 距离向量化极限较远——向量化效率较低,遵循指导来提高。
  1. 到达向量化极限但未到达指令乘加极限,altering code或编译flag来include FMA usage
  1. 访存瓶颈:MAP分析,使用任何可能的cache 优化;当cache优化困难时,尝试reworing 算法来提高AI(algorithm intensity)
notion image
 

example: nobody demonstration

summary:
 
survey report
包含编译器transformation
notion image
 
code analythice
notion image
 
notion image
 

访存特征分析

处理器每次访问内存会读取64byte数据,当你只使用其中8byte就会造成浪费,也会造成更高的cache flash和miss
notion image
 
编译器可能在为循环自动向量化时生成gather/scacher指令,但正如前面所说,这并不代表内存真的只访问了所需要的部分,整块内存还是被读到缓存行中
notion image
💡
AOS:array of structure 指向结构体 SOA:structure of arrays 结构体包含指针
advisor 会告诉你有gather,但不会告诉你怎么解决以及SOA AOS这些东西。

世事难料

当你做出符合期望的修改后可能发现程序运行的更慢了。
这并不是浪费时间,你会发现现在不向量化了,advisor会告诉你为啥没有向量化,编译器不会对依赖循环自动向量化
notion image
 
notion image
advisor有时会告诉你依赖要如何解决
notion image
 
当解决依赖后就会发现程序性能得到大幅提高
 
notion image

多线程化

notion image
为了指出多线程的的优化点,需要在代码中include一些东西
notion image
 
56%算不上好,但可能需要提高任务规模
notion image
 

thread roofline

图中的线是可以修改为单线程或slot
notion image
 

VTune

当我们结束向量化和多线程的工作,我们需要node级别的profile. memory /multi socket /
notion image
notion image

HPC performance

notion image
他个人常用的
包括openmp 和 mpi

memory access

把一些不常访问的数据放在DDR4而非HBM
notion image
orange overhead
green idle
没有足够的工作给每个线程,可以看出访存瓶颈
notion image
 

python source code view

notion image
 

一些调整参数

收集结果慢
数据太多
跟踪mpi
notion image
 
可以试试用emon来测试这些功能。

QA