acoustic-van-30942
06/08/2023, 3:47 PM@pytorch_parallel decorator. One thing I noticed is that Metaflow seems to be suppressing the logs from the training session so I don't actually know what the training progress is. Any advice? I have a reproducible example, if needed, as well.
Thanks in advance!victorious-lawyer-58417
06/08/2023, 3:48 PMacoustic-van-30942
06/08/2023, 3:53 PMvictorious-lawyer-58417
06/08/2023, 3:53 PMacoustic-van-30942
06/08/2023, 3:54 PMuser
06/08/2023, 4:17 PMwith tqdm_logging_redirect():
model.train(
train_df=self.train_df,
eval_df=self.val_df,
args=arguments
)
Do you know if tqdm_logging_redirect is writing logs to stdout? Or is it redirecting the logs to some log file?acoustic-van-30942
06/08/2023, 4:18 PMuser
06/08/2023, 4:43 PMacoustic-van-30942
06/08/2023, 4:44 PMacoustic-van-30942
06/08/2023, 4:46 PMcrooked-jordan-29960
06/08/2023, 8:46 PMacoustic-van-30942
06/08/2023, 8:47 PMcrooked-jordan-29960
06/08/2023, 8:55 PMacoustic-van-30942
06/08/2023, 8:56 PMsync_dist_group arg a try first.
Does this look correct?
def training_step(self, batch, batch_size):
""" training step """
input_ids = batch["source_text_input_ids"]
attention_mask = batch["source_text_attention_mask"]
labels = batch["labels"]
labels_attention_mask = batch["labels_attention_mask"]
loss, outputs = self(
input_ids=input_ids,
attention_mask=attention_mask,
decoder_attention_mask=labels_attention_mask,
labels=labels,
)
group = dist.init_process_group("nccl", rank=self.global_rank, world_size=self.world_size)
self.log(
"train_loss", loss, prog_bar=True, logger=True, on_epoch=True, on_step=True, sync_dist_group=group
)
return losscrooked-jordan-29960
06/08/2023, 8:58 PMacoustic-van-30942
06/08/2023, 9:01 PMINFO:torch.distributed.distributed_c10d:Waiting in store based barrier to initialize process group for rank: 2, key: store_based_barrier_key:1 (world_size=8, worker_count=6, timeout=0:30:00)
I have only ever been able to get up to 6 nodes, otherwise I'll end up waiting idefinitely for all the nodes to initializeacoustic-van-30942
06/08/2023, 9:50 PMsync_dist unfortunatelycrooked-jordan-29960
06/08/2023, 10:26 PM/data folder? I'd like to reproduce the issue before lobbing more suggestions at you and want to minimize moving parts.acoustic-van-30942
06/08/2023, 11:57 PMacoustic-van-30942
06/09/2023, 12:08 AMacoustic-van-30942
06/09/2023, 12:13 AMt5-small just to make sure everything is ok. The t5-small is only about 60M parameters. On 6 nodes (each node being a g5.4xlarge ), it took about 30 minutes using DDP. Conversely, it took 60 minutes using DeepSpeed. I'm not an expert, but I guess CPUOffload makes things slightly slower, although the docs also indicate that DeepSpeedCPUAdam is a faster optimizer?
In summary there are three issues:
1. The logs (progress bar especially) are being suppressed by either PyTorch Lightning Distributed Multi-Node or Metaflow, so it's impossible to track training progress
2. For DeepSpeed Strategy, choosing number of nodes greater than 6 results in a long wait for store based barrier to initialize process group...
3. DeepSpeed with CPU Offload takes 20 minutes longer than DDP on the same hardware, for the same model, and batch size.acoustic-van-30942
06/09/2023, 1:35 AM"NCCL_IB_DISABLE": "1" and then removing "NCCL_P2P_DISABLE": "1"acoustic-van-30942
06/12/2023, 4:36 PMcrooked-jordan-29960
06/12/2023, 5:16 PMacoustic-van-30942
06/12/2023, 5:29 PM