[Paper Review] RegDem: Increasing GPU Performance via Shared Memory Register Spilling
This paper proposes RegDem, a binary translation technique that improves GPU performance by spilling excess registers to underutilized shared memory instead of off-chip local memory, thereby increasing occupancy. By optimizing register usage and using a compile-time performance predictor to select the best variant, RegDem achieves a 9% geometric mean speedup over the nvcc compiler, with a peak of 18% on nine benchmarks.
GPU utilization, measured as occupancy, is limited by the parallel threads' combined usage of on-chip resources, such as registers and the programmer-managed shared memory. Higher resource demand means lower effective parallel thread count, and therefore lower program performance. Our investigation found that registers are often the occupancy limiters. The de-facto nvcc compiler-based approach spills excessive registers to the off-chip memory, ignoring the shared memory and leaving the on-chip resources underutilized. To mitigate the register demand, this paper presents a binary translation technique, called RegDem, that spills excessive registers to the underutilized shared memory by transforming the GPU assembly code (SASS). Most GPU programs do not fully use shared memory, thus allowing RegDem to use it for register spilling. The higher occupancy achieved by RegDem outweighs the slightly higher cost of accessing shared memory instead of placing data in registers. The paper also presents a compile-time performance predictor that models instructions stalls to choose the best version from a set of program variants. Cumulatively, these techniques outperform the nvcc compiler with a 9% geometric mean, the highest observed being 18%.
Motivation & Objective
- Address the performance bottleneck caused by register pressure limiting GPU occupancy.
- Overcome the inefficiency of nvcc's default strategy of spilling to off-chip local memory, which increases instruction latency.
- Leverage underutilized on-chip shared memory as a faster alternative for register spilling to improve performance.
- Develop a compile-time performance predictor to select the optimal code variant among different register allocation strategies.
- Enable practical deployment of register demotion via a binary translation pass on SASS assembly, bypassing proprietary compiler constraints.
Proposed method
- Perform binary translation on GPU SASS assembly to convert excessive register spills to shared memory accesses.
- Use three register demotion strategies: static access counting, control-flow graph (CFG) traversal with loop weighting, and operand conflict analysis.
- Compact non-contiguous register spaces to minimize the highest register number, reducing hardware register pressure.
- Integrate instruction scheduling and bank conflict avoidance to maintain performance during optimization.
- Develop a performance predictor that estimates stalls using occupancy, instruction throughput, and memory access latencies via the equation: $\text{stall} = \text{inst}_{\text{stall}} \times \text{occupancy} \times \frac{\text{MAX\textunderscore THROUGHPUT}}{\text{inst}_{\text{throughput}}}$.
- Use the predictor to select the best variant from multiple optimization strategies, achieving 99% accuracy compared to exhaustive search.
Experimental results
Research questions
- RQ1Can spilling excess registers to shared memory instead of local memory improve GPU occupancy and performance?
- RQ2Does the performance gain from faster on-chip shared memory outweigh the cost of increased memory access latency compared to registers?
- RQ3How can a compile-time performance predictor effectively estimate the best code variant when trade-offs exist between register pressure, instruction efficiency, and memory access costs?
- RQ4To what extent can binary translation of SASS assembly enable effective register demotion without access to compiler source code?
- RQ5What is the impact of shared memory underutilization on the feasibility and performance of register demotion techniques?
Key findings
- RegDem achieves a 9% geometric mean speedup over the nvcc compiler across nine diverse GPU benchmarks, with a maximum speedup of 18%.
- The performance predictor selects the optimal code variant with 99% accuracy compared to exhaustive search, enabling efficient variant selection.
- Shared memory is underutilized in all evaluated GPU kernels, providing sufficient space for register spilling without resource contention.
- Spilling to shared memory reduces occupancy bottlenecks more effectively than local memory spilling, even with higher access cost, due to lower latency.
- The binary translation approach successfully implements register demotion without requiring access to the proprietary nvcc compiler infrastructure.
- The method effectively handles register bank conflicts and multi-word register allocation, ensuring correctness and performance.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.