* Reduce the training iterations in test_fetch_unmerged and test_fuse_bn_act_pass. (#27234)

* Use the single GPU card to execute the test_fuse_bn_act_pass UT.
disable_ut_1
Zhen Wang 5 years ago committed by GitHub
parent ece74c4cd4
commit b671538623
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -559,7 +559,7 @@ endif()
set_tests_properties(test_parallel_executor_test_while_train test_parallel_executor_mnist
test_parallel_executor_feed_persistable_var
test_buffer_shared_memory_reuse_pass_and_fuse_optimization_op_pass
test_data_norm_op test_imperative_using_non_zero_gpu test_fuse_bn_act_pass
test_data_norm_op test_imperative_using_non_zero_gpu
test_dataloader_keep_order
test_dataloader_unkeep_order
test_parallel_executor_fetch_isolated_var

@ -28,7 +28,7 @@ class TestFetchUnmerged(unittest.TestCase):
conv_pool_1 = fluid.nets.simple_img_conv_pool(
input=img,
filter_size=5,
num_filters=20,
num_filters=8,
pool_size=2,
pool_stride=2,
pool_type='max',
@ -37,12 +37,12 @@ class TestFetchUnmerged(unittest.TestCase):
conv_pool_2 = fluid.nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
num_filters=50,
num_filters=16,
pool_size=2,
pool_stride=2,
pool_type='avg',
act="relu")
hidden = fluid.layers.fc(input=conv_pool_2, size=100, act='relu')
hidden = fluid.layers.fc(input=conv_pool_2, size=32, act='relu')
prediction = fluid.layers.fc(input=hidden, size=10, act='softmax')
loss = fluid.layers.cross_entropy(input=prediction, label=label)
avg_loss = fluid.layers.mean(loss)
@ -75,8 +75,8 @@ class TestFetchUnmerged(unittest.TestCase):
binary = fluid.CompiledProgram(main_program).with_data_parallel(
loss_name=loss.name, build_strategy=build_strategy)
iters = 3
batch_size = 64
iters = 2
batch_size = 16
train_reader = paddle.batch(
paddle.reader.shuffle(
paddle.dataset.mnist.train(), buf_size=500),

@ -25,7 +25,7 @@ class TestFuseBatchNormActPass(unittest.TestCase):
hidden1 = fluid.layers.conv2d(
input=x,
filter_size=3,
num_filters=32,
num_filters=16,
stride=1,
padding=1,
act=None,
@ -43,7 +43,7 @@ class TestFuseBatchNormActPass(unittest.TestCase):
bias_attr=bias_attr,
act='relu',
data_layout='NHWC')
hidden3 = fluid.layers.fc(input=hidden2, size=128, act='relu')
hidden3 = fluid.layers.fc(input=hidden2, size=32, act='relu')
hidden4 = fluid.layers.batch_norm(
input=hidden3, act='relu', data_layout='NHWC')
prediction = fluid.layers.fc(input=hidden4, size=10, act='softmax')
@ -63,7 +63,7 @@ class TestFuseBatchNormActPass(unittest.TestCase):
startup_program = fluid.Program()
x, y, loss = self.build_program(main_program, startup_program, use_cuda)
exe = fluid.Executor(place)
iters = 10
iters = 8
batch_size = 16
feeder = fluid.DataFeeder(feed_list=[x, y], place=place)

Loading…
Cancel
Save