Skip to content

Commit

Permalink
Removes debug logging statements in Megatron NMT (#4312)
Browse files Browse the repository at this point in the history
* Temp

Signed-off-by: MaximumEntropy <sandeep.subramanian.1@umontreal.ca>

* Remove debug logging statements

Signed-off-by: MaximumEntropy <sandeep.subramanian.1@umontreal.ca>
  • Loading branch information
MaximumEntropy authored Jun 2, 2022
1 parent 28b97af commit c1ae0a7
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ def training_step(self, batch, batch_idx):

def eval_step(self, batch, batch_idx, dataloader_idx, data_cfg):
# Need to squeze dim 0 for tarred datasets since things are pre-batched and we ask the dataloader for batch size 1.
logging.info('Eval step ...')
batch = [[x.squeeze(dim=0) if x.ndim == 3 else x for x in microbatch] for microbatch in batch]
batch = self.process_global_batch_for_tarred_datasets(batch)
if data_cfg.dataset_type in ['tarred', 'text']:
Expand Down Expand Up @@ -241,11 +240,6 @@ def eval_step(self, batch, batch_idx, dataloader_idx, data_cfg):
outputs=tokens_enc, tokenizer=self.encoder_tokenizer, processor=source_processor,
)

logging.info(f'Inputs : {encoder_inputs}')
logging.info(f'Translations : {preds}')
logging.info(f'GTs : {labels}')
logging.info(f'Loss : {reduced_loss}')

return {
'inputs': encoder_inputs,
'translations': preds,
Expand Down Expand Up @@ -313,9 +307,7 @@ def test_epoch_end(self, outputs):
return self.eval_epoch_end(outputs, 'test')

def eval_epoch_end(self, outputs, mode):
logging.info('Eval epoch end ...')
if not outputs:
logging.info('No outputs ...')
return
if isinstance(outputs[0], dict):
outputs = [outputs]
Expand Down Expand Up @@ -389,7 +381,6 @@ def eval_epoch_end(self, outputs, mode):
else:
bleu_score = 0.0

logging.info(f'Epoch End BLEU : {bleu_score}')
loss_list.append(averaged_loss.cpu().numpy())
bleu_score_list.append(bleu_score)
if dataloader_idx == 0:
Expand Down

0 comments on commit c1ae0a7

Please sign in to comment.