Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert workaround for T5 that sets number of workers to 0 & sync_batch_comm=False #5433

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ def training_step(self, batch, batch_idx):
tensor_shape=tensor_shape,
decoder_sequence_length=decoder_seq_length,
dtype=self.autocast_dtype,
sync_batch_comm=self.cfg.get('sync_batch_comm', False),
grad_scaler=self.trainer.precision_plugin.scaler if self.cfg.precision == 16 else None,
custom_sync_context_handler=custom_sync_context_handler,
)
Expand All @@ -349,6 +350,7 @@ def training_step(self, batch, batch_idx):
tensor_shape=tensor_shape,
decoder_sequence_length=decoder_seq_length,
dtype=self.autocast_dtype,
sync_batch_comm=self.cfg.get('sync_batch_comm', False),
grad_scaler=self.trainer.precision_plugin.scaler if self.cfg.precision == 16 else None,
custom_sync_context_handler=custom_sync_context_handler,
)
Expand Down Expand Up @@ -657,6 +659,7 @@ def validation_step_logits(self, batch, batch_idx):
tensor_shape=tensor_shape,
decoder_sequence_length=decoder_seq_length,
dtype=self.autocast_dtype,
sync_batch_comm=self.cfg.get('sync_batch_comm', False),
grad_scaler=self.trainer.precision_plugin.scaler if self.cfg.precision == 16 else None,
)
else:
Expand All @@ -668,6 +671,7 @@ def validation_step_logits(self, batch, batch_idx):
tensor_shape=tensor_shape,
decoder_sequence_length=decoder_seq_length,
dtype=self.autocast_dtype,
sync_batch_comm=self.cfg.get('sync_batch_comm', False),
grad_scaler=self.trainer.precision_plugin.scaler if self.cfg.precision == 16 else None,
)

Expand Down Expand Up @@ -700,6 +704,7 @@ def validation_step(self, batch, batch_idx):
tensor_shape=tensor_shape,
decoder_sequence_length=decoder_seq_length,
dtype=self.autocast_dtype,
sync_batch_comm=self.cfg.get('sync_batch_comm', False),
grad_scaler=self.trainer.precision_plugin.scaler if self.cfg.precision == 16 else None,
)
else:
Expand All @@ -711,6 +716,7 @@ def validation_step(self, batch, batch_idx):
tensor_shape=tensor_shape,
decoder_sequence_length=decoder_seq_length,
dtype=self.autocast_dtype,
sync_batch_comm=self.cfg.get('sync_batch_comm', False),
grad_scaler=self.trainer.precision_plugin.scaler if self.cfg.precision == 16 else None,
)

Expand Down Expand Up @@ -955,7 +961,7 @@ def setup_validation_data(self, cfg):
if hasattr(self, '_validation_ds'):
consumed_samples = 0
self._validation_dl = self.build_pretraining_data_loader(
self._validation_ds, consumed_samples, num_workers=0
self._validation_ds, consumed_samples, num_workers=self._cfg.data.num_workers
)

def setup_test_data(self, cfg):
Expand Down Expand Up @@ -1046,6 +1052,7 @@ def dummy():
tensor_shape=tensor_shape,
decoder_sequence_length=encoder_seq_length,
dtype=self.autocast_dtype,
sync_batch_comm=self.cfg.get('sync_batch_comm', False),
)
else:
output_tensor = forward_backward_no_pipelining(
Expand All @@ -1056,6 +1063,7 @@ def dummy():
tensor_shape=tensor_shape,
decoder_sequence_length=encoder_seq_length,
dtype=self.autocast_dtype,
sync_batch_comm=self.cfg.get('sync_batch_comm', False),
)

if output_tensor:
Expand Down