cuda - CUDA 中指令重放的其他原因

标签 cuda profiling

这是我从 nvprof (CUDA 5.5) 获得的输出:

Invocations                 Metric Name              Metric Description         Min         Max         Avg
Device "Tesla K40c (0)"
Kernel: MyKernel(double const *, double const *, double*, int, int, int)
     60            inst_replay_overhead     Instruction Replay Overhead    0.736643    0.925197    0.817188
     60          shared_replay_overhead   Shared Memory Replay Overhead    0.000000    0.000000    0.000000
     60          global_replay_overhead   Global Memory Replay Overhead    0.108972    0.108972    0.108972
     60    global_cache_replay_overhead  Global Memory Cache Replay Ove    0.000000    0.000000    0.000000
     60           local_replay_overhead  Local Memory Cache Replay Over    0.000000    0.000000    0.000000
     60                gld_transactions        Global Load Transactions       25000       25000       25000
     60                gst_transactions       Global Store Transactions       75000       75000       75000
     60  warp_nonpred_execution_efficie  Warp Non-Predicated Execution       99.63%      99.63%      99.63%
     60                       cf_issued  Issued Control-Flow Instructio       44911       45265       45101
     60                     cf_executed  Executed Control-Flow Instruct       39533       39533       39533
     60                     ldst_issued  Issued Load/Store Instructions      273117      353930      313341
     60                   ldst_executed  Executed Load/Store Instructio       50016       50016       50016
     60              stall_data_request  Issue Stall Reasons (Data Requ      65.21%      68.93%      67.86%
     60                   inst_executed           Instructions Executed      458686      458686      458686
     60                     inst_issued             Instructions Issued      789220      879145      837129
     60                     issue_slots                     Issue Slots      716816      803393      759614

内核使用 356 字节 cmem[0],并且没有共享内存。此外,没有寄存器溢出。 我的问题是,在这种情况下指令重播的原因是什么?我们看到开销为 81%,但这些数字并没有相加。

谢谢!

最佳答案

一些可能的原因:

  1. 共享内存库冲突(您没有)
  2. 常量内存冲突(即 warp 中的不同线程从同一指令请求常量内存中的不同位置)
  3. warp 发散代码(if..then..else 对 warp 中的不同线程采用不同的路径)

这个presentation可能会感兴趣,尤其是幻灯片 8-11。

关于cuda - CUDA 中指令重放的其他原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22103480/

相关文章:

c - 如何将结构数组传递给GPU?

cuda - 半 float 的 FLT_MAX

c++ - 测量使用预编译库(C++、Linux)的程序的总 CPU 时间

我可以为了分析目的人为地减慢 C trig 函数吗?

debugging - 传递给设备函数的共享内存地址仍然是共享内存吗?

C++ 2.5 字节(20 位)整数

c++ - 来自线性化矩阵 CUDA 的唯一行

使用 fprof 对 CPU 时间进行 Erlang 性能分析

java - 如何测量线程堆栈深度?

python - 为什么 psycopg2 对我这么慢?