-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix amp_bf16 train with staged_train_test (#2198)
Summary: This PR is to fix the issue of amp_bf16 train with staged_train_test in CPU. Need set `forward_contexts` correctly with `torch.cpu.amp.autocast(dtype=torch.bfloat16)`, otherwise, in staged_train_test, model cannot run into bf16 successfully. Pull Request resolved: #2198 Reviewed By: aaronenyeshi Differential Revision: D55428830 Pulled By: xuzhao9 fbshipit-source-id: 67d83d4c2948c571ef9416881170eee569c9f152
- Loading branch information
1 parent
697752c
commit 7cf8cb9
Showing
2 changed files
with
22 additions
and
5 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