Skip to content

feat: add Apple Silicon MPS support for PyTorch training#17

Open
Mearman wants to merge 1 commit intoPicsart-AI-Research:mainfrom
Mearman:feat/mps-support
Open

feat: add Apple Silicon MPS support for PyTorch training#17
Mearman wants to merge 1 commit intoPicsart-AI-Research:mainfrom
Mearman:feat/mps-support

Conversation

@Mearman
Copy link
Copy Markdown

@Mearman Mearman commented Dec 21, 2025

  • Add MPS device detection functions to DiffVG/pydiffvg/device.py
  • Separate render device (CPU for diffvg C++) from training device (MPS for PyTorch)
  • Move tensor operations to MPS while keeping rasterization on CPU
  • Enables GPU-accelerated loss computation on Apple Silicon Macs

The diffvg C++ rasterizer only supports CUDA or CPU, but PyTorch tensor operations (loss computation, gradient updates) can run on MPS for improved performance on Apple Silicon.

- Add MPS device detection functions to DiffVG/pydiffvg/device.py
- Separate render device (CPU for diffvg C++) from training device (MPS for PyTorch)
- Move tensor operations to MPS while keeping rasterization on CPU
- Enables GPU-accelerated loss computation on Apple Silicon Macs

The diffvg C++ rasterizer only supports CUDA or CPU, but PyTorch tensor
operations (loss computation, gradient updates) can run on MPS for
improved performance on Apple Silicon.
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