Skip to content

Gemma4#966

Draft
tchawada wants to merge 22 commits into
quic:mainfrom
tchawada:gemma4
Draft

Gemma4#966
tchawada wants to merge 22 commits into
quic:mainfrom
tchawada:gemma4

Conversation

@tchawada
Copy link
Copy Markdown
Contributor

@tchawada tchawada commented May 6, 2026

End to end pipeline for gemma4

@quic-hemagnih
Copy link
Copy Markdown
Contributor

@tchawada can you please resolve the conflicts and update the PR.

Copy link
Copy Markdown
Contributor

@quic-hemagnih quic-hemagnih left a comment

Choose a reason for hiding this comment

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

Can we add the test case in the CI

@tchawada tchawada force-pushed the gemma4 branch 2 times, most recently from ebd6845 to 4e97579 Compare May 19, 2026 11:05
@quic-rishinr quic-rishinr added the 1.22 Release 1.22 candidate label May 22, 2026
@quic-rishinr quic-rishinr requested a review from vbaddi May 25, 2026 10:06
Comment thread examples/image_text_to_text/models/gemma_vision/gemma4_diss.py Outdated
skip_model_io=True,
**compiler_kwargs,
)
breakpoint()
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.

remove breakpoint

for i in range(num_chunks):
chunk_inputs["input_ids"] = lang_inputs["input_ids"][:, i * PREFILL_SEQ_LEN : (i + 1) * PREFILL_SEQ_LEN]
chunk_inputs["position_ids"] = lang_inputs["position_ids"][..., i * PREFILL_SEQ_LEN : (i + 1) * PREFILL_SEQ_LEN]
breakpoint()
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.

remove breakpoints @qcdipankar Please check and remove all the breakpoints

Comment thread QEfficient/transformers/models/gemma4/modeling_gemma4.py
@qcdipankar qcdipankar marked this pull request as draft May 26, 2026 05:47
return self.model.config.__dict__


class _QEffAutoModelForImageTextToTextLanguageOnlyCompat:
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.

@tchawada why are we making a new AutoModel for lang part in text can't we handle using the same conditional generation as that of other VLM's?

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.

I am changing this

Comment thread QEfficient/transformers/models/modeling_auto.py Outdated
# and vision_onnx_path is None
# )
# need_export_lang = self.lang_model.onnx_path is None and lang_onnx_path is None
# if need_export_vision or need_export_lang:
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 patch is different and changes the variables and the meaning of their usage for diss mode can we go back to mainline variables

if k
in {"pixel_values", "image_masks", "image_input_idx", "valid_idx", "aspect_ratio_ids", "aspect_ratio_mask"}
in {
"pixel_values",
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.

why is image position ids required 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.

Without them, the output is not meaningful


target_dtype = getattr(self.model.config, "torch_dtype", torch.float32)
convert_to_fp16 = CUSTOM_IO_DTYPE_MAP[target_dtype] == "float16"
print(convert_to_fp16)
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.

remove the print from here

tchawada added 13 commits May 26, 2026 12:41
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
tchawada and others added 9 commits May 26, 2026 12:44
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Tanisha Chawada <tchawada@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
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

1.22 Release 1.22 candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants