[PR #14994] [CLOSED] ggml-metal: probe tensor support with Metal 4 #20228

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14994
Author: @lentil32
Created: 3/21/2026
Status: Closed

Base: mainHead: fix/m5-metal-mixed-bf16-f16


📝 Commits (1)

  • 1e89733 ggml-metal: probe mixed bf16/f16 tensor support

📊 Changes

1 file changed (+52 additions, -0 deletions)

View changed files

📝 ml/backend/ggml/ggml/src/ggml-metal/ggml-metal-device.m (+52 -0)

📄 Description

Metal source compilation defaults to an older language mode unless MTLCompileOptions.languageVersion is set. On Apple M5 systems, that causes the tensor support probes to fail even when the f16 and bfloat tensor paths are valid.

Compile tensor probes as Metal 4 when tensor support is available, and keep the mixed bfloat/half probe that disables tensor mode before the full library is compiled on systems that reject that combination.

Tested on an Apple M5 Pro MacBook:

  • f16 tensor probe succeeds
  • bfloat tensor probe succeeds
  • mixed bfloat/half probe fails and disables tensor mode as expected
  • glm-4.7-flash loads and responds successfully

Related: #14432
Related: #13460

Fixes #13867.


🔄 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/14994 **Author:** [@lentil32](https://github.com/lentil32) **Created:** 3/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/m5-metal-mixed-bf16-f16` --- ### 📝 Commits (1) - [`1e89733`](https://github.com/ollama/ollama/commit/1e8973359dd6fa0acfbf1b5cf6e2e6a3a3a8430b) ggml-metal: probe mixed bf16/f16 tensor support ### 📊 Changes **1 file changed** (+52 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `ml/backend/ggml/ggml/src/ggml-metal/ggml-metal-device.m` (+52 -0) </details> ### 📄 Description Metal source compilation defaults to an older language mode unless `MTLCompileOptions.languageVersion` is set. On Apple M5 systems, that causes the tensor support probes to fail even when the `f16` and `bfloat` tensor paths are valid. Compile tensor probes as Metal 4 when tensor support is available, and keep the mixed `bfloat`/`half` probe that disables tensor mode before the full library is compiled on systems that reject that combination. Tested on an Apple M5 Pro MacBook: - `f16` tensor probe succeeds - `bfloat` tensor probe succeeds - mixed `bfloat`/`half` probe fails and disables tensor mode as expected - `glm-4.7-flash` loads and responds successfully Related: #14432 Related: #13460 Fixes #13867. --- <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:30:50 -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#20228