{"slug": "mojosplat-3d-gaussian-splatting-training-and-rendering-written-in-mojo", "title": "MojoSplat: 3D Gaussian Splatting, training and rendering, written in Mojo", "summary": "MojoSplat, a 3D Gaussian Splatting training and rendering implementation written entirely in Mojo by developer bertaveira, trains the Mip-NeRF360 garden scene in 3m19s on an RTX 5090, slightly faster than the CUDA-based Faster-GS at 3m48s while matching its quality (PSNR 27.45 vs 27.44, SSIM 0.866, LPIPS 0.122). The codebase replaces Python-orchestrated CUDA kernels with a single language spanning the COLMAP loader to GPU kernels, runs on NVIDIA, AMD and Apple GPUs, and reports rendering and training steps about 2× faster than gsplat, with images and gradients matching a float64 reference to about 1e-6. PyTorch bindings with autograd provide a drop-in rasterizer, and the project installs via pixi with no CUDA toolkit, compiler or Python required.", "body_md": "**3D Gaussian Splatting, training and rendering, written entirely in [Mojo](https://www.modular.com/mojo).** No Python, no CUDA C++: one language from the COLMAP loader to the GPU kernels.\n\n## training.mp4\n\nGaussian Splatting codebases are usually Python orchestrating hand-written CUDA kernels, tied to NVIDIA GPUs. Mojo promises CUDA-level performance in a single, Python-like language that also targets AMD and Apple GPUs. MojoSplat is a full, fast 3DGS implementation built to test that promise.\n\n- **Train a scene with one command.** COLMAP dataset in,`.ply` out (the standard 3DGS format).\n- **Fast.** Matches the quality of[Faster-GS](https://github.com/nerficg-project/faster-gaussian-splatting) , a state-of-the-art CUDA implementation, and trains slightly faster: Mip-NeRF360 garden in under 3½ minutes on an RTX 5090. Rendering and a training step are about 2× faster than gsplat.\n- **Faithful.** Images and gradients match a float64 reference implementation to about 1e-6.\n- **Usable from PyTorch.** Bindings with autograd provide a fast drop-in rasterizer for existing training code.\n\n**Documentation:** [bertaveira.github.io/mojosplat](https://bertaveira.github.io/mojosplat/) has a quickstart, an illustrated walkthrough of the renderer, and how to add a method.\n\nAll you need is [pixi](https://pixi.sh) and an NVIDIA GPU, AMD GPU, or an Apple silicon Mac. No CUDA toolkit, compiler or Python needed: pixi installs Mojo into the project folder on the first run. Just clone this repository `git clone https://github.com/bertaveira/mojosplat.git` and you're ready to go.\n\n```\npixi run train path/to/scene --viewer        # watch it train at http://localhost:8080\n```\n\nYou can evaluate, view, and render the trained scene with the following commands:\n\n```\npixi run eval path/to/scene output/scene/point_cloud.ply\npixi run view output/scene/point_cloud.ply\npixi run render output/scene/point_cloud.ply -o render.png   # also renders .splat files\n```\n\nA scene is a COLMAP folder with `sparse/0/` and `images_4/`, e.g. from [Mip-NeRF360](https://jonbarron.info/mipnerf360/). Every hyperparameter is a flag: `pixi run train --help`.\n\nOn a Mac, Mojo compiles kernels with Xcode's Metal toolchain: check it with `xcrun metal --version` and, if it is missing, install it with `xcodebuild -downloadComponent MetalToolchain`.\n\nMip-NeRF360 garden (`images_4`, 30k iterations). The last four columns are training time per GPU. PSNR, SSIM and LPIPS are from the RTX 5090 runs; PSNR on the RTX 3080 and Apple M1 Pro lands within 0.1 dB. Faster-GS was run from its official code on the same RTX 5090 and scored with the same metric code.\n\n|  | PSNR | SSIM | LPIPS | Gaussians | RTX 5090 | RTX 3080 (10 GB) | Apple M4 Max | Apple M1 Pro | \n|---|---|---|---|---|---|---|---|---|\n| **MojoSplat** | **27.45** | 0.866 | 0.122 | 4.2M | **3m19s** | **~10m30s** | 16m06s | 1h03m | \n| [Faster-GS](https://github.com/nerficg-project/faster-gaussian-splatting) (CUDA + PyTorch) | 27.44 | 0.866 | 0.121 | 4.1M | 3m48s | — | — | — | \n| 3DGS (published) | 27.41 | 0.868 | —* | ~5.8M | — | — | — | — | \n\n* The 3DGS paper's LPIPS (0.103) is not comparable: its evaluation code passes images in [0, 1] to an LPIPS network that expects [-1, 1], which lowers the score. The other rows use LPIPS-VGG on correctly scaled images.\n\nEach method, selected with `--method`, is also trained with its official code on seven Mip-NeRF 360 scenes, on the same RTX 5090, and scored the same way. The table gives MojoSplat's mean training time per scene and rendering speed, with the speedup over the official code in brackets (below 1× is slower). Per-scene quality, timings and open differences are in the [full results](https://bertaveira.github.io/mojosplat/results).\n\n| Method | `--method` | Training time per scene | Rendering | \n|---|---|---|---|\n| [Faster-GS](https://github.com/nerficg-project/faster-gaussian-splatting) | `faster-gs` (default) | 2m24s (1.13×) | 1119 FPS (0.88×) | \n| [Beta Splatting](https://github.com/RongLiu-Leo/beta-splatting) | `beta-splatting` | 3m31s (3.90×) | 489 FPS (4.58×) | \n| [3DGS-MCMC](https://github.com/ubc-vision/3dgs-mcmc) | `3dgs-mcmc` | 3m19s (7.13×) | 682 FPS (2.86×) | \n| [Spherical Voronoi](https://github.com/sphericalvoronoi/sphericalvoronoi) | `spherical-voronoi` | 3m51s (2.83×) | 444 FPS (2.47×) | \n| [3DGUT](https://github.com/nv-tlabs/3dgrut) | `3dgut` | 2m29s (3.93×) | 1043 FPS (6.74×) | \n\n`mojosplat` is a plain Mojo package (`pixi run mojo run -I . my_program.mojo`):\n\n``` python\nfrom max.gpu.host import DeviceContext\nfrom mojosplat import Camera, Rasterizer, Splats, download, read_ply, write_png\n\ndef main() raises:\n    var ctx = DeviceContext()\n    var splats = Splats.from_host(ctx, read_ply(\"output/garden/point_cloud.ply\"))\n    var camera = Camera.translated(0.0, 0.0, 5.0, 1280, 720, 1152.0, 1152.0)\n    var image = ctx.enqueue_create_buffer[DType.float32](1280 * 720 * 3)\n    var rasterizer = Rasterizer(ctx)\n    rasterizer.render(splats, camera, SIMD[DType.float32, 4](0.0), image)\n    write_png(\"out.png\", download(ctx, image, 1280 * 720 * 3), 1280, 720)\n```\n\nTraining is `Trainer(ctx, load_colmap_dataset(ctx, path), TrainConfig())` and `trainer.step()`; `Rasterizer.forward` / `backward` give gradients for any image loss. The design is described in [`docs/design.md`](https://github.com/bertaveira/mojosplat/blob/main/docs/design.md).\n\nLinux only, in a separate pixi environment:\n\n```\npixi install -e torch && pixi run -e torch build-ext\npython\nfrom mojosplat_torch import Camera, render_splats\n\n# Raw 3DGS / gsplat parameters: means [N,3], quats [N,4] (wxyz), scales [N,3] (log),\n# opacities [N] (logits), sh0 [N,3], shN [N,K,3]; float32 CUDA tensors\nimage = render_splats(means, quats, scales, opacities, sh0, shN, camera)   # (H, W, 3)\nimage.mean().backward()\n```\n\n- Validate on AMD GPUs and tune on AMD and Apple GPUs (every kernel already compiles for both; Apple runs).\n- Benchmarks on all Mip-NeRF360, Tanks&Temples and Deep Blending scenes.\n- Anti-aliasing, faster optimizer options, LPIPS in Mojo.\n\nContributions are welcome; please include tests (`pixi run test`).\n\n[MIT](https://github.com/bertaveira/mojosplat/blob/main/LICENSE). Ported code from Faster-GS (Apache-2.0), Deformable Beta Splatting (Apache-2.0), 3DGUT (NVIDIA 3dgrut, Apache-2.0), Spherical Voronoi (MIT), NeRFICG (MIT) and fused-ssim (MIT) is listed in [THIRD_PARTY_NOTICES.md](https://github.com/bertaveira/mojosplat/blob/main/THIRD_PARTY_NOTICES.md). MAX is installed by pixi under Modular's [MAX License](https://github.com/modular/modular/blob/main/Licenses/MAX_LICENSE).\n\nMojoSplat's rasterizer and training recipe are a Mojo port of **[Faster-GS](https://fhahlbohm.github.io/faster-gaussian-splatting)** ([code](https://github.com/nerficg-project/faster-gaussian-splatting)) by Florian Hahlbohm, Linus Franke, Martin Eisemann and Marcus Magnor. If you use MojoSplat, please cite their work:\n\n```\n@inproceedings{hahlbohm2026fastergs,\n  title     = {Faster-GS: Analyzing and Improving Gaussian Splatting Optimization},\n  author    = {Hahlbohm, Florian and Franke, Linus and Eisemann, Martin and Magnor, Marcus},\n  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n  year      = {2026}\n}\n```\n\nAlso thanks to [3D Gaussian Splatting](https://github.com/graphdeco-inria/gaussian-splatting), [Taming 3DGS](https://github.com/humansensinglab/taming-3dgs), [StopThePop](https://github.com/r4dl/StopThePop-Rasterization), [Splatshop](https://github.com/m-schuetz/Splatshop), [fused-ssim](https://github.com/rahul-goel/fused-ssim), [gsplat](https://github.com/nerfstudio-project/gsplat) (our reference implementation) and [Modular](https://www.modular.com/).", "url": "https://wpnews.pro/news/mojosplat-3d-gaussian-splatting-training-and-rendering-written-in-mojo", "canonical_source": "https://github.com/bertaveira/mojosplat", "published_at": "2026-12-04 13:59:52+00:00", "updated_at": "2026-12-04 14:17:52.765628+00:00", "lang": "en", "topics": ["computer-vision", "ai-research", "developer-tools", "ai-tools"], "entities": ["MojoSplat", "Mojo", "Modular", "Faster-GS", "gsplat", "PyTorch", "COLMAP", "Mip-NeRF360"], "also_reported_by": [], "takeaway": "MojoSplat trains Mip-NeRF360 garden in 3m19s on an RTX 5090 versus 3m48s for Faster-GS at equal quality (PSNR 27.45 vs 27.44), and its PyTorch autograd bindings let existing 3DGS training code swap in the rasterizer.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/mojosplat-3d-gaussian-splatting-training-and-rendering-written-in-mojo", "markdown": "https://wpnews.pro/news/mojosplat-3d-gaussian-splatting-training-and-rendering-written-in-mojo.md", "text": "https://wpnews.pro/news/mojosplat-3d-gaussian-splatting-training-and-rendering-written-in-mojo.txt", "jsonld": "https://wpnews.pro/news/mojosplat-3d-gaussian-splatting-training-and-rendering-written-in-mojo.jsonld"}}