Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[tests] Improve reliability of test_generator_distributed. #3603

Merged
merged 1 commit into from
Apr 21, 2021
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
8 changes: 3 additions & 5 deletions tests/test_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TestDistributed(unittest.TestCase):
learningrate=1e-2,
batchsize=BATCHSIZE,
validation_every_n_epochs=5,
num_epochs=100,
num_epochs=150,
n_layers=1,
n_heads=1,
ffn_size=32,
Expand Down Expand Up @@ -67,20 +67,18 @@ def _distributed_train_model(self, opt):

return (valid, test)

@testing_utils.retry()
def test_generator_distributed(self):
config = copy.deepcopy(self._base_config)
valid, test = self._distributed_train_model(config)

self.assertLessEqual(valid['ppl'], 1.50)
self.assertLessEqual(test['ppl'], 1.50)
self.assertLessEqual(valid['ppl'], 1.60)
self.assertLessEqual(test['ppl'], 1.60)

# Tests that DialogData.get() is doing the right thing
# Ensure no duplication of examples among workers
self.assertEqual(valid['exs'].value(), BATCHSIZE)
self.assertEqual(test['exs'].value(), BATCHSIZE)

@testing_utils.retry()
def test_multitask_distributed(self):
config = copy.deepcopy(self._base_config)
config['num_epochs'] = 50
Expand Down