我在计算能力为3.5的CUDA卡上分析L2缓存时遇到问题。在Kepler (3.x)中,来自全局内存的加载只缓存在L2中,而不会缓存在L1中。我的问题是如何使用nvprof (命令行分析器)来查找我的全局负载在L2缓存中达到的命中率?我已经查询了我可以收集的所有指标,涉及L2 ache的指标如下:
l2_l1_read_hit_rate: Hit rate at L2 cache for all read requests from L1 cache
l2_texture_read_hit_rate: Hit rate at L2 cache for all read requests from texture cache
l2_l1_read_throughput: Memory read throughput seen at L2 cache for read requests from L1 cache
l2_texture_read_throughput: Memory read throughput seen at L2 cache for read requests from the texture cache
l2_read_transactions: Memory read transactions seen at L2 cache for all read requests
l2_write_transactions: Memory write transactions seen at L2 cache for all write requests
l2_read_throughput: Memory read throughput seen at L2 cache for all read requests
l2_write_throughput: Memory write throughput seen at L2 cache for all write requests
l2_utilization: The utilization level of the L2 cache relative to the peak utilization我得到的唯一命中率是来自L1的读取。但是对全局内存的读取永远不会来自L1,因为它们不会被缓存在那里!或者我错了,而这正是我想要的指标?
令人惊讶(或不令人惊讶)的是,有一个度量标准给出了全局内存读取的L1命中率。
l1_cache_global_hit_rate: Hit rate in L1 cache for global loads对于开普勒来说,这可能是非零的吗?
干杯!
发布于 2014-12-10 11:53:27
在CC 3.5设备上,有两个用于全局加载的路径。LDG指令通过纹理单元(l2_texture_read_hit_rate)。所有其他全局加载操作(包括未缓存的加载)都要通过L1 to L2 (l2_l1_read_hit_rate)。计数器名称为l2__read_hit_rate。此计数器并不表示加载已缓存在L1中。
如果开发人员启用L1缓存,则GK110B和GK210上的计数器l1_cached_global_hit_rate可以为非零。有关详细信息,请参阅L1 Cache上的开普调优指南部分。
发布于 2014-12-10 03:09:26
使用默认nvcc编译时,它将为0。但是,如果您使用-Xptxas -dlcm=ca执行compile,那么它可以是非零。
https://stackoverflow.com/questions/21812264
复制相似问题