The Wire · Showcase
SENTENCE-TRANSFORMERS FIXES SILENT GRADIENT CORRUPTION ON GPU
By RepoJournal · Filed · About Hugging Face
A critical bug in cached losses was silently producing wrong gradients on GPU, and it's fixed now [ref:1].
Sentence-transformers consolidated its fragmented GradCache machinery into a single shared engine and patched a silent gradient corruption bug that affected cross-encoder cached losses on GPU and prompt-training with `Pooling(include_prompt=False)` across all cached losses [1]. This is the kind of bug that ships bad models without warning. In related fixes, the library corrected causal padding validation that was reading the wrong attribute on multimodal processors, causing VLM padding checks to never fire [2], and improved error messages for video metadata passed as sibling keys instead of nested under the video modality [3]. TRL is systematically hardening its experimental trainers with comprehensive eval_dataset initialization tests across GRPO-family [4], Online-DPO-family [5], SFT and distillation [6], and preference trainers [7], mirroring coverage already added to core trainers. Diffusers added Cosmos 3 Edge generator support [9] and began shipping Anima img2img pipeline blocks [10], extending modular generation capabilities. Optimum-Intel patched a missing compression parameter that should have been exposed [8].
Action items
- → Update sentence-transformers immediately if using cached losses, cross-encoders, or prompt training on GPU huggingface/sentence-transformers [immediate]
- → Review TRL trainer eval_dataset handling against your use case now that comprehensive tests are shipping huggingface/trl [plan]
- → Monitor sentence-transformers releases for any downstream effects from the GradCache consolidation huggingface/sentence-transformers [monitor]
References
- [1] [`losses`] Consolidate GradCache into one shared engine, fix silently wrong gradients, add `mini_batch_num_tokens` ↗ huggingface/sentence-transformers
- [2] Check causal left padding against the attention mask huggingface/sentence-transformers
- [3] Improve the error message when `video_metadata` is passed as a sibling modality key (#3866) huggingface/sentence-transformers
- [4] Add eval_dataset init tests for experimental GRPO-family trainers ↗ huggingface/trl
- [5] Add eval_dataset init tests for experimental Online-DPO-family trainers ↗ huggingface/trl
- [6] Add eval_dataset init tests for experimental SFT and distillation trainers ↗ huggingface/trl
- [7] Add eval_dataset init tests for experimental preference trainers ↗ huggingface/trl
- [8] Add missing compression parameter ↗ huggingface/optimum-intel
- [9] Cosmos3 edge support ↗ huggingface/diffusers
- [10] [Anima] Add img2img pipeline blocks ↗ huggingface/diffusers