Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dist transpiler unit test #10485

Merged
merged 7 commits into from
May 15, 2018

Conversation

Yancey1989
Copy link
Contributor

Fixed #10375

@@ -0,0 +1,74 @@
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

The name is common.py while it's not quite "common", see #9770 (comment) for details

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! common.py is only used by distribute_transpiler, so I delete it and reuse it for future.

return self._transpiler_instance().get_trainer_program()

def get_pserver(self, ep):
return self._transpiler_instance().get_pserver_program(ep)
Copy link
Contributor

Choose a reason for hiding this comment

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

transpile will be called twice, we need to let _transpiler_instance call t.transpile only once.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

May not, after call get_trainer_program(), the program which inside transpiler would be changed.

# block2: optimize pass
self.assertEqual([op.type for op in pserver.blocks[2].ops],
["sum", "scale", "sgd"])

Copy link
Contributor

Choose a reason for hiding this comment

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

startup also need to be checked.

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

These asserts only test that the op type is equal, I think that you man assume that the op's inputs and outputs are verified when creating the program which will run InferShape

Copy link
Contributor

@typhoonzero typhoonzero left a comment

Choose a reason for hiding this comment

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

LGTM

@Yancey1989 Yancey1989 merged commit 0acc93c into PaddlePaddle:develop May 15, 2018
@Yancey1989 Yancey1989 deleted the dist_tranpsiler_unit_test branch May 15, 2018 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants