← 返回日报
精读 预计 2 分钟

MAX models can now run on Apple silicon GPUs

摘要

MAX 在 26.4 版本及之后的 nightly 中首次支持在 Apple silicon GPU(M1 至 M5)上运行多种模型,包括适当规模的文本 LLM、视觉模型和图像扩散模型。M5 因配备专用矩阵乘法神经加速器,表现最佳;较旧的 M 系列可能因测试不足而存在兼容问题。文中给出了在 Mac 上运行简单 LLM 和 FLUX.2(4B 参数)图像生成模型的命令示例,并提醒 Apple 芯片使用共享内存,需通过参数限制显存占用,运行 FLUX.2 建议至少有 15 GB 可用内存。团队正在持续优化模型覆盖与性能,nightly 中可能出现暂时性性能回退。

荐读理由

你现在可以直接复制命令在 Mac 上用 MAX 运行文本 LLM 和 FLUX 图像模型,这是 MAX 对 Apple Silicon GPU 的实际支持添加,M5 有专用矩阵加速。

原文

MAX models can now run on Apple silicon GPUs

For the last several months, we’ve been progressively improving support for Mojo and MAX on Apple silicon GPUs, first unlocking the ability to program them via Mojo, then enabling basic MAX graphs to run on these GPUs. With the 26.4 release, many MAX models can now run on Apple silicon GPUs for the first time. Support for models has even gotten better in the nightlies since.

In the current nightlies, M1 through M5 Apple silicon GPUs are supported in MAX, and appropriately-sized text LLMs, vision models, and image diffusion models run across these devices. Due to the generational differences in Apple silicon GPUs, some models may not work as well on older M-series SoCs due to lack of testing (most of us are working on M3-M5 systems). If you encounter a combination of model / system that aren’t working right, please feel free to file an issue for us to track compatibility.

MAX models will run best on M5 systems, because they contain dedicated matrix-multiplication operations via the new Neural Accelerators. Preston and Fabio have been working on kernels specifically targeting those operations and while we haven’t yet benchmarked directly against MLX or other frameworks, we’ve seen some pretty fast model execution in anecdotal tests.

To try out a simple LLM on your Mac, you can set up MAX (or clone the modular repo) and run an invocation like the following to do direct text generation:

max generate --model-path=Qwen/Qwen3.5-0.8B --device-memory-utilization 0.5 --max-batch-size 1 --prompt "The sky is blue because"

or the following to start serving an endpoint on your machine:

max serve --model-path=Qwen/Qwen3.5-0.8B --device-memory-utilization 0.5 --max-batch-size 1

The --device-memory-utilization and --max-batch-size flags are there to limit the amount of memory MAX will try to allocate, because Apple silicon systems use shared memory between CPU and GPU.

If you have at least 15 GB of RAM available on your system after everything else that’s running, you can even use the FLUX.2 [klein] 4-billion-parameter image generation model directly on your Mac. To quickly generate an image, you can use our simple_offline_generation example from the modular repo:

./bazelw run //max/examples/diffusion:simple_offline_generation -- --model black-forest-labs/FLUX.2-klein-4B --num-inference-steps 4 --width 256 --height 256 --prompt "A beautiful sunset"

or serve an Open Responses endpoint with:

MAX_SERVE_API_TYPES='["responses"]' max serve --model-path black-forest-labs/FLUX.2-klein-4B

We’re working to improve model coverage and performance, and it’s possible you’ll notice temporary regressions in the nightlies as we tune kernels and work on models. There are many areas still to be optimized for specific models of Apple silicon GPUs, especially for pre-M5 systems. As always, follow the nightlies for the latest improvements here.

Lobsters · 1 赞 · 0 评 讨论 → 阅读原文 →

这条对你有帮助吗?