fix: [Memory Estimator] Fix text config attribute fetching for new multimodal models (e.g., Qwen-3-VL)#67
Merged
ISEEKYAN merged 2 commits intoISEEKYAN:mainfrom Jan 20, 2026
Merged
Conversation
Owner
|
thank you @LZY2275 for your interests in the memory estimator, I did not tested this on qwen-vl models and no vision part is developed. I think now only the language part can be precisely estimated, do you have any estimation results on qwen-vl? Do you think it necessary to precisely estimate the vision part? Feel free to discuss with me! |
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.
Background
Most modern multimodal models extended from text models (e.g., Qwen-3-VL) encapsulate core text-related attributes (vocab_size, max_position_embeddings, hidden_size, etc.) in
hf_config.text_config. However, some older multimodal models (e.g., Qwen-2-vl-7B-Instruct) keep these attributes at the top level of the config.The original code only fetched attributes from the top-level config, which worked for older models like Qwen-2-vl but failed for newer ones like Qwen-3-VL (since their text attributes are nested in
text_config).Changes Made
Add support for text_config-nested attributes: