Skip to content

Conversation

@sytrus-in-github
Copy link
Contributor

This fixes the numerical problem in log_softmax cpu code when inputs are big but their differences are small.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soumith is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ssnl
Copy link
Collaborator

ssnl commented Sep 20, 2018

@sytrus-in-github thanks for the PR! Want to add a test for this too? :)

zdevito pushed a commit to zdevito/ATen that referenced this pull request Sep 20, 2018
Summary:
This fixes the numerical problem in log_softmax cpu code when inputs are big but their differences are small.
Pull Request resolved: pytorch/pytorch#11866

Differential Revision: D9946799

Pulled By: soumith

fbshipit-source-id: 11fe8d92b91ef6b7a66f33fbce37ec2f0f0929be
@sytrus-in-github sytrus-in-github deleted the fix-logsoftmax-numerical branch September 20, 2018 08:42
@sytrus-in-github
Copy link
Contributor Author

@ssnl Good point! Unfortunately I won't have time to look into it for a couple of weeks. If someone else want to contribute in the mean time, feel free to do so :)

facebook-github-bot pushed a commit that referenced this pull request Jun 17, 2019
Summary:
#11866 has corrected this issue in function `host_softmax` (aten/src/ATen/native/SoftMax.cpp). But I tried the example proposed in #11752. `log_softmax` is still not working for big logits.

I have looked into the source code, found that example had called `vec_host_softmax_lastdim`, not `host_softmax`.

This code fixes the issue in `_vec_log_softmax_lastdim` and has a test for `log_softmax`.
Pull Request resolved: #21672

Differential Revision: D15856327

Pulled By: VitalyFedyunin

fbshipit-source-id: 7a1fd3c0a03d366c99eb873e235361e4fcfa7567
zdevito pushed a commit to zdevito/ATen that referenced this pull request Jun 17, 2019
Summary:
pytorch/pytorch#11866 has corrected this issue in function `host_softmax` (aten/src/ATen/native/SoftMax.cpp). But I tried the example proposed in pytorch/pytorch#11752. `log_softmax` is still not working for big logits.

I have looked into the source code, found that example had called `vec_host_softmax_lastdim`, not `host_softmax`.

This code fixes the issue in `_vec_log_softmax_lastdim` and has a test for `log_softmax`.
Pull Request resolved: pytorch/pytorch#21672

Differential Revision: D15856327

Pulled By: VitalyFedyunin

fbshipit-source-id: 7a1fd3c0a03d366c99eb873e235361e4fcfa7567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants