Skip to content

Commit

Permalink
add cpu init check (NVIDIA#7889)
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Cui <[email protected]>
  • Loading branch information
cuichenx authored Nov 21, 2023
1 parent 28cae46 commit 23ef428
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def __init__(self, cfg: DictConfig, trainer: Trainer):

if self.megatron_amp_O2:

if not self.with_distributed_adam:
if not self.with_distributed_adam and not self.cfg.get("use_cpu_initialization", False):
# Pre-allocate the model on GPU to have master parameters allocated on the same device with matching data type
if isinstance(self.model, list):
for module in self.model:
Expand Down

0 comments on commit 23ef428

Please sign in to comment.