I vibe coded a Metal backend for JAX (github.com)

🤖 AI Summary
The new project "metaljax" has been introduced, allowing unmodified JAX code to run on Apple Silicon GPUs via a Metal backend. Users can easily integrate it by setting the JAX platform to Metal, enabling all core JAX functionalities—including JIT compilation and gradient calculations—on compatible Mac devices. The backend is currently in beta but has shown promising performance, achieving training speeds for transformer and recurrent language models that come within a few percent of comparable implementations using PyTorch's MPS backend. This development is significant for the AI and ML community as it offers a way to leverage Apple's hardware for optimized deep learning tasks, enhancing accessibility for developers using JAX on macOS. Key technical features include the use of compiled StableHLO programs interpreted onto MLX arrays that execute on GPUs. While the implementation passes a robust testing suite with 98.4% accuracy, there are still unresolved gaps in support for a few operations. Overall, metaljax provides a vital link for harnessing the capabilities of Apple’s architecture in the growing JAX ecosystem, with a potential shift towards an upstream Metal backend in the future.
Loading comments...
loading comments...