Hugging Face Transformers silent bug multiplies gradients with DeepSpeed Ulysses ZeRO-1 or ZeRO-2
A silent training bug has been identified in Hugging Face Transformers that impacts long-context model training when using DeepSpeed Ulysses sequence parallelism with ZeRO-1 or ZeRO-2. While the logged token-mean loss appears normal, actual query-weight gradient norms are incorrectly multiplied by the number of sequence-parallel ranks. This flaw can cause long-context fine-tuning to become unstable or misconfigured without any warnings in the loss logs. Open article →