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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion paddle/fluid/operators/batch_norm_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void BatchNormOp::InferShape(framework::InferShapeContext *ctx) const {
ctx->SetOutputDim("SavedMean", {C});
ctx->SetOutputDim("SavedVariance", {C});
ctx->ShareLoD("X", "Y");
if (ctx->HasInput("ReserveSpace")) {
if (ctx->HasOutput("ReserveSpace")) {
ctx->SetOutputDim("ReserveSpace", {-1});
}
}
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/distributed/auto_parallel/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,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:
ref_dims_mapping = (
fwd_op_dist_attr.get_input_dims_mapping(
input_name
Expand Down Expand Up @@ -1544,7 +1544,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.

已一起修改

ref_dims_mapping = (
fwd_op_dist_attr.get_input_dims_mapping(
input_name
Expand Down