petruspennanen
- 1
- 0
- TL;DR
- I ported my old lattice QCD flux-tube code to Apple Metal. Running SU(2) on M-series Macs, verified against CPU. Anyone else tried Metal for scientific computing?
I've been working on reviving my old lattice QCD flux-tube code and porting it to run natively on Apple Silicon using Metal compute shaders. The project uses Grid (Peter Boyle's framework) with a custom Metal backend I wrote — no CUDA, no third-party wrappers, just native MSL kernels talking to Grid's memory managers through Objective-C++.
The immediate physics goal is high-statistics SU(2) measurements of chromofield flux distributions between static quarks — Wilson loops, Cornell potential fits, and transverse flux-tube profiles. This builds on work I did for my PhD (Pennanen et al., 1998) on multi-quark systems, but now with much better statistics and larger lattices than were feasible back then.
What makes this unusual is the hardware: everything runs on M-series Macs (MacBook Pro, Mac Studio). Metal's shared memory model gives you zero-copy between CPU and GPU, which turns out to work quite well for lattice gauge theory where you're constantly shuffling gauge links and propagators.
Current status: SU(2) production runs are working with the Metal backend verified against CPU results (SHA-256 config hashing + runtime metadata to confirm GPU dispatch). Next step is moving to SU(3) and eventually 6-quark systems to study flux-tube reorganisation during fusion.
Has anyone else tried running lattice simulations on Apple hardware? I'd be curious to hear about experiences with Metal for scientific computing in general. The whole CUDA ecosystem dominance makes it feel like uncharted territory.
Code is open source: [github link redacted by the Mentors]
The immediate physics goal is high-statistics SU(2) measurements of chromofield flux distributions between static quarks — Wilson loops, Cornell potential fits, and transverse flux-tube profiles. This builds on work I did for my PhD (Pennanen et al., 1998) on multi-quark systems, but now with much better statistics and larger lattices than were feasible back then.
What makes this unusual is the hardware: everything runs on M-series Macs (MacBook Pro, Mac Studio). Metal's shared memory model gives you zero-copy between CPU and GPU, which turns out to work quite well for lattice gauge theory where you're constantly shuffling gauge links and propagators.
Current status: SU(2) production runs are working with the Metal backend verified against CPU results (SHA-256 config hashing + runtime metadata to confirm GPU dispatch). Next step is moving to SU(3) and eventually 6-quark systems to study flux-tube reorganisation during fusion.
Has anyone else tried running lattice simulations on Apple hardware? I'd be curious to hear about experiences with Metal for scientific computing in general. The whole CUDA ecosystem dominance makes it feel like uncharted territory.
Code is open source: [github link redacted by the Mentors]
Last edited by a moderator: