-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore non-existent grad tensors for semi-sync (#2490)
Summary: Pull Request resolved: #2490 During semi-sync, we need to ignore embedding tensor grads that are `None`, otherwise `torch.autograd.backward` will fail with error `grad can be implicitly created only for scalar outputs`. This is a valid scenario if, for example, the embeddings are looked up but never used for the final loss computation Reviewed By: che-sh Differential Revision: D63379382 fbshipit-source-id: 62d5b6153d6aab339ef774f3a319630b7a2cfe98
- Loading branch information
1 parent
1d8824b
commit dbca437
Showing
2 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters