gguf: accept zero-sized tensor dimensions - #26701
Closed
jeevan6996 wants to merge 1 commit into
Closed
Conversation
Green-Sky
self-requested a review
August 7, 2026 08:04
CISC
approved these changes
Aug 12, 2026
| return ok; | ||
| } | ||
|
|
||
| static FILE * get_zero_dim_tensor_file() { |
Member
There was a problem hiding this comment.
Simplify this by adding HANDCRAFTED_TENSORS_ZERO_DIM instead.
Member
|
Superseded by #25596 |
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.
Overview
Fixes #26366 gguf loading for valid tensors with zero-sized dimensions.
Existing overflow validation divides by tensor dimensions, causing SIGFPE on x86-64 when a dimension is zero.
Solution: Detect zero dimensions and skip those divisions while retaining overflow validation for nonzero dimensions.
Additional information
Testing: Added a regression test using a valid GGUF tensor shaped [1, 0].
Validation: CPU-only build completed; all 89/89 test-gguf tests passed.
Requirements