Skip to main content
Back

Simon Fraser's Graphite Runs Robot Mapping 59x Faster on Embedded Hardware

A new CUDA C++ optimization library targets SLAM systems with mixed-precision solving, in-place updates, and up to 59x speedups over CPU baselines.

Pro

  • Graphite is a new open-source CUDA C++ nonlinear least squares graph optimization framework for SLAM.
  • Runs the entire Levenberg-Marquardt pipeline on GPU, avoiding CPU-GPU data transfers between steps.
  • Delivers up to 59x speedup on visual-inertial bundle adjustment inside ORB-SLAM3 versus a CPU baseline.
  • Supports FP64, FP32, and bfloat16 mixed precision, cutting memory by up to 78% versus MegBA.
  • Matrix-free PCG solver bypasses sparse matrix storage; autodiff uses no extra memory versus analytic.
  • Runs full-inertial bundle adjustment on a Jetson Orin Nano with under 100 MiB overhead.

SLAM systems have a memory problem. As maps grow, the nonlinear optimization step that keeps a robot's pose estimates consistent starts eating into RAM and stalls the real-time loop. A team from Simon Fraser University and the University at Buffalo has released Graphite, a GPU-accelerated graph optimization framework that runs the entire Levenberg-Marquardt pipeline on CUDA and cuts memory use aggressively enough to fit large problems on an embedded Jetson.

The paper reports up to a 59x speedup compared to a CPU baseline on global visual-inertial bundle adjustment, while staying under 1 GiB of GPU memory on desktop hardware. That combination of speed and low footprint is the interesting part.

Why existing GPU solvers do not fit SLAM

Bundle adjustment and pose graph optimization have been GPU targets for years, but the existing options tend to break down when dropped into a real SLAM stack. Ceres Solver only offloads the linear solver step to the GPU, which introduces overhead from allocating GPU memory and transferring data between steps. Specialized bundle adjusters like MegBA are fast but rigid, targeting a fixed problem shape with camera poses, 3D points, and binary constraints only.

Real systems like ORB-SLAM3 add inertial information with constraints that can involve as many as six variables, plus motion-only bundle adjustment and pose graph optimization tasks. Python-based and DSL-based solvers force you to re-express your C++ types in another language. And GPU memory is often shared with image processing and neural network inference, so a solver that inflates memory to hold sparse matrices is a non-starter on embedded hardware.

How Graphite works

Graphite is built around a descriptor batching model. Instead of storing heterogeneous vertices and constraints in one graph, users group items of the same type into descriptors. This enables GPU threads to process batches of identical items, which minimizes branching that would otherwise wreck SIMT performance.

A descriptor declares static properties at compile time: the underlying data type, parameter block size, the residual function, the differentiation mode, and the update rule. Here is what a vertex descriptor looks like conceptually:

using FP = float;              // vertex, constraint precision
using SP = __nv_bfloat16;      // linear system precision
Graph<FP, SP> graph;
auto point_desc = PointDescriptor<FP, SP>();
point_desc.reserve(num_vertices);
graph.add_descriptor(&point_desc);
for (size_t id = 0; id < num_vertices; ++id) {
  point_desc.add_vertex(id, &points[id]);   // in-place, no copy
}

The framework relies on several techniques to keep memory low:

  • In-place optimization: variables are optimized directly in GPU-accessible memory without transforming them into a solver-specific format.
  • Mixed-precision solving: vertices and the linear system can use different floating-point types. A common choice is FP32 for variables and bfloat16 for the linear system.
  • Matrix-free PCG: the PCG solver does not require storing the Hessian matrix, so Graphite avoids explicitly constructing sparse matrices for the optimization problem and instead uses the graph structure directly during matrix-vector products.
  • Dynamically computed Jacobians: Jacobians can be evaluated at the point of computation to enable matrix-free methods that trade runtime for lower memory.
  • Memory-efficient autodiff: instead of allocating Jet or JetVector structures for forward-mode dual numbers, each CUDA thread computes a single column of the Jacobian using dual-number vectors that live only in registers.

To keep low-precision PCG from diverging, the authors add safeguards including clamping values along the Hessian diagonal, rescaling the columns of each Jacobian block according to the Hessian diagonal, and normalizing the PCG residual in each iteration. The block Jacobi preconditioner is kept at a higher precision than the linear system when bfloat16 is used, because storing it at 16 bits caused convergence issues.

Benchmarks that matter

On Bundle Adjustment in the Large problems, Graphite matches or beats MegBA on runtime while using dramatically less memory. On the Final-4585 problem, Graphite in FP32-BF16 mode used 1386 MiB against MegBA FP32's 7960 MiB, with lower runtime. On the largest Final-13682 problem, MegBA ran out of memory entirely while Graphite completed at 3828 MiB.

The visual-inertial case study is the real headline. Running full-inertial bundle adjustment inside ORB-SLAM3 on TUM-VI outdoor sequences:

  • The g2o LDLT baseline took 1424 seconds on the outdoors1 sequence.
  • The g2o PCG baseline took 224 seconds.
  • Graphite FP32-BF16 finished the same problem in 1.18 seconds on the desktop.
  • On the Jetson Orin Nano, Graphite FP32-BF16 completed outdoors1 in 27.9 seconds versus 512 seconds for g2o PCG, using roughly 66 MiB above baseline.

Convergence is not free. The LDLT solver converges to the lowest chi-squared error because it computes the exact step each iteration, and bfloat16 mode consistently ends at higher final error than FP64. For most SLAM use cases the difference is well within acceptable bounds, but if you need the tightest possible fit, higher precision or an exact solver is still the right call.

Where it fits and where it does not

Graphite is aimed at builders of SLAM, VIO, and other robotics estimation systems who already write CUDA C++ and want the entire optimization graph on the GPU. Because problems are described with user-defined C++ types, you can plug in complex vertex classes such as a combined IMU-camera pose without translating them into a solver-specific vector layout.

It is less appropriate when:

  • You need Python-first workflows or differentiable optimization for training neural models. Theseus and PyPose remain better fits there.
  • Your problem is small enough to run at CPU-negligible cost, where GPU launch overhead dominates.
  • You require the exact-step accuracy of a direct sparse Cholesky factorization.

The code is available on GitHub under the sfu-rsl organization. For teams shipping SLAM on Jetson-class hardware, or anyone whose bundle adjustment step has quietly become the bottleneck in a larger perception pipeline, it is worth a look.