提交 87b4eb1d 编写于 作者: Q Qiao Longfei

change min_param_size_to_use_multithread to min_row_size_to_use_multithread

上级 17b1b660
......@@ -30,7 +30,7 @@ DEFINE_bool(check_nan_inf, false,
"Checking whether operator produce NAN/INF or not. It will be "
"extremely slow so please use this flag wisely.");
DEFINE_int32(inner_op_parallelism, 0, "number of threads for inner op");
DEFINE_int32(min_param_size_to_use_multithread, 0, "");
DEFINE_int32(min_row_size_to_use_multithread, 0, "");
namespace paddle {
namespace framework {
......
......@@ -35,7 +35,7 @@ limitations under the License. */
#include "paddle/fluid/platform/variant.h"
DECLARE_int32(inner_op_parallelism);
DECLARE_int32(min_param_size_to_use_multithread);
DECLARE_int32(min_row_size_to_use_multithread);
namespace paddle {
namespace framework {
......
......@@ -478,12 +478,12 @@ class AdamOpKernel : public framework::OpKernel<T> {
}
}
} else if (FLAGS_inner_op_parallelism > 1 &&
FLAGS_min_param_size_to_use_multithread > 0 &&
param.numel() > FLAGS_min_param_size_to_use_multithread) {
FLAGS_min_row_size_to_use_multithread > 0 &&
param.dims()[0] > FLAGS_min_row_size_to_use_multithread) {
VLOG(3) << "use multi thread, inner_op_parallelism="
<< FLAGS_inner_op_parallelism
<< " min_param_size_to_use_multithread="
<< FLAGS_min_param_size_to_use_multithread;
<< " min_row_size_to_use_multithread="
<< FLAGS_min_row_size_to_use_multithread;
if (FLAGS_inner_op_parallelism > 10) {
LOG(WARNING) << "FLAGS_inner_op_parallelism "
<< FLAGS_inner_op_parallelism << " is two large!";
......
......@@ -129,7 +129,7 @@ def __bootstrap__():
'eager_delete_tensor_gb', 'fast_eager_deletion_mode',
'allocator_strategy', 'reader_queue_speed_test_mode',
'print_sub_graph_dir', 'pe_profile_fname', 'warpctc_dir',
'inner_op_parallelism', 'min_param_size_to_use_multithread',
'inner_op_parallelism', 'min_row_size_to_use_multithread',
'enable_parallel_graph'
]
if 'Darwin' not in sysstr:
......
......@@ -87,7 +87,7 @@ list(REMOVE_ITEM TEST_OPS test_nearest_interp_op)
foreach(TEST_OP ${TEST_OPS})
py_test_modules(${TEST_OP} MODULES ${TEST_OP})
endforeach(TEST_OP)
py_test_modules(test_adam_op_multi_thread MODULES test_adam_op ENVS FLAGS_inner_op_parallelism=4 FLAGS_min_param_size_to_use_multithread=2)
py_test_modules(test_adam_op_multi_thread MODULES test_adam_op ENVS FLAGS_inner_op_parallelism=4 FLAGS_min_row_size_to_use_multithread=2)
py_test_modules(test_warpctc_op MODULES test_warpctc_op ENVS FLAGS_warpctc_dir=${WARPCTC_LIB_DIR} SERIAL)
py_test_modules(test_bilinear_interp_op MODULES test_bilinear_interp_op SERIAL)
py_test_modules(test_nearest_interp_op MODULES test_nearest_interp_op SERIAL)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册