[PR #15345] [MERGED] mlx: Improve M5 performance with NAX #20392

Closed
opened 2026-04-16 07:35:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15345
Author: @dhiltgen
Created: 4/5/2026
Status: Merged
Merged: 4/7/2026
Merged by: @dhiltgen

Base: mainHead: mlx_nax


📝 Commits (2)

  • 4b4a470 mlx: Improve M5 performance with NAX
  • ebcf380 mac: prevent generate on cross-compiles

📊 Changes

7 files changed (+325 additions, -114 deletions)

View changed files

📝 .github/workflows/release.yaml (+1 -1)
📝 discover/runner.go (+1 -1)
📝 scripts/build_darwin.sh (+115 -20)
📝 x/imagegen/mlx/CMakeLists.txt (+24 -14)
📝 x/mlxrunner/mlx/dynamic.go (+162 -78)
x/mlxrunner/mlx/dynamic_darwin.go (+17 -0)
x/mlxrunner/mlx/dynamic_other.go (+5 -0)

📄 Description

This modifies the Mac release to now have 2 builds of MLX for broader compatibility while supporting the latest M5 hardware features. NAX requires building with xcode 26.2 and targetting support only for OS v26 and up. Since we want to support older MacOS versions as well, we now need 2 different MLX builds and runtime detection logic to select the optimal version. The newer build will detect NAX missing at runtime, so it is safe to run on pre M5 macs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15345 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 4/5/2026 **Status:** ✅ Merged **Merged:** 4/7/2026 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `mlx_nax` --- ### 📝 Commits (2) - [`4b4a470`](https://github.com/ollama/ollama/commit/4b4a47019b12cd6d844fa99bfb1ae97224bf99c6) mlx: Improve M5 performance with NAX - [`ebcf380`](https://github.com/ollama/ollama/commit/ebcf3804e1f3c2538e707828a5471fd974d2f465) mac: prevent generate on cross-compiles ### 📊 Changes **7 files changed** (+325 additions, -114 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/release.yaml` (+1 -1) 📝 `discover/runner.go` (+1 -1) 📝 `scripts/build_darwin.sh` (+115 -20) 📝 `x/imagegen/mlx/CMakeLists.txt` (+24 -14) 📝 `x/mlxrunner/mlx/dynamic.go` (+162 -78) ➕ `x/mlxrunner/mlx/dynamic_darwin.go` (+17 -0) ➕ `x/mlxrunner/mlx/dynamic_other.go` (+5 -0) </details> ### 📄 Description This modifies the Mac release to now have 2 builds of MLX for broader compatibility while supporting the latest M5 hardware features. NAX requires building with xcode 26.2 and targetting support only for OS v26 and up. Since we want to support older MacOS versions as well, we now need 2 different MLX builds and runtime detection logic to select the optimal version. The newer build will detect NAX missing at runtime, so it is safe to run on pre M5 macs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 07:35:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#20392