-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Train] Make
prepare_model
always use the correct device (#29104)
Signed-off-by: Amog Kamsetty [email protected] Previously, prepare_model would use the local rank as the device even though local rank may not be the same as the actual device index. This mismatch can happen when CUDA_VISIBLE_DEVICES is set for example, which we do by default in Ray Train. We should always use train.torch.get_device() as the device values for wrapping in DDP. Closes #28996
- Loading branch information
Showing
2 changed files
with
28 additions
and
2 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