{"id":47875580,"url":"https://github.com/bertaveira/mojosplat","last_synced_at":"2026-04-04T01:12:49.208Z","repository":{"id":341272626,"uuid":"973805930","full_name":"bertaveira/mojosplat","owner":"bertaveira","description":"3D Gaussian Splatting kernels implemented in Mojo for PyTorch - Exploring multi-vendor GPU performance","archived":false,"fork":false,"pushed_at":"2026-03-13T08:24:45.000Z","size":542,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-13T19:49:46.611Z","etag":null,"topics":["gaussian-splatting","mojo"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bertaveira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-27T19:17:49.000Z","updated_at":"2026-03-02T18:57:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bertaveira/mojosplat","commit_stats":null,"previous_names":["bertaveira/mojosplat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bertaveira/mojosplat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertaveira%2Fmojosplat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertaveira%2Fmojosplat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertaveira%2Fmojosplat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertaveira%2Fmojosplat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertaveira","download_url":"https://codeload.github.com/bertaveira/mojosplat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertaveira%2Fmojosplat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31383831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T23:20:52.058Z","status":"ssl_error","status_checked_at":"2026-04-03T23:20:51.675Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gaussian-splatting","mojo"],"created_at":"2026-04-04T01:12:48.589Z","updated_at":"2026-04-04T01:12:49.201Z","avatar_url":"https://github.com/bertaveira.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MojoSplat\n\nMojoSplat is an experimental port of Gaussian Splatting kernels to [Mojo](https://www.modular.com/mojo), exploring the potential performance and multi-vendor support of Mojo for GPU acceleration.\n\n\n\nhttps://github.com/user-attachments/assets/ae4409a3-a656-4635-bb57-f22aca2f6141\n\n\n\nThis project implements the three core kernels of 3D Gaussian Splatting:\n- **Projection**: Transform 3D Gaussians to 2D image space\n- **Binning**: Sort and assign Gaussians to screen tiles  \n- **Rasterization**: Render Gaussians to pixels with alpha blending\n\nYou can call the render function or any of the individual kernels directly from python (using pytorch). The mojo kernels will be compiled on the fly.\n\n## Implementation Status\n\n| Kernel | PyTorch | GSplat | Mojo |\n|--------|---------|--------|------|\n| **Projection** | ✅ | ✅ | ✅ |\n| **Binning** | ✅ | ✅ | ✅ |\n| **Rasterization** | ❌* | ✅ | ✅ |\n\n*PyTorch rasterization falls back to GSplat implementation\n\n\u003e [!WARNING]\n\u003e 1. This is NOT production ready.\n\u003e 2. Performance is inferior to the GSplat CUDA version. But this gap is closing as the Mojo language and library mature. Performance improvements are welcome!\n\u003e 3. Mojo is evolving very fast. Faster than I work on this (this is very much a side project). So thsi projects will likely not be up to date with latest Mojo all the time as each update requires a non insignificant amount of work.\n\n## Installation\n\n### Standalone Development (with uv)\n\nFor development or standalone usage, this project uses [uv](https://docs.astral.sh/uv/) for dependency management:\n\n```bash\n# Clone the repository\ngit clone https://github.com/bertaveira/mojosplat.git\ncd mojosplat\n\n# Install dependencies and activate environment\nuv sync\n```\n\n### As a Dependency in Your Project\n\n#### Using pip with GitHub\n\n```bash\npip install git+https://github.com/bertaveira/mojosplat.git\n```\n\n#### Using uv in your project\n\nAdd to your `pyproject.toml`:\n\n```toml\ndependencies = [\n    \"mojosplat @ git+https://github.com/bertaveira/mojosplat.git\",\n    # ... your other dependencies\n]\n```\n\n#### Using pip requirements.txt\n\nAdd to your `requirements.txt`:\n\n```\ngit+https://github.com/bertaveira/mojosplat.git\n```\n\n#### Using conda/mamba environment.yml\n\n```yaml\ndependencies:\n  - pip\n  - pip:\n    - git+https://github.com/bertaveira/mojosplat.git\n```\n\n## Usage\n\n### Basic Rendering\n\nAll inputs must be CUDA tensors (`float32`). `scales` are in log-space; `quats` are `(w, x, y, z)`; `opacities` shape is `(N,)`.\n\n```python\nimport torch\nfrom mojosplat.render import render_gaussians\nfrom mojosplat.utils import Camera\n\n# 3D Gaussian data (e.g. from your scene or .splat file)\nN = 1000\ndevice = \"cuda\"\nmeans3d = torch.randn(N, 3, device=device, dtype=torch.float32)\nscales = torch.randn(N, 3, device=device, dtype=torch.float32)   # log-space\nquats = torch.randn(N, 4, device=device, dtype=torch.float32)     # (w, x, y, z)\nquats = quats / quats.norm(dim=1, keepdim=True)\nopacities = torch.randn(N, device=device, dtype=torch.float32)   # (N,) not (N, 1)\nfeatures = torch.randn(N, 3, device=device, dtype=torch.float32) # RGB\n\n# Camera: R (3,3) world-to-camera, T (3,) world-to-camera, H, W, fx, fy, cx, cy\nR = torch.eye(3, device=device, dtype=torch.float32)\nT = torch.tensor([0.0, 0.0, 5.0], device=device, dtype=torch.float32)\ncamera = Camera(R=R, T=T, H=720, W=1280, fx=1152.0, fy=1152.0, cx=640.0, cy=360.0)\n\n# Render (backend: \"mojo\", \"gsplat\", or \"torch\")\nimage = render_gaussians(means3d, scales, quats, opacities, features, camera, backend=\"mojo\")\n# image shape: (H, W, C)\n```\n\n### Running Tests\n\n```bash\n# Run all tests\nuv run pytest\n\n# Run specific kernel tests\nuv run pytest tests/test_projection_mojo.py\nuv run pytest tests/test_binning.py  \nuv run pytest tests/test_rasterization.py\nuv run pytest tests/test_render.py\n\n# Run with verbose output\nuv run pytest -v\n```\n\n### Benchmarking\n\n```bash\n# Benchmark with a real .splat scene (e.g. bicycle)\n# First download a .splat file (antimatter15 binary format):\ncurl -L -o examples/bicycle.splat https://huggingface.co/cakewalk/splat-data/resolve/main/bicycle.splat\n\n# Then run the benchmark (defaults to examples/bicycle.splat if present)\nuv run python examples/benchmark_render.py examples/bicycle.splat\n```\n\n### Interactive viewer\n\nYou can view a `.splat` scene in the browser with the interactive viewer (drag to orbit, scroll to zoom). Use the same `bicycle.splat` file as above:\n\n```bash\n# Ensure you have the scene file (see Benchmarking above for download URL)\nuv run python examples/viewer.py examples/bicycle.splat\n```\n\nThen open the URL printed in the terminal in your browser. The first render triggers JIT compilation (~30–60 s); subsequent renders are fast.\n\n### Performance (RTX 5090, bicycle.splat, 6.1M Gaussians, 1280×720)\n\nBenchmark: `uv run python examples/benchmark_render.py examples/bicycle.splat` (1000 runs full pipeline, 200 runs per kernel).\n\n\n| Backend    | Full pipeline       | Projection | Binning | Rasterization |\n| ---------- | ------------------- | ---------- | ------- | ------------- |\n| **gsplat** | 2.41 ms (414.9 FPS) | 0.43 ms    | 0.46 ms | 1.56 ms       |\n| **mojo**   | 3.21 ms (311.2 FPS) | 0.91 ms    | 0.87 ms | 1.55 ms       |\n\n\nThere is still a gap between the performance of the Mojo and GSplat kernels. Some extra work is needed to get closer to the GSplat performance. In some cases the Mojo library does not expose certain instructions that are used in the GSplat kernels, so one can expect to see a performance boost as the language and library mature.\n\n## Contributing\n\nContributions are very welcome! This is an experimental project exploring the intersection of Mojo and high-performance graphics.\n\nAreas where help is needed:\n\n- **PyTorch Rasterization**: Native PyTorch rasterization kernel\n- **Performance Optimization**: Analyse current implementation and improve existing Mojo kernels. For example, try to udnersdtand how the generated PTX compares with GSplat and how we can get closer or surpass its performance. Also measure the overhead of the python to mojo connection.\n- **Backwards pass**: implement the mojo kernels for the backwards pass. This will allow the MojoSplat to be used in training the gaussian representation.\n- **Testing**: More comprehensive test coverage\n- **Unscented Projection**: Implmeent the Unscented projection from 3DGUT as an alternative to EWA\n\nTo contribute:\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes with tests\n4. Submit a pull request\n\n## License\n\n[MIT License](LICENSE)\n\n## Acknowledgments\n\n- [GSplat](https://github.com/nerfstudio-project/gsplat) for the reference implementation\n- [3D Gaussian Splatting](https://github.com/graphdeco-inria/gaussian-splatting) for the original method\n- [Modular](https://www.modular.com/) for the Mojo language\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertaveira%2Fmojosplat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertaveira%2Fmojosplat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertaveira%2Fmojosplat/lists"}