-
Notifications
You must be signed in to change notification settings - Fork 114
upgrade op fusion lowering #1216
base: develop
Are you sure you want to change the base?
Changes from 26 commits
f31bea4
d7256cd
571924e
a227edf
c7618dd
5a8189a
080b3f5
d2f4614
0321a63
2a88930
9d6c2a8
73060e1
62373b0
644f922
82d8636
39a1938
5a2ddfc
fdb6048
dfffca8
09e5d3d
29e02a5
a386985
da38edb
881cba9
e6eba07
dc47c61
4372080
c408bc5
ab14a30
18f90a2
2d7d86a
bf7dfb1
7fa2a99
513cdb8
511e3a4
0c39822
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2016,6 +2016,7 @@ Expr CasSimplifyMutator::SimplifyFracOp(Expr expr) { | |
}; | ||
|
||
{ | ||
/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 冗余代码应该删除而非注释,而且注释应该统一用 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
std::vector<Expr> a_args, b_args; | ||
if (ap) | ||
a_args = ap->operands(); | ||
|
@@ -2027,6 +2028,7 @@ Expr CasSimplifyMutator::SimplifyFracOp(Expr expr) { | |
b_args.push_back(b); | ||
|
||
return reduce_product_div_product(a_args, b_args); | ||
*/ | ||
} | ||
|
||
// x / x | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -362,7 +362,7 @@ TEST(CAS, SimplifyMinMax) { | |
LOG(INFO) << "p0 " << p0; | ||
auto p2 = CasSimplify(p0); | ||
LOG(INFO) << "simplified " << p2; | ||
EXPECT_EQ(GetStreamCnt(p2), "cinn_min(7, ((x) / (2)))"); | ||
// EXPECT_EQ(GetStreamCnt(p2), "cinn_min(7, ((x) / (2)))"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这是单测过不了了么?还是改之后结果是对的,但不是这样了?如果是前者那不能简单的注释掉啊,如果是后者那把这改为正确的值不就行了么 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
} | ||
{ // -(cinn_min(16, 3400-x-1)-1)/2 + x | ||
Var x = ir::_Var_::Make("x", Int(32)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,14 @@ class Graph : public cinn::common::Graph { | |
} | ||
} | ||
|
||
std::unordered_set<Node*> NodeSet() { | ||
std::unordered_set<Node*> node_set; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这函数功能完全和
不好么。。。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 用的地方比较多 这里实现比较方便 |
||
for (auto node : CollectNodes()) { | ||
node_set.insert(node); | ||
} | ||
return node_set; | ||
} | ||
|
||
std::unordered_set<NodeData*> GetInputNodeDatas(); | ||
std::unordered_set<NodeData*> GetOutputNodeDatas(); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SourceCodePrint
就会打印这个源码,而且可以保证一个程序会将所有子图打印出来There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的