未验证 提交 ed2cfecf 编写于 作者: F Feng Xing 提交者: GitHub

flags to choose kp kernel (#38455)

This PR adds runtime flags run_kp_kernel, which choose which op to run for xpu2. There are two: dynamic linked and built from kp.
上级 3777779b
...@@ -56,6 +56,7 @@ DECLARE_bool(enable_unused_var_check); ...@@ -56,6 +56,7 @@ DECLARE_bool(enable_unused_var_check);
PADDLE_DEFINE_EXPORTED_int32(inner_op_parallelism, 0, PADDLE_DEFINE_EXPORTED_int32(inner_op_parallelism, 0,
"number of threads for inner op"); "number of threads for inner op");
DECLARE_bool(run_pten_kernel); DECLARE_bool(run_pten_kernel);
DECLARE_bool(run_kp_kernel);
namespace paddle { namespace paddle {
namespace framework { namespace framework {
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
DECLARE_bool(check_nan_inf); DECLARE_bool(check_nan_inf);
DECLARE_bool(run_pten_kernel); DECLARE_bool(run_pten_kernel);
DECLARE_bool(benchmark); DECLARE_bool(benchmark);
DECLARE_bool(run_kp_kernel);
namespace paddle { namespace paddle {
namespace imperative { namespace imperative {
......
...@@ -694,6 +694,18 @@ PADDLE_DEFINE_EXPORTED_bool( ...@@ -694,6 +694,18 @@ PADDLE_DEFINE_EXPORTED_bool(
PADDLE_DEFINE_EXPORTED_bool(run_pten_kernel, true, PADDLE_DEFINE_EXPORTED_bool(run_pten_kernel, true,
"It controls whether to use pten kernel"); "It controls whether to use pten kernel");
/**
* Pt kernel related FLAG
* Name: FLAGS_run_kp_kernel
* Since Version: 2.3.0
* Value Range: bool, default=false
* Example: FLAGS_run_kp_kernel=true would use the kp kernel to compute in
* the Op for XPU2.
* Note:
*/
PADDLE_DEFINE_EXPORTED_bool(run_kp_kernel, true,
"It controls whether to use kp kernel for xpu2");
/** /**
* Distributed related FLAG * Distributed related FLAG
* Name: FLAGS_allreduce_record_one_event * Name: FLAGS_allreduce_record_one_event
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册