-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Semi-Auto] Add reduction infer_backward rule #56504
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
Sorry to inform you that bdda6f2's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
bdda6f2
to
a2183fe
Compare
const paddle::framework::AttributeMap& attrs) override; | ||
|
||
private: | ||
std::string GetOutputNotation(int64_t input_ndim, |
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.
the class for rule will be remove and fw & bw will be independent functions.
so place this utils another place and as independent function
|
||
self.assertEqual(infered_input_dist_attrs[0].dims_mapping, [-1, -1]) | ||
self.assertEqual(infered_output_dist_attrs[0].dims_mapping, [-1]) | ||
|
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.
check the partial is false
self.assertEqual(infered_input_dist_attrs[0].dims_mapping, [-1, -1]) | ||
self.assertEqual(infered_output_dist_attrs[0].dims_mapping, [-1]) | ||
|
||
# reduce on dim 0, keep_dim = true |
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 a kind new case that output is partial on curtain dims, and how it influence input :
stage 1: input is not effect
stage2: input should be sharded on that dims
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.
Update in Next PR
PR types
Function optimization
PR changes
Others
Description
Pcard-70448
Add infer backward SPMD rule for reduction. It infers inputs' dims mappings as following:
For non-reduced axes, set their dims mappings equal to the outputs'. For the reduced axes, set them to -1.