boltz icon indicating copy to clipboard operation
boltz copied to clipboard

Running on Apple Silicon GPU with Metal Performance Shader

Open fnachon opened this issue 7 months ago • 4 comments

Hi,

I made some minor code updates to make it run on the GPU of Macs. It works sufficiently well on my MacBookPro with M1 Max (64 Go).

fnachon avatar Apr 14 '25 16:04 fnachon

I can also verify that is working well for me as well on my MacBook Pro M3. Think it would be great to get this merged into the main Boltz project. Thanks @fnachon for this work!

viralogic avatar May 05 '25 15:05 viralogic

This is really cool! What's the average runtime?

RicardoRH96 avatar May 23 '25 18:05 RicardoRH96

Here are some timings of Boltz with Mac ARM GPUs compared to Windows and Linux Nvidia GPU.

https://www.rbvi.ucsf.edu/chimerax/data/boltz-apr2025/boltz_help.html#runtimes

Macs with more GPU cores like the M2 Ultra shown on that web page speed things up. Mac's with 16 GB of memory can only predict small structures (~350 residues). While the fixes in this issue are probably helpful, the Boltz 0.4.1 release runs fine on Mac if you set environment variable PYTORCH_ENABLE_MPS_FALLBACK=1 and use boltz predict option --accelerator gpu. That is what was done for the timings shown in the above web page.

tomgoddard avatar May 23 '25 19:05 tomgoddard

HI, I updated my fork to boltz-2. Running ok, except for a few minor issues.

fnachon avatar Jun 14 '25 20:06 fnachon