Skip to content

trellis2: macOS/Apple Silicon path — trellis-mac (MPS) sidecar now, Metal/MoltenVK contribution to trellis.cpp later #967

Description

@fernandotonon

Follow-up to the TRELLIS.2 backend (ai/trellis2/) and to #966 (trellis.cpp runtime flavor).

Why

Neither the Python/CUDA sidecar nor trellis.cpp (CUDA/Vulkan/ROCm, no Metal) runs TRELLIS.2 on macOS today, but Macs are a first-class QtMeshEditor platform.

Near term — trellis-mac MPS sidecar env

shivampkumar/trellis-mac (MIT) runs the full TRELLIS.2 pipeline on PyTorch MPS with Metal ports of the sparse kernels — reportedly ~5 min end-to-end on an M4 Pro 24 GB with full base-color/metallic/roughness output.

  • Extend ai/trellis2/install.py with a macOS flavor that provisions the trellis-mac fork (pin a revision; apply the same o_voxel.__init__ lazy-postprocess patch if applicable) — the existing generate.py/QTM3D contract should carry over nearly unchanged (inference only; QtMeshEditor keeps the native bake).
  • Same license traps, same fixes: DINOv3 is gated (user's own HF login), RMBG-2.0 (CC-BY-NC) stays bypassed via our U²-Net keepAlpha matte. Re-audit trellis-mac's diffs in docs/trellis2-dependencies.md.
  • Verify output parity/orientation vs the CUDA reference on a few fixtures.

Longer term — Metal on trellis.cpp

Options being evaluated (feasibility research in progress; results to be attached here):

  1. Run trellis.cpp's Vulkan backend via MoltenVK — cheapest if their shaders avoid MoltenVK-unsupported features (e.g. cooperative matrix).
  2. Enable GGML's Metal backend for the dense ops and let custom sparse ops fall back to CPU via ggml_backend_sched — hybrid, incremental.
  3. Full Metal kernels for the sparse ops, potentially adapting trellis-mac's MIT Metal sparse-conv work — most effort, best result; would be contributed upstream to pwilkin/trellis.cpp.
  • Attach the feasibility findings + pick the path
  • Upstream contribution PR(s) as needed

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions