未验证 提交 7bbdbe5b 编写于 作者: S Sylwester Fraczek 提交者: GitHub

Some residualdata fixes (#48118)

Removed ResidualData and Bias from ExtraAttrProperties because it's not an attribute.
Removed bug with checking for ResidualData attribute in matmul_elementwise_add_fuse_pass
Removed residualData from list of matmul outputs in cpu_bfloat16_pass.cc because it's input
Co-authored-by: NTomasz Socha <tomasz.socha@intel.com>
上级 47875ba7
......@@ -199,10 +199,7 @@ class DeQuantizer final : public Quanter {
bool IsNotPermittedName(const std::string& output_name) const override {
std::unordered_map<std::string, std::vector<std::string>> block_list{
{"layer_norm",
{"Mean", "Variance"}}, // not used in inference in MKLDNN
{"matmul", {"ResidualData"}}, // artifical output, already dequantized
{"matmul_v2",
{"ResidualData"}}}; // artifical output, already dequantized
{"Mean", "Variance"}}}; // not used in inference in oneDNN
std::vector<std::string> blocked_outputs{"XShape"}; // blocklist for any op
auto op_name = op->Name();
......
......@@ -64,10 +64,6 @@ void MatmulElementwiseAddMKLDNNFusePass::FuseMatmulElementwiseAdd(
<< "op compat for matmul_elementwise_add_mkldnn_fuse_pass failed.";
return;
}
if (matmul->Op()->HasAttr("ResidualData")) {
LOG(WARNING) << "matmul_elementwise_add can be fused once";
return;
}
matmul->Op()->SetInput("ResidualData", {elementwise_addend->Name()});
matmul->Op()->SetOutput("Out", {elementwise_add_out->Name()});
......
......@@ -88,7 +88,6 @@ const std::unordered_map<std::string, ExtraAttrPropertySet>
{"use_cudnn", ExtraAttrProperty::SCHEDULE},
{"use_mkldnn", ExtraAttrProperty::SCHEDULE},
// ONEDNN dedicated attributes
{"Bias", ExtraAttrProperty::ONEDNN},
{"data_format", ExtraAttrProperty::ONEDNN},
{"force_fp32_output", ExtraAttrProperty::ONEDNN},
{"fuse_activation", ExtraAttrProperty::ONEDNN},
......@@ -108,7 +107,6 @@ const std::unordered_map<std::string, ExtraAttrPropertySet>
{"fused_transpose_X", ExtraAttrProperty::ONEDNN},
{"fused_transpose_Y", ExtraAttrProperty::ONEDNN},
{"mkldnn_data_type", ExtraAttrProperty::ONEDNN},
{"ResidualData", ExtraAttrProperty::ONEDNN},
{"scale_x", ExtraAttrProperty::ONEDNN},
{"scale_y", ExtraAttrProperty::ONEDNN},
{"scale_out", ExtraAttrProperty::ONEDNN},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册