我看到,nvprof可以剖析內核中觸發器的數量(使用下面的參數)。當我瀏覽文檔時(這裏是http://docs.nvidia.com/cuda ......它說flop_count_sp是「由非謂詞線程執行的單精度浮點運算的數目(加法,乘法,乘法 - 累加和特殊)。每次乘法累加運算貢獻2計數。」Nvidia的FLOPS的nvprof輸出
然而,當我運行的flop_count_sp
結果(這應該是flop_count_sp_add
+ flop_count_sp_mul
+ flop_count_sp_special
+ 2 * flop_count_sp_fma
)我發現,它並沒有在求和包括flop_count_sp_special
值。
你能告訴我我應該使用什麼嗎?我應該增加這個值的總和flop_count_sp
或我應該考慮噸他的公式不包括flop_count_sp_special
的值?
你也可以告訴我什麼是這些特殊操作?
我使用以下命令行:
nvprof --metrics flops_sp --metrics flops_sp_add --metrics flops_sp_mul --metrics flops_sp_fma --metrics flops_sp_special myKernel args
哪裏myKernel
是由具有args中給出了一些輸入參數我CUDA內核的名稱。
比如我nvprof輸出的部分如下圖所示:
==20549== Profiling result:
==20549== Metric result:
Invocations Metric Name Metric Description Min Max Avg
Device "Tesla K40c (0)"
Kernel: mykernel(float*, int, int, float*, int, float*, int*)
2 flop_count_sp Floating Point Operations(Single Precisi 70888 70888 70888
2 flop_count_sp_add Floating Point Operations(Single Precisi 14465 14465 14465
2 flop_count_sp_mul Floating Point Operation(Single Precisio 14465 14465 14465
2 flop_count_sp_fma Floating Point Operations(Single Precisi 20979 20979 20979
2 flop_count_sp_special Floating Point Operations(Single Precisi 87637 87637 87637
您可以提供個別事件/指標的值嗎?你的命令行對我來說似乎並不合適,沒有像'flops_sp *'這樣的指標。 – Tom