1
数学库
如何profile核函数运行时使用多少显存带宽?
2025-07-16 15:24:20
114

使用hipprof --pmc得到的数据只到L2缓存,无法看到核函数对全局内存的访问情况,这对于分析核函数是memory-bound还是compute-bound十分麻烦
在性能分析培训视频
https://developer.sourcefind.cn/wp-content/uploads/2023/03/%E5%BC%82%E6%9E%84%E8%AE%A1%E7%AE%97%E5%B9%B3%E5%8F%B0%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E6%8A%80%E6%9C%AF.mp4
中提到了TA、TCC参数,但是在hipprof --pmc的输出中并没有看到

attachmentId-image.png
我的hipprof --pmc输出为
root@worker-0:/work/home/lets_daze/conv3d# head -n 30 pmc_results_61.txt
kernel-name:"Conv3d"
kernel dispatch index 0
gpu id 0
dispatch queue id 0
dispatch queue index 6
thread id 63
grid size 55115776
work group size 256
shared memory size 2048
scratch size 0
vgpr count 16
sgpr count 48
fbarrier count 0
signal handle 0x0
kernel time 0.087216(s)
processed ALU instructions 96.852296(%)
performance 9843.297374(Gflops)
shared memory operation 651056388
shared memory bank conflict 0.000000(%)
L1 cache unit is active 24.133045(%)
L1 cache unit is stalled 0.605108(%)
L2 cache write unit is stalled 0.000000(%)
L2 cache hit rate 96.177484(%)
请问如何看到核函数访问全局内存的大小和带宽?

全部评论(3)
只看楼主
C
changhl
1楼

老师,您好。

对于全局内存访问情况:可以通过hy-smi --showmeminfo监控;如果通过pmc分析,可以使用hipprof --pmc-read或者--pmc-write ,是指从全局内存到L2的情况

对于显存带宽:pmc无法获取,可以使用hyqual 获取上限值 https://download.sourcefind.cn:65024/5/main/%E5%9F%BA%E7%A1%80%E5%8E%8B%E5%8A%9B%E5%B7%A5%E5%85%B7

2025/7/16
网
网友张顺飞
回复 @changhl
请问“使用hipprof --pmc-read或者--pmc-write ,是指从全局内存到L2的情况”,“是指从全局内存到L2的情况”是什么意思呢?可否再详细讲解一下呢?谢谢!
2025/7/19
C
changhl
回复 @changhl

您好,详细可以参考这个链接下的hipprof文档:https://download.sourcefind.cn:65024/1/main/DTK-25.04.1/Document 下的《hipprof使用手册》。

read,write分别指的是内存到L2的读写请求数
2025/7/21
没有更多内容了
--
楼主
Level.1
0 帖子
楼主热帖
暂无数据