Skip to content

model: don't crash on unsupported architecture - #22742

Merged
CISC merged 2 commits into
ggml-org:masterfrom
giladgd:throwOnUnsupportedModelArchitecture
May 6, 2026
Merged

model: don't crash on unsupported architecture#22742
CISC merged 2 commits into
ggml-org:masterfrom
giladgd:throwOnUnsupportedModelArchitecture

Conversation

@giladgd

@giladgd giladgd commented May 6, 2026

Copy link
Copy Markdown
Contributor

Overview

Before #22004, when trying to load a model with an unsupported architecture using llama_model_load_from_file it used to just fail silently and return nullptr instead of crashing.
This PR restores the old behavior.

Requirements

@giladgd
giladgd requested a review from CISC as a code owner May 6, 2026 03:23
@ggml-gh-bot

This comment was marked as resolved.

@giladgd

giladgd commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

@ggml-bot I'm not a new contributor

@am17an

am17an commented May 6, 2026

Copy link
Copy Markdown
Contributor

@giladgd the bot looks at the last 90 days for this check for performance reasons. Sorry about the noise

@CISC

CISC commented May 6, 2026

Copy link
Copy Markdown
Member

Before #22004, when trying to load a model with an unsupported architecture using llama_model_load_from_file it used to just fail silently and return nullptr instead of crashing. This PR restores the old behavior.

You lost me?

@giladgd

giladgd commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

@CISC In the past, when trying to load a model with an unsupported architecture (for example, loading an mmproj using llama_model_load_from_file) it’ll just fail - calling llama_model_load_from_file with such a model will log an error, and return nullptr.
PR #22004 (inadvertently) changed that behavior, so now trying to load an unsupported model using llama_model_load_from_file reaches an GGML_ABORT and so the process crashes.

This PR fix that, so that trying to load an unsupported model will just fail (like before) and won’t crash the process.

@CISC

CISC commented May 6, 2026

Copy link
Copy Markdown
Member

Ah, I see, because llama_model_load catches the runtime error...

Comment thread src/llama-model.cpp Outdated
Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
@CISC CISC added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label May 6, 2026
@CISC
CISC merged commit 5207d12 into ggml-org:master May 6, 2026
44 of 46 checks passed
cetarthoriphros pushed a commit to cetarthoriphros/llama.cpp that referenced this pull request May 9, 2026
* model: don't crash on unsupported architecture

* Update src/llama-model.cpp

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
meh pushed a commit to meh/llama.cpp that referenced this pull request May 10, 2026
* model: don't crash on unsupported architecture

* Update src/llama-model.cpp

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
baramofme pushed a commit to baramofme/llama-cpp-turboquant that referenced this pull request May 23, 2026
* model: don't crash on unsupported architecture

* Update src/llama-model.cpp

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
winstonma pushed a commit to winstonma/llama.cpp that referenced this pull request May 27, 2026
* model: don't crash on unsupported architecture

* Update src/llama-model.cpp

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request May 30, 2026
* model: don't crash on unsupported architecture

* Update src/llama-model.cpp

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants