forked from pytorch/torchrec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support global norm gradient clipping if DTensor is used (pytorch#2271)
Summary: Pull Request resolved: pytorch#2271 If DTensor is used in the parameters passed to gradient clipping, we compute the global norm across all ranks (instead per-rank local norm) to be clipped. This is needed according to a study in https://fb.workplace.com/chat/t/26249100244704391#:~:text=was%20really%20important%3A-,D59763695,-today%20in%20APS The existing test for gradient clipping is modified to test this new capability. Note: the global norm gradient clipping was original implemented by Andrew in D60625965. I combine it with the unit test here as single diff. Reviewed By: iamzainhuda Differential Revision: D60704597 fbshipit-source-id: 07a50ef04a9d950121cc828bedeb43d5493d6add
- Loading branch information
1 parent
0198312
commit d50d319
Showing
1 changed file
with
99 additions
and
25 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