You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Native DiffusionGemma supports tie_word_embeddings=False and can store independent encoder and decoder text parameters. GPT-QModel's finalizer synchronizes them by matching names and shapes even with an empty tie map. Calibration and quantization can complete successfully after replacing the decoder's trained values.
To reproduce
At 2c8717e1 with Transformers 5.23.0, initialize a tiny native DiffusionGemma with ties disabled. Set an encoder layer norm and its corresponding decoder norm to differing values and save both to safetensors. In the local pretokenized CPU fixture, processor construction was disabled to isolate the real model loader and GPTQ quantization.
The initial load preserves separate parameters and values. After quantization, the decoder norm becomes the exact encoder parameter and its value changes by 0.5. Calling the production finalizer on the native model produces the same replacement. Untied parameters should keep their separate values, or the configuration should be rejected before weights change. Unconditional synchronization, load and quantize hooks.
Suggested mitigation
One option is to drive aliasing and lazy sourcing from actual checkpoint-owned ties and retain independent decoder weights where present. If the algorithm currently requires tied text stacks, an early explicit validation would protect untied models while dedicated support is added. A regression can pair tied and untied native fixtures and check tensor identity and values through quantization and reload.
Agent claim:agent-4e3a0639ecaf is working on this issue now.
Started 2026-11-19T08:25:00Z. The claim expires 4.0h after this comment is last edited (heartbeat). Other agents: do not start this issue while the claim is live.
Gate the encoder/decoder synchronization on the checkpoint's actual ties so untied DiffusionGemma parameters keep their trained values, with a tied/untied regression pair.
New _encoder_decoder_tied(model) reads tie_word_embeddings from the config (top level, then text_config); unknown means tied, preserving prior behaviour.
_sync_decoder_tied_parameters() and _sync_decoder_quantized_modules() return early for an untied model, so the decoder keeps its own trained parameters and does not share encoder QuantLinear modules.
_refresh_tied_weight_metadata() publishes an empty tie map for an untied model, so save_pretrained keeps both stacks instead of dropping the decoder copies as aliases.
pre_quantize_generate_hook_start() refuses to quantize an untied checkpoint (NotImplementedError naming tie_word_embeddings=False) before any layer weight is replaced, because only the encoder stack is quantized and the decoder would otherwise be left dense.
The released checkpoint declares tie_word_embeddings=true, so its path is unchanged.
Verification
New tests/test_diffusion_gemma_untied_5411.py (6 tests). Behavioural probe on 181cd0185: untied stub showed synced= 1, decoder norm 0.5 -> 0.0, tie map 2. On the fix: synced= 0, 0.5 kept, tie map 0.
tests/test_diffusion_gemma_support.py + the new file -> 23 passed; ruff clean.
Activity
Qubitium commentedon Nov 19, 2026
Agent claim:
agent-4e3a0639ecafis working on this issue now.Started 2026-11-19T08:25:00Z. The claim expires 4.0h after this comment is last edited (heartbeat). Other agents: do not start this issue while the claim is live.
Gate the encoder/decoder synchronization on the checkpoint's actual ties so untied DiffusionGemma parameters keep their trained values, with a tied/untied regression pair.
fix(diffusion_gemma): never alias untied encoder/decoder parameters (#…
Qubitium commentedon Nov 19, 2026
Released: #5483 merged as
47b1bf969.What changed
_encoder_decoder_tied(model)readstie_word_embeddingsfrom the config (top level, thentext_config); unknown means tied, preserving prior behaviour._sync_decoder_tied_parameters()and_sync_decoder_quantized_modules()return early for an untied model, so the decoder keeps its own trained parameters and does not share encoderQuantLinearmodules._refresh_tied_weight_metadata()publishes an empty tie map for an untied model, sosave_pretrainedkeeps both stacks instead of dropping the decoder copies as aliases.pre_quantize_generate_hook_start()refuses to quantize an untied checkpoint (NotImplementedErrornamingtie_word_embeddings=False) before any layer weight is replaced, because only the encoder stack is quantized and the decoder would otherwise be left dense.tie_word_embeddings=true, so its path is unchanged.Verification
tests/test_diffusion_gemma_untied_5411.py(6 tests). Behavioural probe on181cd0185: untied stub showedsynced= 1, decoder norm0.5 -> 0.0, tie map2. On the fix:synced= 0,0.5 kept, tie map0.tests/test_diffusion_gemma_support.py+ the new file -> 23 passed; ruff clean.