-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CrossEntropyLoss return single value when reduction is "none" #421
Comments
Sorry. We only support "mean" and "sum" for now. Are you willing to contribute by adding an assertion or implementing "none" reduction? Thanks! |
I think I can make a PR to add an assert to block "none" first, then let's see how to implement the "none" reduction one. |
The triton kernel of liger ce is actually giving none reduction loss, just need to make a reduction=="none" condition to output loss1d directly without torch.sum()
|
Looks good to me |
🐛 Describe the bug
When using
LigerCrossEntropyLoss
withreduction="none"
, it returns a single value, instead of an array.Reproduce
Versions
Environment Report:
Operating System: Linux-5.15.0-88-generic-x86_64-with-glibc2.35
Python version: 3.10.15
PyTorch version: 2.5.1+cu124
CUDA version: 12.4
Triton version: 3.1.0
Transformers version: 4.46.2
The text was updated successfully, but these errors were encountered: