[s2s trainer] fix DP mode (#8823)

* fix DP case on multi-gpu

* make executable

* test all 3 modes

* use the correct check for distributed

* dp doesn't need a special case

* restore original name

* cleanup
This commit is contained in:
Stas Bekman
2020-11-30 12:55:56 -08:00
committed by GitHub
parent d8fc26e919
commit 7f34d75780
3 changed files with 35 additions and 9 deletions

View File

@@ -122,7 +122,8 @@ class Seq2SeqTrainer(Trainer):
else:
if self.args.sortish_sampler:
self.train_dataset.make_sortish_sampler(
self.args.per_device_train_batch_size, distributed=self.args.n_gpu > 1
self.args.per_device_train_batch_size,
distributed=(self.args.local_rank != -1),
)
return (