From 1b7f6ae9c5b0ad044427ba1ece067d96ba3519c8 Mon Sep 17 00:00:00 2001 From: baoachun <962571062@qq.com> Date: Mon, 20 Dec 2021 20:06:03 +0800 Subject: [PATCH] add gelu pbtxt for conv+gelu mkldnn fuse pass (#38162) --- .../inference/api/paddle_pass_builder.cc | 1 + paddle/fluid/operators/compat/gelu.pbtxt | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 paddle/fluid/operators/compat/gelu.pbtxt diff --git a/paddle/fluid/inference/api/paddle_pass_builder.cc b/paddle/fluid/inference/api/paddle_pass_builder.cc index 674b7cdd699..75b7a4ea155 100644 --- a/paddle/fluid/inference/api/paddle_pass_builder.cc +++ b/paddle/fluid/inference/api/paddle_pass_builder.cc @@ -253,6 +253,7 @@ void CpuPassStrategy::EnableMKLDNN() { "conv_swish_mkldnn_fuse_pass", // "conv_hard_swish_mkldnn_fuse_pass", // "conv_hard_sigmoid_mkldnn_fuse_pass", // + // TODO(baoachun) fix int8 accuracy "conv_gelu_mkldnn_fuse_pass", "scale_matmul_fuse_pass", // "reshape_transpose_matmul_mkldnn_fuse_pass", // diff --git a/paddle/fluid/operators/compat/gelu.pbtxt b/paddle/fluid/operators/compat/gelu.pbtxt new file mode 100644 index 00000000000..032063668ee --- /dev/null +++ b/paddle/fluid/operators/compat/gelu.pbtxt @@ -0,0 +1,28 @@ +type: "gelu" +def { + inputs { + name: "X" + } + outputs { + name: "Out" + } + attrs { + name: "approximate" + type: BOOLEAN + } +} +extra { + attrs { + name: "use_mkldnn" + type: BOOLEAN + } + attrs { + name: "mkldnn_data_type" + type: STRING + } + attrs { + name: "use_cudnn" + type: BOOLEAN + } +} + -- GitLab