CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[Semi-Auto] Move and adapt elementwise rule to phi #57197
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
Conversation
…o semi-auto/default-rule
你的PR提交成功,感谢你对开源项目的贡献! |
00ac565
to
cd0b2aa
Compare
@@ -1,213 +0,0 @@ | |||
/* Copyright (c) 2023 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.
not rm, use git mv instead so that git maintain the update and commits from very beginning.
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.
git automatically modified it to "new" and "delete" when the files change a lot.
|
||
|
||
class TestElementwiseSPMDRule(unittest.TestCase): | ||
def setUp(self): | ||
self.rule = get_spmd_rule("add") | ||
self.unary_rule = core.get_phi_spmd_rule("relu") | ||
self.rule = core.get_phi_spmd_rule("add") |
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.
should add test for binary case.
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, the binary cases are already in unit tests. Now rename 'self.rule' to 'self.binary_rule' to make it clearer.
SpmdInfo ElementwiseBinaryInferSpmdReverse(const DistMetaTensor& x, | ||
const DistMetaTensor& y, | ||
const DistMetaTensor& out); | ||
|
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.
add rule for more 3 input case (sum, addn)
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.
Marked a TODO in rules.h
cd0b2aa
to
e93b129
Compare
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
* adapt general spmd rule * polish details * add new rules * bugfix --------- Co-authored-by: Chen Weihang <chenweihang@baidu.com> Co-authored-by: liangjianzhong <liangjianzhong@baidu.com>
* adapt general spmd rule * polish details * add new rules * bugfix --------- Co-authored-by: Chen Weihang <chenweihang@baidu.com> Co-authored-by: liangjianzhong <liangjianzhong@baidu.com>
PR types
Function optimization
PR changes
Others
Description
Pcard-70448
Adapt elementwise spmd rule to phi api: paddle/fluid/distributed/auto_parallel/spmd_rules/elementwise.* -> paddle/phi/infermeta/spmd_rules/elementwise.*
To adapt phi api, the elementwise is implemented with unary and binary version.