Skip to content

Commit

Permalink
Apply isort and black reformatting
Browse files Browse the repository at this point in the history
Signed-off-by: guyueh1 <[email protected]>
  • Loading branch information
guyueh1 committed Jan 23, 2025
1 parent 441036c commit b18ac96
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nemo/lightning/pytorch/callbacks/megatron_comm_overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,13 @@ def _override_user_cfgs(self, comm_overlap_cfg):
setattr(comm_overlap_cfg, field.name, user_value)

return comm_overlap_cfg

def _set_num_cuda_device_max_connections(self):
import os

import torch

from nemo.utils import AppState
import os, torch

app_state = AppState()
tp_size = app_state.tensor_model_parallel_size
Expand Down Expand Up @@ -259,7 +262,7 @@ def setup(self, trainer: pl.Trainer, pl_module: pl.LightningModule, stage: str)
self._apply_cfgs(comm_overlap_cfg, trainer.strategy.ddp_config)
if hasattr(trainer.model, '__io__'):
self._apply_cfgs(comm_overlap_cfg, trainer.model.__io__.optim.config)

# setup cuda device max connections
self._set_num_cuda_device_max_connections()

Expand Down

0 comments on commit b18ac96

Please sign in to comment.