[PR #14996] ggml-metal: compile tensor probes as Metal 4 #61656

Open
opened 2026-04-29 16:42:53 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14996
Author: @lentil32
Created: 3/21/2026
Status: 🔄 Open

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


📝 Commits (1)

  • e8fd263 ggml-metal: compile tensor probes as Metal 4

📊 Changes

1 file changed (+12 additions, -2 deletions)

View changed files

📝 ml/backend/ggml/ggml/src/ggml-metal/ggml-metal-device.m (+12 -2)

📄 Description

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

Compile source-based tensor probes as Metal 4 when tensor support is available.

This is complementary to #14604. It does not address the mixed bfloat/half cooperative tensor failure by itself, but it avoids false-negative tensor probe failures in source-compiled Metal environments.

Tested on an Apple M5 Pro MacBook:

  • without this change, the source-compiled f16 tensor probe can fail due to the default Metal language mode
  • with this change, the f16 and bfloat tensor probes compile successfully
  • on top of the #14604-style mixed bfloat/half workaround, glm-4.7-flash loads and responds successfully

Related: #13867
Related: #14432
Related: #13460
Complementary to: #14604


🔄 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/14996 **Author:** [@lentil32](https://github.com/lentil32) **Created:** 3/21/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/m5-metal-mixed-bf16-f16` --- ### 📝 Commits (1) - [`e8fd263`](https://github.com/ollama/ollama/commit/e8fd263623dbf3a11512c405a15f37afc0afd3f8) ggml-metal: compile tensor probes as Metal 4 ### 📊 Changes **1 file changed** (+12 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `ml/backend/ggml/ggml/src/ggml-metal/ggml-metal-device.m` (+12 -2) </details> ### 📄 Description Metal source compilation defaults to an older language mode unless `MTLCompileOptions.languageVersion` is set. On Apple M5 systems, that can cause the `f16` and `bfloat` tensor support probes to fail even when those tensor paths are otherwise valid. Compile source-based tensor probes as Metal 4 when tensor support is available. This is complementary to #14604. It does not address the mixed `bfloat`/`half` cooperative tensor failure by itself, but it avoids false-negative tensor probe failures in source-compiled Metal environments. Tested on an Apple M5 Pro MacBook: - without this change, the source-compiled `f16` tensor probe can fail due to the default Metal language mode - with this change, the `f16` and `bfloat` tensor probes compile successfully - on top of the `#14604`-style mixed `bfloat`/`half` workaround, `glm-4.7-flash` loads and responds successfully Related: #13867 Related: #14432 Related: #13460 Complementary to: #14604 --- <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-29 16:42:53 -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#61656