Repository navigation
SWF(bug): reject invalid mmproj patch frame indices - #91
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…oj-patch-frame-bound Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/spark-runtime/src/weights/gguf/tests.rs
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.
Summary
CLIP mmproj GGUF patch-embed frame suffixes are now bounded by the number of patch-frame tensors in the file, so
v.patch_embd.weight.18446744073709551615returns a loader error instead of panicking or forcing a hugepatch_framesallocation.Root cause:
vision_patch_frame()accepts anyusizesuffix, andload_pass()used that value directly as aVecindex/length.usize::MAXoverflowedframe + 1in debug builds and indexed past the empty vector in release; smaller hostile indices could still allocateframe + 1entries before the contiguity check.Test plan
Try it (CPU):
ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p spark-runtime --lib clip_patch_frame_index_is_bounded -- --nocapturecrates/spark-runtime/src/weights/gguf/sidecar.rs:141(attempt to add with overflow) with a synthetic clip GGUF containingv.patch_embd.weight.18446744073709551615.1 passed; fullcargo test -p spark-runtime --lib→590 passed; 0 failed; 11 ignored(re-run after mergingmain).cargo fmt --all -- --checkATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --testsbash scripts/check-license-headers.sh(4283files checked,0invalid)typossidecar::load_passwith a synthetic clip GGUF.Notes for reviewers
Valid contiguous frame sets are unchanged: frame indices must still be
0..T-1, and the new check only rejects an index that cannot belong to that set because it reaches the file's patch-frame tensor count. The GGUF tensor-directory arithmetic overflow is intentionally untouched here (landed separately in #90).Branch updated with
mainafter #90 merged; the only conflict was incrates/spark-runtime/src/weights/gguf/tests.rs, resolved by keeping both the malformed-directory tests and this regression test.CLA
Implemented in session Bound mmproj patch-frame index from GGUF tensor names
Review with Devin · Open in Devin Desktop