How to Improve CUDA Kernel Performance with Shared Memory Register Spilling

AI-generated summary of reporting by NVIDIA Developer Blog. Read the original for the full story.

Why it matters

CUDA developers with register-heavy kernels can now opt into a compiler pragma that cuts spill latency, typically gaining 5-10% on real HPC workloads.

Read this as

NVIDIA's CUDA Toolkit version 13.0 adds a compiler option called shared memory register spilling. When a program needs more registers than the GPU chip has, the compiler used to stash the overflow in slower, off-chip memory; now it can put it in fast memory right on the chip instead. Test kernels ran about 7.8% faster, and scientific computing routines gained 5-10%. It only helps a specific class of GPU programs and must be switched on manually by the developer.

NVIDIA is shipping an opt-in compiler optimization in CUDA Toolkit 13.0 that redirects register overflow from slow off-chip memory to fast on-chip shared memory, delivering 5-10% speedups on QUDA library kernels for lattice QCD and 7.76% on NVIDIA's demo kernel. Teams running HPC or simulation workloads on GPUs can adopt it this week via a pragma. Adoption carries constraints: dynamic shared memory, debug builds and per-function compilation are unsupported, and missing launch bounds can regress performance.

CUDA 13.0's PTXAS adds the enable_smem_spilling pragma, spilling high-cost registers to on-chip shared memory instead of local memory, falling back when smem is exhausted. On a 255-register demo kernel it eliminated all 176-byte spill stores/loads, allocated 46,080 bytes smem per block, and cut duration 7.76%, elapsed cycles 7.8% and SM active cycles 19.03%; QUDA kernels gained 5-10%. It requires whole-program compilation (-rdc=false), explicit launch bounds, and static shared memory; incompatible with -G, -rdc=true and dynamic smem.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

CUDA Toolkit 13.0 PTXAS QUDA Nsight Compute enable_smem_spilling

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading