Papers
Topics
Authors
Recent
Search
2000 character limit reached

GPU-Based LM Solvers for Scene Reconstruction

Updated 24 December 2025
  • GPU-based Levenberg–Marquardt solvers are optimization methods that use custom CUDA kernels and a matrix-free approach to efficiently solve large-scale nonlinear least-squares problems.
  • They leverage a cache-based memory strategy and batch processing to compute Jacobian–vector products, yielding approximately 30% faster convergence compared to ADAM-based methods.
  • Empirical results demonstrate that these solvers maintain high output quality in 3D scene reconstruction, making them vital for advanced computer vision and graphics applications.

GPU-based Levenberg–Marquardt solvers are high-performance optimization methods for large-scale nonlinear least-squares problems routinely encountered in computer vision and graphics pipelines, such as 3D Gaussian Splatting (3DGS). The 3DGS-LM approach replaces classical first-order optimizers (e.g., ADAM) with a matrix-free, GPU-accelerated implementation of Levenberg–Marquardt (LM), achieving significantly faster convergence for scene reconstruction while maintaining the same output quality (Höllein et al., 2024). This solver is characterized by a sum-of-squares objective, direct GPU implementation via custom CUDA kernels, a cache-based memory strategy for efficient Jacobian-vector computation, and tight integration with batch-based processing for scalability across large datasets.

1. Mathematical Framework and Problem Setup

The optimization target is a scene parameterized by MM three-dimensional Gaussians. Each Gaussian is described by a 59-dimensional vector: 11 parameters represent position, orientation, scaling, and opacity, and 48 parameters correspond to spherical-harmonic color coefficients. A dataset of PP registered RGB images (each H×WH \times W) defines the observation space. For every pixel ii, two per-pixel losses are measured post-rendering:

  • 1i=L1\ell_{1i} = L_{1}(rendered color, ground-truth color)
  • 2i=1SSIM\ell_{2i} = 1 - SSIM(rendered patch, ground-truth patch)

The global energy is a sum of weighted squared residuals:

E(x)=i=1N[(λ11i)2+(λ22i)2]E(x) = \sum_{i=1}^{N} \left[ (\sqrt{\lambda_1 \ell_{1i}})^2 + (\sqrt{\lambda_2 \ell_{2i}})^2 \right]

where N=3HWPN = 3 \cdot H \cdot W \cdot P, λ1=0.2\lambda_1 = 0.2, and λ2=0.8\lambda_2 = 0.8. The residual vector PP0 is defined entrywise as either PP1 or PP2. The goal is PP3.

LM proceeds via the Gauss–Newton step with Tikhonov-style damping. The update equation for the PP4-th iteration is:

PP5

where PP6 is the Jacobian of PP7 with respect to PP8, and PP9 is a regularization coefficient adapted per iteration via the standard H×WH \times W0-test.

2. GPU-based Solver Architecture

The implementation is fully matrix-free, leveraging GPU parallelism and explicit CUDA kernels rather than materializing the massive sparse Jacobian matrix. All matrix computations are performed implicitly through custom operations over a “gradient cache”:

  • buildCache: For each pixel, forward rasterization is followed by a per-pixel backward pass to store all necessary “pixel-to-splat” (H×WH \times W1) gradients as flat cache entries, along with H×WH \times W2 and the gradient payload.
  • diagJTJ: Sums squared gradients per parameter to accumulate diagonal elements of H×WH \times W3.
  • applyJ: Applies H×WH \times W4 to a vector, streaming over the cache (sorted by Gaussian).
  • applyJT: Applies H×WH \times W5, streaming over the cache (sorted by splat).

Cache construction ensures efficient computation and memory coalescing, using sort operations to optimize data layout before each step.

3. Batching, Partial Update Aggregation, and Memory Management

To scale to datasets where the aggregate cache size exceeds GPU memory, the images are divided into H×WH \times W6 batches. For each batch H×WH \times W7:

  • Construct the gradient cache for the batch.
  • Accumulate batch-specific H×WH \times W8 and diagonal preconditioner H×WH \times W9.
  • Solve the regularized normal equations using Preconditioned Conjugate Gradient (PCG, see Section 4).

Partial update directions ii0 are combined as a weighted mean across batches, weighted by ii1, reflecting each batch’s constraint strength on each Gaussian:

ii2

A line search is performed on a subset of images to choose step size ii3 for the update ii4. The damping coefficient ii5 is then adjusted by the ii6-test.

4. Preconditioned Conjugate Gradient (PCG) in CUDA

Each LM update solves the regularized normal system with PCG, requiring only implicit matrix–vector multiplies. The workflow is as follows:

  • Initialize residual ii7, preconditioned vector ii8, search direction ii9.
  • For 1i=L1\ell_{1i} = L_{1}0 iterations, compute:
    • 1i=L1\ell_{1i} = L_{1}1 via applyJ
    • 1i=L1\ell_{1i} = L_{1}2 via applyJT and diagonal scaling
    • 1i=L1\ell_{1i} = L_{1}3, 1i=L1\ell_{1i} = L_{1}4 and updates to 1i=L1\ell_{1i} = L_{1}5, 1i=L1\ell_{1i} = L_{1}6, 1i=L1\ell_{1i} = L_{1}7, 1i=L1\ell_{1i} = L_{1}8 accordingly

All these steps are implemented as specialized GPU kernels, using the prebuilt gradient cache.

5. Computational Complexity and Efficiency

The dominant cost per LM iteration is in the PCG loop:

  • Rasterization + cache build: 1i=L1\ell_{1i} = L_{1}9 for a batch of 2i=1SSIM\ell_{2i} = 1 - SSIM0 images, with 2i=1SSIM\ell_{2i} = 1 - SSIM1 average splats per pixel.
  • PCG matvecs: Each iteration costs 2i=1SSIM\ell_{2i} = 1 - SSIM2, with three such passes per batch.
  • Batch combination: 2i=1SSIM\ell_{2i} = 1 - SSIM3 to aggregate updates.

In practice: 2i=1SSIM\ell_{2i} = 1 - SSIM4, 2i=1SSIM\ell_{2i} = 1 - SSIM5–2i=1SSIM\ell_{2i} = 1 - SSIM6, 2i=1SSIM\ell_{2i} = 1 - SSIM7 PCG iterations; LM requires 2i=1SSIM\ell_{2i} = 1 - SSIM8 iterations beyond an initial ADAM warmup, whereas ADAM alone requires 2i=1SSIM\ell_{2i} = 1 - SSIM9 iterations. This yields approximately E(x)=i=1N[(λ11i)2+(λ22i)2]E(x) = \sum_{i=1}^{N} \left[ (\sqrt{\lambda_1 \ell_{1i}})^2 + (\sqrt{\lambda_2 \ell_{2i}})^2 \right]0 faster end-to-end optimization over the original ADAM-only 3DGS pipeline (Höllein et al., 2024).

6. Empirical Benchmarks and Output Quality

On NVIDIA A100 (Tanks & Temples “Train” scene):

  • 3DGS + ADAM: E(x)=i=1N[(λ11i)2+(λ22i)2]E(x) = \sum_{i=1}^{N} \left[ (\sqrt{\lambda_1 \ell_{1i}})^2 + (\sqrt{\lambda_2 \ell_{2i}})^2 \right]1736 s, SSIM 0.844, PSNR 23.68, LPIPS 0.178
  • 3DGS + LM: E(x)=i=1N[(λ11i)2+(λ22i)2]E(x) = \sum_{i=1}^{N} \left[ (\sqrt{\lambda_1 \ell_{1i}})^2 + (\sqrt{\lambda_2 \ell_{2i}})^2 \right]2663 s (E(x)=i=1N[(λ11i)2+(λ22i)2]E(x) = \sum_{i=1}^{N} \left[ (\sqrt{\lambda_1 \ell_{1i}})^2 + (\sqrt{\lambda_2 \ell_{2i}})^2 \right]3), identical SSIM, PSNR, LPIPS

Combining LM with additional system-level speedups (DISTWAR, gsplat, Taming-3DGS) maintains a E(x)=i=1N[(λ11i)2+(λ22i)2]E(x) = \sum_{i=1}^{N} \left[ (\sqrt{\lambda_1 \ell_{1i}})^2 + (\sqrt{\lambda_2 \ell_{2i}})^2 \right]430% total speed increase relative to vanilla 3DGS. Output quality remains unchanged according to standard perceptual quality metrics.

7. Key Equations and GPU Code Constructs

The core update equation is the regularized normal equation:

E(x)=i=1N[(λ11i)2+(λ22i)2]E(x) = \sum_{i=1}^{N} \left[ (\sqrt{\lambda_1 \ell_{1i}})^2 + (\sqrt{\lambda_2 \ell_{2i}})^2 \right]5

PCG matrix-vector steps are realized as:

  • applyJ: For each Gaussian E(x)=i=1N[(λ11i)2+(λ22i)2]E(x) = \sum_{i=1}^{N} \left[ (\sqrt{\lambda_1 \ell_{1i}})^2 + (\sqrt{\lambda_2 \ell_{2i}})^2 \right]6, E(x)=i=1N[(λ11i)2+(λ22i)2]E(x) = \sum_{i=1}^{N} \left[ (\sqrt{\lambda_1 \ell_{1i}})^2 + (\sqrt{\lambda_2 \ell_{2i}})^2 \right]7gaussianParamIndexE(x)=i=1N[(λ11i)2+(λ22i)2]E(x) = \sum_{i=1}^{N} \left[ (\sqrt{\lambda_1 \ell_{1i}})^2 + (\sqrt{\lambda_2 \ell_{2i}})^2 \right]8
  • applyJT: For each ray E(x)=i=1N[(λ11i)2+(λ22i)2]E(x) = \sum_{i=1}^{N} \left[ (\sqrt{\lambda_1 \ell_{1i}})^2 + (\sqrt{\lambda_2 \ell_{2i}})^2 \right]9, N=3HWPN = 3 \cdot H \cdot W \cdot P0pixelIndexN=3HWPN = 3 \cdot H \cdot W \cdot P1
  • diagJTJ: For parameter N=3HWPN = 3 \cdot H \cdot W \cdot P2, N=3HWPN = 3 \cdot H \cdot W \cdot P3

CUDA pseudocode for per-pixel cache build: N=3HWPN = 3 \cdot H \cdot W \cdot P4

Efficient implementation follows this workflow for matrix-free LM updates, leveraging full GPU parallelism by explicit kernel launches and gradient caching.


For further details on implementation specifics and the complete pipeline, see (Höllein et al., 2024).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to GPU-based Levenberg–Marquardt Solvers.