Skip to content

Fix the order while sorting the operators#16756

Merged
luotao1 merged 3 commits intoPaddlePaddle:developfrom
yihuaxu:develop_9bd44b94d_fix_graph_to_program_issue_ii
Apr 12, 2019
Merged

Fix the order while sorting the operators#16756
luotao1 merged 3 commits intoPaddlePaddle:developfrom
yihuaxu:develop_9bd44b94d_fix_graph_to_program_issue_ii

Conversation

@yihuaxu
Copy link
Contributor

@yihuaxu yihuaxu commented Apr 10, 2019

As ISSUE#16688 description, it was found the order's random will result in the difference when do the compare item of unit test. Now to use set to replace unordered_set can be resolve this issue.

resolve #16688
resolve #16316
resolve #16473
resolve #16586

@luotao1 luotao1 added the Intel label Apr 10, 2019
@yihuaxu
Copy link
Contributor Author

yihuaxu commented Apr 10, 2019

start a review

@luotao1 luotao1 requested a review from Superjomn April 11, 2019 02:37
@luotao1
Copy link
Contributor

luotao1 commented Apr 11, 2019

LGTM

namespace {
void SortHelper(
const std::map<ir::Node *, std::unordered_set<ir::Node *>> &adj_list,
const std::map<ir::Node *, std::vector<ir::Node *>, ir::NodeComp> &adj_list,
Copy link
Contributor

Choose a reason for hiding this comment

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

try just change unordered_set to std::set ?

the set is a binary search tree and should work like a sorted vector in this scenario.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, it should be OK. please wait CI's result.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just now all CI testing are passed. Please help us review it again.

Copy link
Contributor

@Superjomn Superjomn left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 93cedfd into PaddlePaddle:develop Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

3 participants