Skip to content

server: fail initialization on async compute errors (#27309) - #28242

Closed
ac-mmi wants to merge 1 commit into
ggml-org:masterfrom
ac-mmi:fix/server-init-async-compute-failure
Closed

ac-mmi wants to merge 1 commit into
ggml-org:masterfrom
ac-mmi:fix/server-init-async-compute-failure

Conversation

@ac-mmi

@ac-mmi ac-mmi commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Fixes #27309.

A compute failure during context initialization can happen asynchronously. In that case, the initial llama_decode() may succeed, with the error only appearing when the backend is synchronized. The server could then print model loaded and report itself as ready, while requests later fail with Compute error.

Probe once more after synchronization so the backend error is caught, and fail initialization when the target context cannot evaluate.

Additional information

CC:@ngxson

Tested on Metal with and without warmup.

  • An oversized context that hits OOM now fails during initialization.
  • Normal context loading and completion still work.
  • No-memory embedding models still load and serve embeddings.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES — Cursor was used during investigation and testing. I reviewed the change and verified the behavior manually.

@ac-mmi

ac-mmi commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

@ngxson Could you please take a look at this PR when you have a chance? Happy to make any changes or rework the approach based on your feedback.

@ac-mmi ac-mmi closed this Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: server reports "model loaded" and binds the port after a fatal Metal OOM during init; every request then 500s

1 participant