Skip to content
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

Division by zero when total_n_ignore = 0 #177

Closed
44670 opened this issue Aug 30, 2024 · 2 comments
Closed

Division by zero when total_n_ignore = 0 #177

44670 opened this issue Aug 30, 2024 · 2 comments
Assignees
Labels
bug Something isn't working p0

Comments

@44670
Copy link

44670 commented Aug 30, 2024

🐛 Describe the bug

When the input sample does not contain non-ignore labels, a division-by-zero error will be raised.

[rank1]: File "/data/conda3/lib/python3.11/site-packages/liger_kernel/ops/fused_linear_cross_entropy.py", line 114, in forward
[rank1]: n_non_ignore / total_n_non_ignore
[rank1]: ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
[rank1]: ZeroDivisionError: division by zero

Reproduce

No response

Versions

latest

@ByronHsu
Copy link
Collaborator

cc @shivam15s can fix this in the refactoring change

@ByronHsu
Copy link
Collaborator

The issue is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p0
Projects
None yet
Development

No branches or pull requests

4 participants