I'd have a look at MLX, cc @awnihannun , from some recent chatter I understand it is a lot more optimized that PyTorch mps atm. This would need a re-write of the build-nanogpt code into mlx, but possibly it's not that involved. I'd be happy to accept a PR for mlx clone.
MLX Framework as Optimized Alternative to PyTorch MPS
By
–