Skip to content

Commit

Permalink
add persistent workers (#6205) (#6211)
Browse files Browse the repository at this point in the history
Signed-off-by: ericharper <[email protected]>
Co-authored-by: Eric Harper <[email protected]>
  • Loading branch information
github-actions[bot] and ericharper committed Mar 16, 2023
1 parent c3a9d63 commit 296bce1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@ def build_pretraining_data_loader(
raise ValueError('cfg.data.dataloader_type not found. Must be "single" or "cyclic"')

return torch.utils.data.DataLoader(
dataset, batch_sampler=batch_sampler, num_workers=self.cfg.data.num_workers, pin_memory=True,
dataset,
batch_sampler=batch_sampler,
num_workers=self.cfg.data.num_workers,
pin_memory=True,
persistent_workers=True,
)

def setup(self, stage=None):
Expand Down
2 changes: 1 addition & 1 deletion nemo/collections/nlp/modules/common/megatron/clip_grads.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import itertools

import torch
from torch._six import inf
from torch import inf

from nemo.collections.nlp.modules.common.megatron.module import param_is_not_shared

Expand Down

0 comments on commit 296bce1

Please sign in to comment.