[PR #14777] [MERGED] MLX: harden for init failures #40703

Closed
opened 2026-04-23 01:33:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14777
Author: @dhiltgen
Created: 3/11/2026
Status: Merged
Merged: 3/11/2026
Merged by: @dhiltgen

Base: mainHead: fix_init


📝 Commits (1)

  • 417deff MLX: harden for init failures

📊 Changes

4 files changed (+85 additions, -0 deletions)

View changed files

📝 x/imagegen/cmd/engine/main.go (+4 -0)
📝 x/imagegen/mlx/mlx.go (+21 -0)
x/imagegen/mlx/mlx_error_handler.c (+38 -0)
x/imagegen/mlx/mlx_error_handler.h (+22 -0)

📄 Description

The CLI now links to the lazy-load MLX code, but that still happens in init functions. On internal MLX errors, the CLI exits before it has a chance to start. This change re-wires the MLX error handling so it doesn't exit by default. The MLX based runners currently expect exits on failure, so they re-initialize the default error handling. We can refine error handling for better go stack traces in the future.


🔄 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/14777 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 3/11/2026 **Status:** ✅ Merged **Merged:** 3/11/2026 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `fix_init` --- ### 📝 Commits (1) - [`417deff`](https://github.com/ollama/ollama/commit/417deff25d2934428499bb664e082773f08c3ef3) MLX: harden for init failures ### 📊 Changes **4 files changed** (+85 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `x/imagegen/cmd/engine/main.go` (+4 -0) 📝 `x/imagegen/mlx/mlx.go` (+21 -0) ➕ `x/imagegen/mlx/mlx_error_handler.c` (+38 -0) ➕ `x/imagegen/mlx/mlx_error_handler.h` (+22 -0) </details> ### 📄 Description The CLI now links to the lazy-load MLX code, but that still happens in init functions. On internal MLX errors, the CLI exits before it has a chance to start. This change re-wires the MLX error handling so it doesn't exit by default. The MLX based runners currently expect exits on failure, so they re-initialize the default error handling. We can refine error handling for better go stack traces in the future. --- <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-23 01:33:26 -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#40703