Trials and tribulations fine-tuning & deploying Gemma-4 [P]
Hey all, Our ML team spent some time this week getting training and deployments working for Gemma-4, and wanted to document all the things we ran into along the way. * **PEFT doesn't recognize Gemma 4's custom layers.** Google wrapped vision/audio projections in a new `ClippableLinear` class that doesn't inherit from `nn.Linear`, so PEFT refuses to attach LoRA, even for text-only fine-tuning. Fix: unwrap the wrappers after loading weights but before calling PEFT. * **SFTTrainer killed training silently.** TRL hardcodes `use_cache=False`, which breaks Gemma 4's KV-sharing attention. Loss nev...