Skip to content

Conversation

@pkuzyc
Copy link
Contributor

@pkuzyc pkuzyc commented Sep 11, 2023

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.

@paddle-bot
Copy link

paddle-bot bot commented Sep 11, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@pkuzyc pkuzyc force-pushed the adapt_phi/elementwise branch from 00ac565 to cd0b2aa Compare September 18, 2023 03:46
@@ -1,213 +0,0 @@
/* Copyright (c) 2023 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.

not rm, use git mv instead so that git maintain the update and commits from very beginning.

Copy link
Contributor Author

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.

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")
Copy link
Contributor

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.

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, 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);

Copy link
Contributor

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)

Copy link
Contributor Author

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

@pkuzyc pkuzyc force-pushed the adapt_phi/elementwise branch from cd0b2aa to e93b129 Compare September 18, 2023 08:46
Copy link
Contributor

@JZ-LIANG JZ-LIANG left a comment

Choose a reason for hiding this comment

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

LGTM

@JZ-LIANG JZ-LIANG merged commit a98e997 into PaddlePaddle:develop Sep 20, 2023
Frida-a pushed a commit to Frida-a/Paddle that referenced this pull request Oct 14, 2023
* 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>
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
* 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>
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.

3 participants