fix(gguf): safely propagate runtime errors for unknown architectures#2106
Open
glaziermag wants to merge 1 commit intoEricLBuehler:masterfrom
Open
fix(gguf): safely propagate runtime errors for unknown architectures#2106glaziermag wants to merge 1 commit intoEricLBuehler:masterfrom
glaziermag wants to merge 1 commit intoEricLBuehler:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Issue #2098: Handle unknown GGUF Architecture panics
Description
Hi there! This PR adds a small fix for #2098, where the GGUF loader would panic if it encountered an unsupported architecture string (like
gemma4), bypassing the normal error handling.I've swapped the
.unwrap()call to map theanyhow::Resultinto acandle_core::Error::Msg. Hopefully, this will allow the application to gracefully return an error rather than completely crashing the thread.Local Testing
To make sure this behaves properly natively, I tested it locally using
mistralrs-serverand a dummygemma4GGUF file.How I tested it natively:
$ RUST_BACKTRACE=1 cargo run -p mistralrs-server -- gguf -m . -f dummy_gemma4.ggufBefore this PR (Panic):
After this PR (Graceful Error):
Verification
I also ran
cargo test --workspaceto make sure this isolated change doesn't accidentally cause any regressions in the surrounding tensor or pipeline tests. Everything seems to be passing smoothly.Please let me know if there's a better way to structure this error mapping or if anything else is needed here. Thanks for your time reviewing!