Where should gradient clipping go in a mixed-precision LoRA training step?
I work on CloudGPU. When you use PyTorch gradient scaling, clip after scaler.unscale_(optimizer) and before scaler.step(optimizer) . Clipping scaled gradients changes the meaning of the threshold. During gradient accumulation, wait until the effective batch is complete before unscaling. 1. Identify…
Read the full story at DEV Community — Machine Learning ↗
Timeline · 1 report
- 2026-11-11 06:57 · DEV Community — Machine Learning
Where should gradient clipping go in a mixed-precision LoRA training step?