Skip to content

Adding Multi Resolution Changes for Gemma4 Model - #1244

Open
tchawada wants to merge 4 commits into
quic:mainfrom
tchawada:gemma4_multi_resol
Open

Adding Multi Resolution Changes for Gemma4 Model#1244
tchawada wants to merge 4 commits into
quic:mainfrom
tchawada:gemma4_multi_resol

Conversation

@tchawada

@tchawada tchawada commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Adds multi-resolution Gemma4 vision workflow support via a new example script:
gemma4_multi_resolution.py.

The script compiles a single Gemma4 setup with multiple (height, width) specializations, then runs
generation across those resolutions by dynamically selecting the required vision token budget
(choose_gemma4_max_soft_tokens). This demonstrates
end-to-end compile + generate for variable image sizes without per-resolution recompilation.

Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
@tchawada
tchawada requested review from mohiso22 and ochougul August 6, 2026 09:59
vision_size = user_vision_size
else:
vision_size = self._get_mm_tokens_per_image()
if height is None or width is None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This user_vision_size warning is necessary,

Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants