Skip to content

Commit 2c4143a

Browse files
committed
Only call batch_iterator_func.__exit__() if defined in conf.yaml
Another bug introduced in PPPLDeepLearning#39 merging "jdev" branch. Originally, MPIModel class member "batch_iterator_func" was unconditionally set to ProcessGenerator(self.batch_iterator()). Now, may only be set to self.batch_iterator() if conf['training']['use_process_generator'] == False
1 parent 5dd58c8 commit 2c4143a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

examples/slurm.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Each node = 2.4 GHz Xeon Broadwell E5-2680 v4 + 4x 1328 MHz P100 GPU
1212

1313
module load anaconda3
14-
conda activate my_env
14+
conda activate frnn-tf13.1
1515
module load cudatoolkit
1616
module load cudnn
1717
module load openmpi/cuda-8.0/intel-17.0/3.0.0/64

plasma/models/mpi_runner.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ def set_batch_iterator_func(self):
217217
self.batch_iterator_func = self.batch_iterator()
218218

219219
def close(self):
220-
self.batch_iterator_func.__exit__()
220+
if (self.conf is not None
221+
and 'use_process_generator' in conf['training']
222+
and conf['training']['use_process_generator']):
223+
self.batch_iterator_func.__exit__()
221224

222225
def set_lr(self, lr):
223226
self.lr = lr
@@ -918,6 +921,7 @@ def mpi_train(conf, shot_list_train, shot_list_validate, loader,
918921

919922

920923
def get_stop_training(callbacks):
924+
# TODO(KGF): this funciton is unused
921925
for cb in callbacks.callbacks:
922926
if isinstance(cb, cbks.EarlyStopping):
923927
print("Checking for early stopping")

0 commit comments

Comments
 (0)