-
Notifications
You must be signed in to change notification settings - Fork 19.8k
model: Granite4 Vision #23545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
model: Granite4 Vision #23545
Changes from 98 commits
Commits
Show all changes
103 commits
Select commit
Hold shift + click to select a range
12750a7
feat(convert): Get language model conversion working for 4.1 vision
gabe-l-hart 47dd3b1
feat(convert): Skip multimodal tensors for GraniteMoeHybrid (vision 4.0)
gabe-l-hart b3a6914
fix: Disable vocab padding for non-hybrid models that use GraniteMoeH…
gabe-l-hart f83418c
feat: Plumb python-side vision projector names and mappings
gabe-l-hart 5b23f80
feat: Add python side architecture name
gabe-l-hart a176cbf
feat: Add python-side plumbing for setting FEATURE_LAYERS hparam
gabe-l-hart 79412a4
feat: Add c++ side tensor naming defines
gabe-l-hart 623ea2b
feat(mtmd): Convert vision_feature_layer to an ordered vector
gabe-l-hart 7dda78f
feat(mtmd): Add architecture label plumbing
gabe-l-hart 5e6184f
feat(wip): Add partial conversion for mmproj
gabe-l-hart 97600c7
feat: Add gguf_writer and constant support for new hparams and deepst…
gabe-l-hart f6d1975
feat: Full conversion for mmproj w/ tensor mappings
gabe-l-hart 97e612a
fix: Add lm_head skip for mmproj for 4.0
gabe-l-hart 2a969d3
fix: De-alias text_config architecture in convert_lora_to_gguf.py
gabe-l-hart 2332686
feat: Add --trust-remote-code arg to convert_lora_to_gguf.py
gabe-l-hart fc31cca
fix: De-alias model.language_model. -> model. for lora adapters
gabe-l-hart 0b03ada
fix: Extend language model tensor dealiasing in adapters
gabe-l-hart fb6075b
fix: Remove unnecessary registration for GraniteSpeech in language model
gabe-l-hart 8e4c0b5
feat: Plumb through mm prefix formatting for qformer tensors
gabe-l-hart 8aa1268
refactor: Refactor vision projector tensors to use predictor ID as th…
gabe-l-hart 14fd2cc
feat: Add spatial offests array hparam conversion
gabe-l-hart 0feeb29
feat: Add stub plumbing for granite vision in mtmd
gabe-l-hart 5f23c21
feat: Add new hparam and tensor naming in clip-impl.h
gabe-l-hart 234973d
fix: Move deepstack_layer_arr to llm hparam instead of mmproj
gabe-l-hart cb05a27
fix: Remove IS_DEEPSTACK_LAYERS
gabe-l-hart 1551ec3
refactor: n_deepstack_layers -> deepstack_layer_arr
gabe-l-hart 5d0f1ee
fix: Use try/catch for single/multi valued deepstack info
gabe-l-hart c69e655
feat: Add deepstack injection point for granite LLM
gabe-l-hart acf0e98
fix: add missing vision attn layernorm eps
gabe-l-hart 5ce4b81
refactor: Hoist qformer tensors into qf_block and hold a vector for m…
gabe-l-hart 520d789
fix: Fix missing prefix template for TN_QF_PROJ_LINEAR
gabe-l-hart a460879
fix: Add embedding scale and image grid pinpoints hparams in conversion
gabe-l-hart 173becf
feat: Add mtmd KEY_ section for hparams shared with the LLM
gabe-l-hart d3c174c
feat: Implement c++ hparam parsing
gabe-l-hart 944f15f
fix: Flatten pinpoints in conversion
gabe-l-hart 86fef1e
fix: Add missing break
gabe-l-hart 575f401
fix: No reason to have modality prefix for img_pos
gabe-l-hart 4d59c0e
feat: Add tensor loading
gabe-l-hart 0df9de9
fix(convert): Fix confusion between proj.norm and proj.qformer.layernorm
gabe-l-hart 493111f
fix: Use the right portion of speech for tensor loading!
gabe-l-hart 5e7231a
feat: Add logging of deepstack_layers_arr if set
gabe-l-hart d072dc9
fix: Make sure input embeddings are cont before f_embedding_scale
gabe-l-hart 0f65a0d
feat: Add init and mmproj_embd cases for g4v
gabe-l-hart 87e363b
fix: Invert (h, w) -> (w, h) pinpoints
gabe-l-hart 8c976a0
fix: Reorder projectors based on llm index and skip the first injection
gabe-l-hart b1ab316
fix: Fix mmproj hparams in conversion
gabe-l-hart 02eabed
fix: Fix ordering/logic for deepstack injection in granite
gabe-l-hart af636f5
fix: Fix preprocessing config to match what the model needs
gabe-l-hart d655ee6
wip: Partial port of Eli's implementation
gabe-l-hart 3e0508b
fix: Fix the pre-scaling on the input embeddings to correctly invert …
gabe-l-hart 5792a27
feat: invert embedding multiplier -> base_scale at load
gabe-l-hart 9a06787
Merge remote-tracking branch 'origin/master' into Granite4Vision
gabe-l-hart f2e2de6
fix: Fix setting image_resize_pad after new enum introduced
gabe-l-hart 6bb918c
fix: Add G4V to mmproj mapping in conversion
gabe-l-hart 12c085e
fix: Re-add padding disable for non-hybrid hybrid models
gabe-l-hart db28b58
refactor: Simplify G4V n_tokens computation
gabe-l-hart 6f110e7
feat: Add new clip APIs for post-tile-encoding assembly
gabe-l-hart db6a998
feat: Add model interfaces for granite 4 vision assembler
gabe-l-hart 509c0ae
refactor: Remove all g4v-specific branching from mtmd.cpp in favor of…
gabe-l-hart 3f15957
refactor(mtmd): Consolidate assembler logic into clip_assembler class…
gabe-l-hart 1754e31
style: Comment improvement
gabe-l-hart 75452c3
Merge remote-tracking branch 'origin/master' into Granite4Vision
gabe-l-hart 0a6c5cf
refactor: granite_vision -> granite4_vision
gabe-l-hart 8dc2b24
fix: Remove dead codepath for Qwen3VL add_vision_is_deepstack
gabe-l-hart 2c4e167
fix: Oops! I did not mean to commit one of my prompt files
gabe-l-hart 72355e9
fix: Add missing <algorithm> include for std::find
gabe-l-hart 33ec796
fix: Fix Flake8 warnings in granite conversion module
gabe-l-hart 52633fa
refactor: Remove clip_assembler in favor of clip_image_f32.append_token
gabe-l-hart 5977036
Merge remote-tracking branch 'origin/master' into Granite4Vision
gabe-l-hart 23990da
refactor(convert): Split n_deepstack_layers and deepstack_layers (array)
gabe-l-hart f28a91a
refactor(src): Handle n_deepstack_layers and deepstack_layers GGUF keys
gabe-l-hart 6b42c74
fix: Fix GGUF key for deepstack_layers_arr
gabe-l-hart dd50fb4
refactor: Remove pre-scaling embeddings and skip scaling for raw embd…
gabe-l-hart e73aa80
refactor: deepstack_layers(_arr) -> deepstack_mapping(_arr)
gabe-l-hart 43a6f6e
Merge remote-tracking branch 'origin/master' into Granite4Vision
gabe-l-hart 094ce7c
refactor: Fully revert changes to n_deepstack_layers and qwen3vl*
gabe-l-hart b556366
fix: Revert removal of "is_deepstack_layers" GGUF KV
gabe-l-hart 11bd6bb
fix: Remove unnecessary ggml_cont and build_forward_expand in cbx
gabe-l-hart 5c6bd55
style: Clean up comments
gabe-l-hart 4910062
fix: Tighter and more flexible code for g4v_build_block
gabe-l-hart bb81156
fix: Remove unnecessary `unordered_set` include
gabe-l-hart 4e6a206
fix: Add architecture guard on deepstack_mapping_arr printout
gabe-l-hart 096ea2c
fix: Remove unnecessary AI-gen comment
gabe-l-hart 0b46432
fix: Always initialize deepstack_mapping_arr with -1 values
gabe-l-hart 7c4a791
style: Remove TODO about block/vs non-block tensor mapping
gabe-l-hart 263a4a3
refactor: Move is_vision_feature_layer logic into clip_hparams
gabe-l-hart 440f36b
refactor: Use a bool for append_token
gabe-l-hart 9d8e3e8
style: Remove unnecessary comment
gabe-l-hart 54546ff
fix: Remove unused get_model api
gabe-l-hart 70c2302
refactor: Rearrange helpers for g4v to be private members and use bui…
gabe-l-hart 5d6de27
Merge remote-tracking branch 'origin/master' into Granite4Vision
gabe-l-hart 55605c0
Merge remote-tracking branch 'origin/master' into Granite4Vision
gabe-l-hart ecb247b
fix: Fix off-by-one in vision layer index
gabe-l-hart d8d37df
fix: Fix norm/post_norm mixup in conversion
gabe-l-hart 255f934
style: More descriptive tensor names
gabe-l-hart eb8906a
Merge remote-tracking branch 'origin/master' into Granite4Vision
gabe-l-hart 3323d68
Merge remote-tracking branch 'origin/master' into Granite4Vision
gabe-l-hart 2eea626
Merge remote-tracking branch 'origin/master' into Granite4Vision
gabe-l-hart 9eb1762
fix: Apply PR cleanup for new conversion changes
gabe-l-hart c5afa80
fix(convert): Remove duplicate V_ENC_EMBD_IMGNL
gabe-l-hart c12a262
refactor: append_token -> add_newline
gabe-l-hart d3d5a08
style: Comment cleanup
gabe-l-hart b200984
feat: Cleaner error handling/checking
gabe-l-hart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.