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

[Zero-Dim] Make auto parallel judge dim more strict #47961

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

zhwesky2010
Copy link
Contributor

@zhwesky2010 zhwesky2010 commented Nov 14, 2022

PR types

Others

PR changes

OPs

Describe

修复模型报错。

使自动并行获取dim时的判断更严格,由于原本采用 if ref_dims_mapping 的方式,但当 dim=[](表示0D Tensor的shape)时,[]在python语法里会被当成False,与None等同。

因此使这里的判断更严格,区分[]与None的不同。

[]的shape在网络中打印出来如下(注:[]是Tensor.shape的一种正确形式,与None不同):

infoflow 2022-11-14 19-47-48

@paddle-bot
Copy link

paddle-bot bot commented Nov 14, 2022

你的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.

@paddle-bot
Copy link

paddle-bot bot commented Nov 14, 2022

✅ This PR's description meets the template requirements!
Please wait for other CI results.

@zhwesky2010 zhwesky2010 changed the title 0 d auto parallel [Zero-Dim] Fix auto parallel judge 0D bug Nov 14, 2022
@zhwesky2010 zhwesky2010 force-pushed the 0D_auto_parallel branch 2 times, most recently from 753e871 to 15fc86a Compare November 14, 2022 11:52
@zhwesky2010 zhwesky2010 changed the title [Zero-Dim] Fix auto parallel judge 0D bug [Zero-Dim] Make auto parallel judge dim more strict Nov 14, 2022
zhaoyinglia
zhaoyinglia previously approved these changes Nov 15, 2022
Copy link
Contributor

@zhaoyinglia zhaoyinglia left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1540,7 +1540,7 @@ def _get_op_by_id(ops, id):
input_var
).dims_mapping
else:
if fwd_op_dist_attr.get_input_dims_mapping(input_name):
if input_name in forward_op.input_arg_names:
Copy link
Contributor

Choose a reason for hiding this comment

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

L1242 have same condition with here, need to be modified together?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已一起修改

Copy link
Contributor

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 merged commit 626d7bc into PaddlePaddle:develop Nov 15, 2022
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

3 participants