GPU Programming

Which statement about GPU occupancy is correct?

  1. A100% occupancy always gives peak performance
  2. BEven with low occupancy, high performance is possible if each thread has many independent computations, raising instruction-level parallelism
  3. COccupancy has no relation to performance
Show answer and explanation

Answer: B. Even with low occupancy, high performance is possible if each thread has many independent computations, raising instruction-level parallelism

Occupancy is one means of hiding latency, not the goal. If each thread can issue several independent computations or memory loads, fewer warps suffice to fill the waiting time. Conversely, cutting registers to raise occupancy can increase spills to memory and slow things down. Measuring with a profiler is the reliable way to judge performance.

  • A. If something else is the bottleneck, it does not get faster.
  • B. Correct. Warp count is not the only way to hide latency.
  • C. It affects the ability to hide latency.
Practice this topic Back to topic

More GPU Programming questions

  1. In CUDA, what is the relationship between blocks and SMs (streaming multiprocessors)?
  2. In CUDA, you want to wait mid-kernel for every other block to finish before moving to the next phase. What is the usual approach?
  3. Building a histogram of pixel values on a GPU can be slow if every thread does atomicAdd directly on 256 bins in global memory. What is a good improvement?
  4. When summing many values on a GPU, why use a tree-shaped reduction (repeatedly adding neighbors to halve the count)?
  5. How many stages does a tree-shaped reduction need to sum 1024 values?