-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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] Softmax SPMD Rule #55196
[Semi Auto] Softmax SPMD Rule #55196
Conversation
… semi-auto/rule-base
你的PR提交成功,感谢你对开源项目的贡献! |
…i-auto/embedding-rule
weight_ndim, | ||
weight_dims_mapping.size(), | ||
phi::errors::InvalidArgument( | ||
"Mismatch of Y's tensor size: [%d] and Y's dims_mapping size [%d].", |
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.
Y -> w?
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.
fixed
// padding_idx s not supported by c_embedding kernl. | ||
// (TODO) might be could reshard as replicated when padding_idx != -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.
hard to understand
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 implement of c_embedding kernel require the padding item is in the of table, which means "padding_idx = -1" and not allow being set by user.
to support vocab parallel of embedding op efficiently, we need to use c_embedding kernel, therefore, we make a precondition check that "padding_idx = -1" when embedding table is sharded by vocab axis.
<< str_join(out_dims_mapping) << "], partial_on_dims: [" | ||
<< str_join(partial_on_dims) << "]"; | ||
|
||
return {{x_dist_attr_src, weight_dist_attr_src}, {output_dist_attr_dst}}; |
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.
infer inputs?
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.
done
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.
LGTM
* resolute input sharding conflict maybe * fixed comment --------- Co-authored-by: Yichen Zhang <zhangyichen03@baidu.com> Co-authored-by: zhiqiu <chenqiuliang@baidu.com>
* resolute input sharding conflict maybe * fixed comment --------- Co-authored-by: Yichen Zhang <zhangyichen03@baidu.com> Co-authored-by: zhiqiu <chenqiuliang@baidu.com>
PR types
Function optimization
PR changes
Others
Description
Pcard-70448
SPMD rule for softmax like ops (softmax, log_softmax).
sharding on normlized axis will be support in future.