|
|
|
@ -138,6 +138,13 @@ class TestMNIST(TestParallelExecutorBase):
|
|
|
|
|
"label": label},
|
|
|
|
|
use_cuda=use_cuda,
|
|
|
|
|
use_parallel_executor=False)
|
|
|
|
|
parallel_first_loss, parallel_last_loss = self.check_network_convergence(
|
|
|
|
|
method=simple_fc_net,
|
|
|
|
|
seed=1,
|
|
|
|
|
feed_dict={"image": img,
|
|
|
|
|
"label": label},
|
|
|
|
|
use_cuda=use_cuda,
|
|
|
|
|
use_parallel_executor=True)
|
|
|
|
|
|
|
|
|
|
self.assertAlmostEquals(
|
|
|
|
|
np.mean(parallel_first_loss),
|
|
|
|
@ -149,8 +156,6 @@ class TestMNIST(TestParallelExecutorBase):
|
|
|
|
|
def test_simple_fc_parallel_accuracy(self):
|
|
|
|
|
if core.is_compiled_with_cuda():
|
|
|
|
|
self.check_simple_fc_parallel_accuracy(True)
|
|
|
|
|
self.check_simple_fc_parallel_accuracy(True)
|
|
|
|
|
# FIXME(Yancey1989): ParallelGraph executor type support CPU mode
|
|
|
|
|
self.check_simple_fc_parallel_accuracy(False)
|
|
|
|
|
|
|
|
|
|
def check_batchnorm_fc_convergence(self, use_cuda, use_fast_executor):
|
|
|
|
@ -171,9 +176,6 @@ class TestMNIST(TestParallelExecutorBase):
|
|
|
|
|
for use_fast_executor in (False, True):
|
|
|
|
|
self.check_batchnorm_fc_convergence(use_cuda, use_fast_executor)
|
|
|
|
|
|
|
|
|
|
self.check_batchnorm_fc_convergence(
|
|
|
|
|
use_cuda=True, use_fast_executor=False)
|
|
|
|
|
|
|
|
|
|
def test_batchnorm_fc_with_new_strategy(self):
|
|
|
|
|
# FIXME(zcd): close this test temporally.
|
|
|
|
|
# self._compare_reduce_and_allreduce(fc_with_batchnorm, True)
|
|
|
|
|