Skip to content

Add macOS Apple Silicon/MPS support with CUDA-parity export - #35

Draft
jgranie wants to merge 1 commit into
TencentARC:masterfrom
jgranie:agent/macos-mps-support
Draft

Add macOS Apple Silicon/MPS support with CUDA-parity export#35
jgranie wants to merge 1 commit into
TencentARC:masterfrom
jgranie:agent/macos-mps-support

Conversation

@jgranie

@jgranie jgranie commented Jul 26, 2026

Copy link
Copy Markdown

Summary

This PR adds a macOS Apple Silicon execution path for Pixal3D, validated on an M3 Max with 36 GB unified memory. It keeps the original CUDA path available while adding MPS-compatible attention/convolution fallbacks and a memory-bounded CUDA-parity exporter.

What changed

  • Add macOS setup, dependency, diagnostics, and smoke-test scripts.
  • Route device selection through MPS with CPU fallback where required.
  • Add MPS implementations for sparse attention, sparse convolution, NAF neighborhood attention, and grid sampling.
  • Add a chunked Metal BVH path for the 18M-face source mesh to avoid the monolithic BVH coverage failure.
  • Add bounded remeshing, cleanup, texture projection, alpha validation, checkpoint resume, and GLB quality comparison tools.
  • Document the validated workflow in README_MACOS.md.

Validation

  • Test image: output/inputs/0_img_2048.png, seed 42.
  • MPS final: 989,941 faces, 4K texture, opaque single-sided material.
  • CUDA reference: 937,343 faces, 4K texture, opaque single-sided material.
  • Dominant connected surface: 99.46% MPS vs 99.47% CUDA.
  • Blender comparison completed from front, back, side, and underside views with no visible point-cloud, transparency, or internal-hole artifact.
  • Python syntax checks and whitespace validation pass.

Performance note

The validated MPS generation takes about 35 minutes end-to-end on the M3 Max 36 GB, compared with about 13 minutes 25 seconds on an RTX A5000.

The RunPod CUDA archives are intentionally not included in this PR.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant