Trying to understand nvprof metrics, sm_efficiency and warp_execution_efficiency zero

cuda

Solution

A good answer here would probably involve a lengthy tutorial on CUDA execution efficiency, optimization methods and goals, as well as the mechanics of `nvprof`. Since you've provided no code at all, it would have to be entirely abstract and speculative.

If you're struggling with `nvprof` or CUDA optimization concepts, you might be better served by experimenting with `nvvp`, the visual profiler, which includes a lot of guided analysis, explanation, help, and expert systems.

To start to explore just one of your questions, `sm_efficiency` refers to the percentage of time that the SM has one or more warps that are active. Since your `sm_efficiency` is quite low, it would appear that much of the time the SM(s) as a whole is in a idle state - it is not issuing instructions. If we compare this with occupancy, for example, these are nearly orthogonal concepts. Occupancy refers roughly speaking to how many warps are resident on the SM. If the SM has a "full complement" of warps, then occupancy will be high.

Regarding your question about whether these are the "proper metrics", the "proper metrics" should follow one of 2 trajectories:

verify that basic optimization goals have been met. For CUDA, the most basic of these relate to having sufficient parallelism exposed and efficient use of the memory subsystems. None of your chosen metrics relate to efficient memory usage, for example.

an analysis-driven optimization trajectory, i.e. one that is focused on establishing the limiters to performance. There are various presentations that cover these ideas which you can search for. If you do a google search on "gtc cuda optimization" you will find presentations that do a good job of exposing basic CUDA optimization techniques, performance measurement, and analysis-driven optimization.

Marking this as CW - others may wish to add their thoughts or best practices.

Problem

I am trying to understand the nvprof metrics. I am new to CUDA and therefore trying to understand which metrics is important for performance. I wrote a kernel for calculating the sum of absolute difference between matrices. Running on a Tegra X1, it averages at about 47ms, with 1584 blocks and 1024 threads per block. Running nvprof i get these metrics: ``` achieved_occupancy Achieved Occupancy 0.982284 0.982284 0.982284 warp_execution_efficiency Warp Execution Efficiency 0.00% 0.00% 0.00% sm_efficiency Multiprocessor Activity 0.11% 0.11% 0.11% branch_efficiency Branch Efficiency 100.00% 100.00% 100.00% ipc Executed IPC 3.600738 3.600738 3.600738 ``` How come the `Warp Execution Efficiency` and `Multiprocessor Activity` are so low, when the other metrics are so good? These are the right metrics to look at when profiling the general performance of a kernel, right?

Original source