-
Notifications
You must be signed in to change notification settings - Fork 23.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
ctc_loss: fix backward when 2d target tensor is larger than max_target_length #20971
Conversation
@pytorchbot rebase this please |
@pytorchbot merge this please |
The windows failure looks real. :/ |
I'm missing something, but how would gradcheck work for non-deterministic backwards? https://github.com/pytorch/pytorch/blob/master/torch/autograd/gradcheck.py#L288 |
So the test is flaky but not necessarily more flaky than before. Nonetheless fixing the flakiness after #20980 will be good. |
…20980) Summary: gradcheck currently includes a determinism check (although only trying twice and seeing if results match). This can lead to flaky tests, e.g. in #20971, but also #13818. This adds nondet_tol for both gradcheck and gradgradcheck. It does not change / reenable any tests yet. Pull Request resolved: #20980 Differential Revision: D15530129 Pulled By: soumith fbshipit-source-id: 04d7f85b5b59cd62867820c74b064ba14f4fa7f8
…h into ctc_backward_maxtargetlength
@pytorchbot rebase this please |
I think this is good to merge: The only change after approval is adding the |
@pytorchbot merge this please |
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.
@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
…t_length (#20971) Summary: Previously, we didn't work when 2d target tensors had extra columns at the end. Now we just ignore those. Also fix the confusion in the doc example regarding the number of classes. Thank you, ypw-rich for the report with reproducing example. Fixes: #20522 Pull Request resolved: pytorch/pytorch#20971 Differential Revision: D15535481 Pulled By: ezyang fbshipit-source-id: 397e44e20165fc4fa2547bee9390d4c0b688df93
Previously, we didn't work when 2d target tensors had extra columns at the end. Now we just ignore those.
Also fix the confusion in the doc example regarding the number of classes.
Thank you, @ypw-rich for the report with reproducing example.
Fixes: #20522