[Model] Add DiffusionGemma Support (#45163)

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Co-authored-by: Martin Kukla <martin.kukla@cantab.net>
Co-authored-by: Matthew Bonanni <mbonanni@redhat.com>
Co-authored-by: Dipika Sikka <dsikka@redhat.com>
Co-authored-by: NickLucche <nlucches@redhat.com>
Co-authored-by: jiahanc <173873397+jiahanc@users.noreply.github.com>
Co-authored-by: Alec Kohlhoff <134344302+aleckohlhoff@users.noreply.github.com>
Co-authored-by: Porras Huang <20535584+porrashuang@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: scoootscooob <167050519+scoootscooob@users.noreply.github.com>
This commit is contained in:
Lucas Wilkinson
2026-06-11 22:17:35 -07:00
committed by GitHub
co-authored by Martin Kukla Matthew Bonanni Dipika Sikka NickLucche jiahanc Alec Kohlhoff Porras Huang Claude scoootscooob
parent 1ce3cdc5c1
commit eb28452b10
52 changed files with 2695 additions and 232 deletions
+1 -3
View File
@@ -725,10 +725,8 @@ class Gemma4DecoderLayer(nn.Module):
if self.enable_moe_block:
hidden_states_1 = self.post_feedforward_layernorm_1(hidden_states)
# Router and MoE experts see the residual (pre-MLP state),
# matching the HF transformers forward path
router_logits = self.router(residual)
hidden_states_2 = self.pre_feedforward_layernorm_2(residual)
router_logits = self.router(residual)
hidden_states_2 = self.moe(hidden_states_2, router_logits)
hidden_states_2 = self.post_feedforward_layernorm_2(hidden_states_2)