What is Latency hiding?
Keeping waits, such as for memory, from showing up in performance by doing other work in the meantime. GPUs do it by switching among many warps.
Japanese name: レイテンシ隠蔽
Keeping waits, such as for memory, from showing up in performance by doing other work in the meantime. GPUs do it by switching among many warps.
Japanese name: レイテンシ隠蔽
Latency is the delay between issuing a request and receiving its result. A read from memory is an operation with a large delay. If the arithmetic units do nothing meanwhile, throughput falls. Latency hiding means doing other work during the wait so that the arithmetic units are not left idle. The wait itself does not get shorter. It simply shows up less in the overall throughput.
On NVIDIA GPUs, an SM holds many warps and executes whichever are ready to issue an instruction. Warp state stays on the SM, so switching takes no extra effort. Assume one issue mechanism that can issue an instruction from one warp per cycle. If each warp repeatedly issues instructions for 20 cycles and then waits 400 cycles, one round is 20 + 400 = 420 cycles. Withwarps taking turns, the gaps are filled.
A CPU mainly reduces the waits of one thread with caches, prefetching and out-of-order execution. A GPU puts more weight on filling the waits with other warps than on shortening them. So when few warps are resident on an SM, that is, when occupancy is low, the waits cannot be fully hidden. If a single thread has enough independent instructions to issue during the wait, those can, in some cases, fill the gap as well.
Answer: A. 21
One warp can issue instructions for only 20 out of every 420 cycles (20 + 400). To keep the issue unit busy,warps must take turns: while one warp waits 400 cycles, the other 20 warps fill that time by issuing 20 cycles each. With too few warps, the wait shows up in performance and the execution units sit idle. On a real GPU the number needed depends on the wait length and the instruction mix, and waits can also be filled by adding mutually independent instructions within one warp (instruction-level parallelism).
No. The time each thread waits for memory is unchanged. What rises is the amount of work the whole GPU completes per unit time.
The cost of switching differs. An OS context switch saves and swaps state such as registers. On a GPU the state of each warp stays on the SM, so no such swapping is needed.
Latency hiding appears in 6 practice questions across 3 topics, including GPU Programming, Memory Hierarchy, DRAM.
As an Amazon Associate I earn from qualifying purchases.
This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.