-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[MPS] Fixes for LSTM. #94889
[MPS] Fixes for LSTM. #94889
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/94889
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 67edca8: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
- Backward pass has to give explicit bias tensor of zeros if none is passed to the op or the bias gradient will not be calculated. - Fixed bias tensor mistakenly getting overwritten to zeros - Fixes crash when lstm op called with has_biases set to false. Change takes into account the changed shape of the input params TensorList depending on the bias flag. - Raise error for projections in LSTM. Currently not supported.
fa2216a
to
3e10b86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
@pytorchbot merge -f "All tests are green." |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
- Backward pass has to give explicit bias tensor of zeros if none is passed to the op or the bias gradient will not be calculated. - Fixed bias tensor mistakenly getting overwritten to zeros - Fixes crash when lstm op called with has_biases set to false. Change takes into account the changed shape of the input params TensorList depending on the bias flag. Fixes #ISSUE_NUMBER Pull Request resolved: pytorch#94889 Approved by: https://github.com/DenisVieriu97
* [MPS] Fixes for LSTM. (#94889) - Backward pass has to give explicit bias tensor of zeros if none is passed to the op or the bias gradient will not be calculated. - Fixed bias tensor mistakenly getting overwritten to zeros - Fixes crash when lstm op called with has_biases set to false. Change takes into account the changed shape of the input params TensorList depending on the bias flag. Fixes #ISSUE_NUMBER Pull Request resolved: #94889 Approved by: https://github.com/DenisVieriu97 * [MPS] LogSoftmax numerical stability (#95091) Fixes #94043 Calculations are now consistent with numericaly stable formula and CPU: $LogSoftmax(X, \dim) = X - \max(X, \dim) - \log(sum(X - \max(X, \dim), \dim))$ @malfet Pull Request resolved: #95091 Approved by: https://github.com/malfet, https://github.com/kulinseth * [MPS] Cast int64 to int32 for reduction ops (#95231) - give warnings of converting int64 for reduction ops - use cast tensor for reduction sum on trace - unblock trace from running Pull Request resolved: #95231 Approved by: https://github.com/razarmehr * [MPS] Fix Float16 issue with Reduction ops for macOS 12 (#94952) This would fix the issue with `__rdiv__` with float16 Pull Request resolved: #94952 Approved by: https://github.com/kulinseth --------- Co-authored-by: alexdremov <dremov.me@gmail.com> Co-authored-by: Denis Vieriu <dvieriu@apple.com> Co-authored-by: Ramin Azarmehr <razarmehr@apple.com>
This reverts commit 54ebf25.
* [MPS] Fixes for LSTM. (pytorch#94889) - Backward pass has to give explicit bias tensor of zeros if none is passed to the op or the bias gradient will not be calculated. - Fixed bias tensor mistakenly getting overwritten to zeros - Fixes crash when lstm op called with has_biases set to false. Change takes into account the changed shape of the input params TensorList depending on the bias flag. Fixes #ISSUE_NUMBER Pull Request resolved: pytorch#94889 Approved by: https://github.com/DenisVieriu97 * [MPS] LogSoftmax numerical stability (pytorch#95091) Fixes pytorch#94043 Calculations are now consistent with numericaly stable formula and CPU: $LogSoftmax(X, \dim) = X - \max(X, \dim) - \log(sum(X - \max(X, \dim), \dim))$ @malfet Pull Request resolved: pytorch#95091 Approved by: https://github.com/malfet, https://github.com/kulinseth * [MPS] Cast int64 to int32 for reduction ops (pytorch#95231) - give warnings of converting int64 for reduction ops - use cast tensor for reduction sum on trace - unblock trace from running Pull Request resolved: pytorch#95231 Approved by: https://github.com/razarmehr * [MPS] Fix Float16 issue with Reduction ops for macOS 12 (pytorch#94952) This would fix the issue with `__rdiv__` with float16 Pull Request resolved: pytorch#94952 Approved by: https://github.com/kulinseth --------- Co-authored-by: alexdremov <dremov.me@gmail.com> Co-authored-by: Denis Vieriu <dvieriu@apple.com> Co-authored-by: Ramin Azarmehr <razarmehr@apple.com>
- Backward pass has to give explicit bias tensor of zeros if none is passed to the op or the bias gradient will not be calculated. - Fixed bias tensor mistakenly getting overwritten to zeros - Fixes crash when lstm op called with has_biases set to false. Change takes into account the changed shape of the input params TensorList depending on the bias flag. Fixes #ISSUE_NUMBER Pull Request resolved: pytorch#94889 Approved by: https://github.com/DenisVieriu97
Fixes #ISSUE_NUMBER