Skip to content

Commit be9cb94

Browse files
authored
Remove has_structed_kerenl and has_fluid_kernel (#56779)
* remove has_structed_kerenl and has_fluid_kernel * add test_fused_layernorm_op to STATIC_BUILD_TESTS list * open static_build flag * remove distributed_fused_lamb_init from StaticBuildBlackList * use initialized replacing IsInitialized * recover codes * delete useless codes * close the flag
1 parent 201480d commit be9cb94

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

paddle/fluid/framework/new_executor/interpreter/static_build.cc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ std::set<std::string> StaticBuildBlackList = {
4747
"cinn_launch" /*: to handle subgraph infermeta*/,
4848
"run_program" /*: to handle scope output*/,
4949
"sparse_sparse_coo_tensor" /*: to handle sparse output*/,
50-
"shuffle_batch",
51-
"shuffle_batch_grad",
5250
"distributed_fused_lamb_init"};
5351

5452
namespace paddle {
@@ -60,8 +58,6 @@ bool BlockCanBeStaticBuilt(const framework::BlockDesc& block) {
6058
// is_operator_base = (kernelCode >> 6) & 1
6159
// is_custom_op = (kernelCode >> 5) & 1
6260
// use_mkldnn = (kernelCode >> 4) & 1
63-
// has_fluid_kernel = (kernelCode >> 3) & 1
64-
// has_structed_kernel = (kernelCode >> 2) & 1
6561
using KernelCode = int8_t;
6662
std::set<std::pair<std::string, KernelCode>> invalid_ops;
6763
for (auto& op : block.AllOps()) {
@@ -81,13 +77,11 @@ bool BlockCanBeStaticBuilt(const framework::BlockDesc& block) {
8177
use_mkldnn = attr.index() == 1 ? PADDLE_GET_CONST(int, attr)
8278
: PADDLE_GET_CONST(bool, attr);
8379
}
84-
bool has_fluid_kernel = OperatorWithKernel::AllOpKernels().count(op_type);
8580
bool has_structured_kernel =
8681
phi::KernelFactory::Instance().HasStructuredKernel(op_type);
8782

8883
KernelCode kernel_code = (in_black_list << 7) + (is_operator_base << 6) +
8984
(is_custom_op << 5) + (use_mkldnn << 4) +
90-
(has_fluid_kernel << 3) +
9185
(has_structured_kernel << 2);
9286
if (!OpsCanSkipedFakeAllocInStaticBuild.count(op_type)) {
9387
if (in_black_list ||
@@ -107,8 +101,7 @@ bool BlockCanBeStaticBuilt(const framework::BlockDesc& block) {
107101
<< ", is_operator_base = " << (item.second >> 6 & 1)
108102
<< ", is_custom_op = " << (item.second >> 5 & 1)
109103
<< ", use_mkldnn = " << (item.second >> 4 & 1)
110-
<< ", has_fluid_kernel = " << (item.second >> 3 & 1)
111-
<< ", has_structed_kerenl = " << (item.second >> 2 & 1) << "]\n";
104+
<< (item.second >> 2 & 1) << "]\n";
112105
}
113106
VLOG(1) << ss.str();
114107
}

test/legacy_test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,7 @@ set(STATIC_BUILD_TESTS
12901290
test_fuse_bn_act_pass
12911291
test_fused_feedforward_op
12921292
test_fused_feedforward_pass
1293+
test_fused_layernorm_op
12931294
test_imperative_optimizer
12941295
test_lamb_op
12951296
test_layer_norm_op

0 commit comments

Comments
 (0)