-
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] Entropy SPMD Rule #55394
[Semi Auto] Entropy SPMD Rule #55394
Conversation
… semi-auto/rule-base
…i-auto/embedding-rule
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
input_specs_size, | ||
2, | ||
phi::errors::InvalidArgument("The size of InputSpec of cross entropy " | ||
"with softmax should be 1, but got [%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.
"with softmax should be 1, but got [%d].", | |
"with softmax should be 2, but got [%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.
done
from paddle.distributed.fleet import auto | ||
|
||
|
||
class TestEmbeddingSPMDRule(unittest.TestCase): |
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.
CorssEntropy
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
REGISTER_SPMD_RULE(cross_entropy_with_softmax, CrossEntropyWithSoftmaxSPMDRule); | ||
REGISTER_SPMD_RULE(softmax_with_cross_entropy, CrossEntropyWithSoftmaxSPMDRule); |
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 two ops have same attrs?
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.
yes, here is to adopt for the difference between paddle static mode and dygraph mode, we will unify it in future.
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
* base rule * add sharidng merge * add sharidng axis merge * define unified data class for inferencing dist_attr * test wrap DistTensorSpec in dygraph mode * matmul main logic done * shape int64 * common cc * define unified data class for inferencing dist_attr * test wrap DistTensorSpec in dygraph mode * define python api and wrap function in static mode for DistTensorSpec * revise syntax * map bugfix * broadcast func * compile 1 * add unitest * add registry * update unitest * bugfix * bugfix * add pybind * bugfix * bugfix macro gloabl name space * bugfix macro gloabl name space * pybind * pybind test * pybind bugfixed1 * pybind bugfixed2 * pybind unitest * merge dev * merge dev * merge dev * fixed cmake conflict * fixed cmake conflict * rename get method * revise inferforward output type * revise comment * replicated rule * replicated rule 2 * revert bug deps * add rule * add unitest * add rule * add unitest * move ut of auto_parallel * fix ut * bugfix * bugfix * bugfix * bugfix * bugfix * bugfix * bugfix * resolute input sharding conflict maybe * fixed comment * add rule * add unitest * fixed typoes --------- Co-authored-by: Yichen Zhang <zhangyichen03@baidu.com> Co-authored-by: zhiqiu <chenqiuliang@baidu.com>
* base rule * add sharidng merge * add sharidng axis merge * define unified data class for inferencing dist_attr * test wrap DistTensorSpec in dygraph mode * matmul main logic done * shape int64 * common cc * define unified data class for inferencing dist_attr * test wrap DistTensorSpec in dygraph mode * define python api and wrap function in static mode for DistTensorSpec * revise syntax * map bugfix * broadcast func * compile 1 * add unitest * add registry * update unitest * bugfix * bugfix * add pybind * bugfix * bugfix macro gloabl name space * bugfix macro gloabl name space * pybind * pybind test * pybind bugfixed1 * pybind bugfixed2 * pybind unitest * merge dev * merge dev * merge dev * fixed cmake conflict * fixed cmake conflict * rename get method * revise inferforward output type * revise comment * replicated rule * replicated rule 2 * revert bug deps * add rule * add unitest * add rule * add unitest * move ut of auto_parallel * fix ut * bugfix * bugfix * bugfix * bugfix * bugfix * bugfix * bugfix * resolute input sharding conflict maybe * fixed comment * add rule * add unitest * fixed typoes --------- 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 entropy ops.
Support shard on broadcast axes and normalized axis.