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
{{ message }}
Repository navigation
Vocab-parallel cross entropy with label smoothing returns inf when a logit is far below the row max #1618
With label_smoothing > 0, LigerVocabParallelCEFunction.forward takes torch.log(exp_buf) to get the log-probabilities (ops/vocab_parallel_cross_entropy.py, line 304). exp_buf holds exp(x - max) in fp32, which is 0 once a logit is about 104 below the row max, so the loss is inf where F.cross_entropy is finite. A vocabulary masked with a large negative value gives such rows. The gradient is not affected.
Run on main (42dc23c) with an NVIDIA L40S, torch 2.15.0a0 and Triton 3.8.0. LigerMegatronCrossEntropy uses the same code. That line also builds two [BT, V_local] fp32 temporaries.
Activity