CUDA分析器中的dram_read_transactions和gld_transactions有什么区别? [英] What is the difference between dram_read_transactions and gld_transactions in CUDA profiler?

查看:311
本文介绍了CUDA分析器中的dram_read_transactions和gld_transactions有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CUDA探查器中,有两个度量标准,分别称为dram_read_transactions和gld_transactions。 cuda Profiler用户指南说 gld_transactions表示全局内存加载事务的数量,而 dram_read_transactions表示设备内存读取的事务。我无法说出这些描述之间的区别,因为读取数据意味着加载数据,而全局内存是dram。但是,这两个指标的分析结果不同。我用一个内核进行了测试。对于具有不同线程设置的同一内核,gld_transactions始终是相同的值33554432。并且该值是稳定的。但是对于dram_read_transactions,两个不同的线程设置导致不同的值,它们的大小分别为4486636和4197096。对于大致一词,我的意思是这些值不稳定,因为它们从一个执行到另一个执行会稍有变化。我们还可以看到dram_transactions比gld_transactions小得多。所以我的问题可以在这里总结:


  1. gld_transactions和dram_read_transactions之间的真正区别是什么?

  2. 为什么dram_read_transactions比gld_transactions小得多?

  3. 对于不同的线程设置,为什么gld_transactions值稳定而dram_read_transactions不稳定?

我认为,一旦我们知道问题(1)的答案,就可以轻松地解释问题(2)和(3)。有人可以解释吗?

解决方案

全局加载是指逻辑内存空间。读取的dram指的是物理资源上的事务。您的声明如下:


读取数据意味着加载数据并且全局内存是dram。


不正确或掩盖了重要细节。


从根本上说,全局负载是由翘曲执行的指令发出的。这些负载的最初目标将是L1或L2缓存(通常)。如果全局负载由缓存内容满足,则永远不会成为dram读取事务。另一方面,如果全局加载的目标不在缓存中,则它将成为dram读取事务(通常/通常)。


此外,全局存储空间为不是唯一的内存空间。还有其他存储空间,例如本地。到本地的交易内存最终也可以通过多种方式进行服务,其中之一实际上是触发dram读取。这样的交易将不会出现在任何全球交易中。指标,但会显示在dram读取交易指标中。


我发现针对相关指标对上述图表进行了更详细的解码。


In CUDA profiler, there are two metrics called dram_read_transactions and gld_transactions. The cuda profiler user guide says "gld_transactions" means the number of global memory load transactions, while "dram_read_transactions" means device memory read transactions. I cannot tell the difference between these descriptions because reading data means loading data and global memory is dram. But the profiling results of these two metrics are different. I tested with one kernel. For the same kernel with different threads settings, the gld_transactions is always the same value 33554432. And this value is stable. But for dram_read_transactions, two different threads settings lead to different values, they are roughly 4486636 and 4197096. For the word "roughly" I mean these values are not stable because they slightly change from one execution to another. We can also see the dram_transactions is much less than gld_transactions. So my questions can be summarized here:

  1. What is the real difference between gld_transactions and dram_read_transactions?
  2. Why the dram_read_transactions is much smaller than gld_transactions?
  3. For different threads settings, why the gld_transactions value is stable while dram_read_transactions is unstable?

I think once we know the answer for question (1), then questions (2) and (3) can be easily explained. So can anyone explain this? Thanks in advance.

解决方案

A global load refers to a logical memory space. A dram read refers to a transaction on a physical resource. This statement of yours:

reading data means loading data and global memory is dram.

is either incorrect or glossing over important details.

Fundamentally, global loads are issued by instructions executed by a warp. The initial target of these loads will be L1 or L2 cache (usually). A global load, if satisfied by cache contents, will never become a dram read transaction. On the other hand, if the target of the global load is not in a cache, then it will become a dram read transaction (typically/usually).

Furthermore, the global memory space is not the only memory space. There are other memory spaces, such as local. Transactions to "local" memory can also ultimately be serviced in a variety of ways, one of which would be actually triggering a dram read. Such a transaction would not show up in any "global" metric but would show up in the dram read transaction metric.

I find this diagram/chart in the nsight VSE documentation (and tool help), of the logical and physical arrangement of memory on a GPU to be helpful in inderstanding this. I have excerpted the chart here, and highlighted in red the "links" that correspond to the metrics you identified:

This answer gives a more detailed decoding of the above diagram, for relevant metrics.

这篇关于CUDA分析器中的dram_read_transactions和gld_transactions有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆