-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
add dist transpiler unit test #10485
Conversation
@@ -0,0 +1,74 @@ | |||
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. |
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.
The name is common.py
while it's not quite "common", see #9770 (comment) for details
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.
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) |
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.
transpile will be called twice, we need to let _transpiler_instance
call t.transpile
only once.
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.
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"]) | ||
|
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.
startup also need to be checked.
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.
done.
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.
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
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.
LGTM
Fixed #10375