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

[Auto Parallel] Completion Dist Attribute for Backward & Update stage #36744

Conversation

JZ-LIANG
Copy link
Contributor

@JZ-LIANG JZ-LIANG commented Oct 26, 2021

PR types

Function optimization

PR changes

Others

Describe

Completion Dist Attribute for Backward & Update stage
Make sure all op and var have Dist Attribute

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Oct 26, 2021

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

output_var_attr = TensorDistributedAttribute(output_var,
dist_context)
output_var_attr.set_dims_mapping(ref_dims_mapping)
output_var_attr.set_process_mesh(ref_process_mesh)
Copy link
Contributor

Choose a reason for hiding this comment

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

the grad var process mesh should be the same with grad op instead of forward var?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, here is a bug and had been fixed

Copy link
Contributor

@aoyulong aoyulong left a comment

Choose a reason for hiding this comment

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

I have tested this for the new implementation and it works well for me now. In the future, we should give clear and reasonable rules to complete these distributed attributes for the backward and update tensors and ops.

# var
for output_name in grad_op.desc.output_names():
assert len(grad_op.desc.output(output_name)) in [0, 1]
# if grad_op.type == "cast":
Copy link
Contributor

Choose a reason for hiding this comment

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

没用可以干掉

@JZ-LIANG JZ-LIANG merged commit 5e9845b into PaddlePaddle:develop Oct 27, 2021
ghost pushed a commit to piotrekobi/Paddle that referenced this pull request Nov 3, 2021
…PaddlePaddle#36744)

* revise completion for backward

* revise completion for update

* revise completion for update

* update unitest
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.

4 participants