Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
Browse files Browse the repository at this point in the history
… try_to_fix_conv_speed
  • Loading branch information
phlrain committed Apr 28, 2022
2 parents 4098916 + 7cb4953 commit b15a4be
Show file tree
Hide file tree
Showing 32 changed files with 884 additions and 477 deletions.
37 changes: 2 additions & 35 deletions paddle/fluid/framework/ir/graph_pattern_detector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2665,41 +2665,8 @@ PDNode *patterns::UnsupportedBfloat16::operator()() {
return op;
}

PDNode *patterns::LastBfloat16Ops::operator()() {
auto *op = pattern->NewNode(op_repr())->assert_is_op();
op->assert_more([&](Node *node) {
return node->Op()->GetAttrIfExists<std::string>("mkldnn_data_type") ==
"bfloat16";
});
auto *op_out = pattern->NewNode(op_out_repr())->AsOutput();
op->LinksTo({op_out});
return op_out;
}

PDNode *patterns::FirstBfloat16Ops::operator()() {
auto *op_in = pattern->NewNode(op_in_repr())->AsInput();

auto *op = pattern->NewNode(op_repr())->assert_is_op();
op->assert_more([&](Node *node) {
return node->Op()->GetAttrIfExists<std::string>("mkldnn_data_type") ==
"bfloat16";
});

op->LinksFrom({op_in});
return op;
}

PDNode *patterns::DuplicatedInputs::operator()() {
auto op = pattern->NewNode(op_repr())->assert_is_ops({"concat", "sum"});
op->assert_more([&](Node *node) {
return node->Op()->GetAttrIfExists<std::string>("mkldnn_data_type") ==
"bfloat16";
});
return op;
}

PDNode *patterns::DuplicatedOutputs::operator()() {
auto op = pattern->NewNode(op_repr())->assert_is_ops({"split"});
PDNode *patterns::Bloat16Ops::operator()() {
auto op = pattern->NewNode(op_repr())->assert_is_op();
op->assert_more([&](Node *node) {
return node->Op()->GetAttrIfExists<std::string>("mkldnn_data_type") ==
"bfloat16";
Expand Down
33 changes: 3 additions & 30 deletions paddle/fluid/framework/ir/graph_pattern_detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -1565,36 +1565,9 @@ struct UnsupportedBfloat16 : public PatternBase {
PATTERN_DECL_NODE(op);
};

struct LastBfloat16Ops : public PatternBase {
LastBfloat16Ops(PDPattern* pattern, const std::string& name_scope)
: PatternBase(pattern, name_scope, "last_bfloat16_ops") {}
PDNode* operator()();

PATTERN_DECL_NODE(op);
PATTERN_DECL_NODE(op_out);
};

struct FirstBfloat16Ops : public PatternBase {
FirstBfloat16Ops(PDPattern* pattern, const std::string& name_scope)
: PatternBase(pattern, name_scope, "first_bfloat16_ops") {}
PDNode* operator()();

PATTERN_DECL_NODE(op_in);
PATTERN_DECL_NODE(op);
};

struct DuplicatedInputs : public PatternBase {
DuplicatedInputs(PDPattern* pattern, const std::string& name_scope)
: PatternBase(pattern, name_scope, "many_inputs_op") {}

PDNode* operator()();

PATTERN_DECL_NODE(op);
};

struct DuplicatedOutputs : public PatternBase {
DuplicatedOutputs(PDPattern* pattern, const std::string& name_scope)
: PatternBase(pattern, name_scope, "many_outputs_op") {}
struct Bloat16Ops : public PatternBase {
Bloat16Ops(PDPattern* pattern, const std::string& name_scope)
: PatternBase(pattern, name_scope, "many_bfloat16_ops") {}

PDNode* operator()();

Expand Down
Loading

1 comment on commit b15a4be

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on b15a4be Apr 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #41891 Commit ID: b15a4be contains failed CI.

🔹 Failed: PR-CI-APPROVAL

Unknown Failed
Unknown Failed

🔹 Failed: PR-CI-ROCM-Compile

Unknown Failed
Unknown Failed

🔹 Failed: PR-CI-Coverage

Unknown Failed
Unknown Failed

🔹 Failed: PR-CI-Model-benchmark

Unknown Failed
Unknown Failed

Please sign in to comment.