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

Bug: Fix overflow with Softmax - Logsoftmax #389

Merged
merged 33 commits into from
Oct 23, 2023
Merged

Conversation

raphaelDkhn
Copy link
Collaborator

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

With some neural networks, exp in (log)softmax operator create u32 overflow.

What is the new behavior?

for FP8x23 and FP16x16 tensors (log)softmax uses wide operations. It means that exp output type is upcasted, and div downcasted back.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@raphaelDkhn raphaelDkhn merged commit 89d637c into develop Oct 23, 2023
2 checks passed
@raphaelDkhn raphaelDkhn deleted the fix-overflow branch October 23, 2023 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant