VLM: fix EmbeddedInput shape handling, error recovery, and parallel loading#79
Open
stikves wants to merge 6 commits into
Open
VLM: fix EmbeddedInput shape handling, error recovery, and parallel loading#79stikves wants to merge 6 commits into
stikves wants to merge 6 commits into
Conversation
- EmbeddedInput.tokenCount: handle 2D [seq_len, hidden_dim] vs 3D [batch, seq_len, hidden_dim] - scatterMerge: replace precondition(float16) with guard/throw for bfloat16 compatibility
The @option attribute for "Maximum tiles" had no associated var, causing a compile error with ArgumentParser.
carinapeng
reviewed
Jul 3, 2026
carinapeng
reviewed
Jul 3, 2026
carinapeng
reviewed
Jul 3, 2026
carinapeng
reviewed
Jul 3, 2026
carinapeng
left a comment
Contributor
There was a problem hiding this comment.
This looks good to me overall but before approving I think a few things should be fixed, one is on how we read maxTiles, and the other is consistency - seems correct for the 2d case but scatter merge still issues 3D: [1, seq, hidden]
And let's do the testing on the Qwen3 VL as well since that is released :)
…shape handling - Remove --max-tiles CLI option (tiling model not implemented yet) - Move seq_len extraction into EmbeddedInput.seqLen(of:) so scatterMerge and other call sites use one canonical shape resolution path - tokenCount is now a stored property computed once at init
All current VLM models produce 3D embeddings. Drop the 2D fallback and the seqLen helper -- tokenCount is just shape[1].
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
[seq_len, hidden_dim]tensors (was returninghidden_diminstead ofseq_len). Now a stored property computed once at init.precondition(float16)with a thrown error for bfloat16 model compatibility.--max-tilesflag (tiling model not implemented yet).Test plan