Abstract
Differentiable rendering is a technique used in an important emerging class of visual computing applications that involves representing a 3D scene as a model that is trained from 2D images using gradient descent. Recent works (e.g. 3D Gaussian Splatting) use a rasterization pipeline to enable rendering high quality photo-realistic imagery at high speeds from these learned 3D models. These methods have been demonstrated to be very promising, providing state-of-art quality for many important tasks. However, training a model to represent a scene is still a time-consuming task even when using powerful GPUs. In this work, we observe that the gradient computation phase during training is a significant bottleneck on GPUs due to the large number of atomic operations that need to be processed. These atomic operations overwhelm atomic units in the L2 partitions causing stalls. To address this challenge, we leverage the observations that during the gradient computation: (1) for most warps, all threads atomically update the same memory locations; and (2) warps generate varying amounts of atomic traffic (since some threads may be inactive). We propose DISTWAR, a software-approach to accelerate atomic operations based on two key ideas: First, we enable warp-level reduction of threads at the SM sub-cores using registers to leverage the locality in intra-warp atomic updates. Second, we distribute the atomic computation between the warp-level reduction at the SM and the L2 atomic units to increase the throughput of atomic computation. Warps with many threads performing atomic updates to the same memory locations are scheduled at the SM, and the rest using L2 atomic units. We implement DISTWAR using existing warp-level primitives. We evaluate DISTWAR on widely used raster-based differentiable rendering workloads. We demonstrate significant speedups of 2.44x on average (up to 5.7x).
Introduction
Training state-of-the-art differentiable rendering models like 3D Gaussian Splatting is notoriously slow, even on high-end GPUs. While rendering these scenes is now lightning-fast, the training process—calculating the gradients to update millions of 3D parameters—remains a massive bottleneck.
Analysis reveals that the primary culprit is memory contention rather than raw computation. During the backward pass (gradient computation), thousands of threads attempt to update the same memory locations simultaneously using atomic operations. On modern architectures like the RTX 4090, the lopsided ratio of compute cores to memory controllers (ROP units) causes these atomic updates to overwhelm L2 cache subpartitions, leading the GPU to stall for over 60% of its cycles.
The DISTWAR Methodology
DISTWAR (Distributed-Warp level and Atomic-Unit collaborative Reduction) is a software primitive designed to optimize this bottleneck by redistributing gradient updates between the GPU's streaming multiprocessors (SMs) and L2 memory units. It leverages two key observations: intra-warp locality, where threads in a warp often update the same memory address, and sparsity, where not all threads are active simultaneously.
Key Components
- Warp-level Reduction: Instead of every thread sending individual atomic requests to the L2 cache, DISTWAR uses fast register-based primitives (e.g.,
__shfl_sync) to aggregate gradients within the SM. A single "leader" thread then sends the aggregated update to memory. - Dynamic Scheduling: To manage the overhead of warp-level reduction, DISTWAR employs a tunable "balancing threshold." This allows the system to decide at runtime whether to perform reduction at the SM level (ideal for high thread activity) or send requests directly to L2 ROP units (ideal for sparse updates).
- Implementation Variants: The framework provides SW-S (Serialized reduction) for flexibility and SW-B (Butterfly reduction) for maximum performance in non-divergent control flows.
Evaluation and Results
The researchers evaluated DISTWAR across three major frameworks: 3D Gaussian Splatting (3DGS), NvDiffRec, and Pulsar.
Performance Gains
- Speedup: Gradient computation achieved an average speedup of 2.44x, with peaks up to 5.7x. End-to-end training time improved by 1.41x on average.
- Stall Reduction: Average warp stalls per instruction dropped from 38.26 cycles in the baseline to 10.25 cycles with DISTWAR, primarily by mitigating LSU stalls.
- Comparison to Standard Libraries: DISTWAR outperformed NVIDIA’s CCCL library, which actually slowed training by 20% due to its per-parameter reduction approach. DISTWAR’s success lies in "batching" all parameters of a primitive into a single reduction flow.
Conclusion
DISTWAR addresses a critical hardware-software mismatch in modern differentiable rendering. By optimizing atomic operations through distributed reduction, it provides significant speedups that scale with GPU hardware density. While it requires some initial profiling for optimal threshold tuning, it offers a powerful software-only solution to one of the most significant bottlenecks in 3D scene reconstruction.
Summary updated