Skip to content

[Tests]: gemma3 tests are enabled#918

Merged
quic-rishinr merged 4 commits intoquic:mainfrom
abukhoy:gemma3-text-fix
Apr 24, 2026
Merged

[Tests]: gemma3 tests are enabled#918
quic-rishinr merged 4 commits intoquic:mainfrom
abukhoy:gemma3-text-fix

Conversation

@abukhoy
Copy link
Copy Markdown
Contributor

@abukhoy abukhoy commented Apr 17, 2026

No description provided.

Signed-off-by: Abukhoyer Shaik <abukhoye@qti.qualcomm.com>
"img_url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/datasets/cat_style_layout.png",
"text_prompt": "Can you describe the image in detail.",
"num_layers": 6,
"num_layers": 2,
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 model has to run for minimum 6 layers

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.

Layer 0 to 5 : full attention and layer 6: sliding window

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No need of 6 layers, I have changed the layer types. In 2 layers, we can check the model with full_attention and sliding_attention.

"img_url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/datasets/cat_style_layout.png",
"text_prompt": "Can you describe the image in detail.",
"num_layers": 6,
"num_layers": 2,
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.

same here 6 layers minimum

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No need of 6 layers, I have changed the layer types. In 2 layers, we can check the model with full_attention and sliding_attention.

"additional_params": {
"text_config": {
"_sliding_window_pattern": 2,
"sliding_window_pattern": 2,
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.

Won't this differ from original config file? And since you are updating this in code itself below, do we need this param here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, it will not differ the original config. I have checked the config when I tested it.

"text_config": {
"_sliding_window_pattern": 2,
"sliding_window_pattern": 2,
"head_dim": 256,
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.

How head_dim :256 is computed? Also why sliding_window_pattern is 2?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sliding window pattern, we can change according to the layer types.

)
config = set_num_layers_vlm(config, n_layer=n_layer)
if hasattr(config, "model_type") and config.model_type in ["gemma3"]:
config.text_config._sliding_window_pattern = 2
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.

Original model has slidding window length as 6

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's true. But we can modify, right?

)
config = set_num_layers_vlm(config, n_layer=n_layer)
if hasattr(config, "model_type") and config.model_type in ["gemma3"]:
config.text_config._sliding_window_pattern = 2
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@asmigosw as you can see that I am setting _sliding_window_pattern here.

Copy link
Copy Markdown
Contributor

@asmigosw asmigosw left a comment

Choose a reason for hiding this comment

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

LGTM

@quic-rishinr quic-rishinr merged commit 221404c into quic:main Apr 24, 2026
5 checks passed
quic-akuruvil pushed a commit that referenced this pull request Apr 27, 2026
Signed-off-by: Abukhoyer Shaik <abukhoye@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.

4 participants