-
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
[auto parallel] complete elementwise ops spmd rules of LLaMa2 for eager semi auto parallel #58474
Changes from all commits
9857325
8bf445a
b2196ae
809f4a5
1d8a01e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,10 @@ SpmdInfo ElementwiseUnaryInferSpmdReverse(const DistMetaTensor& x, | |
SpmdInfo ElementwiseUnaryGradInferSpmd(const DistMetaTensor& x, | ||
const DistMetaTensor& out_grad); | ||
|
||
SpmdInfo ElementwiseUnaryGradInferSpmd(const DistMetaTensor& x, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 重载是为了适配 api 么?是不是可以加些注释说明一下 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 适配不同API签名,比如一元逐元素运算,部分算子反向只依赖输入,部分依赖输入输出,sin_grad(const Tensor& x, const Tensor& out_grad, Tensor* x_grad), silu_grad(const Tensor& x, const Tensor& out, const Tensor& out_grad, Tensor* x_grad) |
||
const DistMetaTensor& out, | ||
const DistMetaTensor& out_grad); | ||
|
||
SpmdInfo ElementwiseBinaryInferSpmd(const DistMetaTensor& x, | ||
const DistMetaTensor& y); | ||
|
||
|
@@ -42,5 +46,11 @@ SpmdInfo ElementwiseBinaryGradInferSpmd(const DistMetaTensor& x, | |
const DistMetaTensor& out_grad, | ||
int64_t axis = -1); | ||
|
||
SpmdInfo ElementwiseBinaryGradInferSpmd(const DistMetaTensor& x, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 同上 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 新提交一个PR补充 |
||
const DistMetaTensor& y, | ||
const DistMetaTensor& out, | ||
const DistMetaTensor& out_grad, | ||
int64_t axis = -1); | ||
|
||
} // namespace distributed | ||
} // namespace phi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,5 +64,6 @@ PD_REGISTER_KERNEL(divide, | |
int16_t, | ||
int, | ||
int64_t, | ||
bool, | ||
complex64, | ||
complex128) {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -312,6 +312,7 @@ PD_REGISTER_KERNEL(divide, | |
int16_t, | ||
int, | ||
int64_t, | ||
bool, | ||
float16, | ||
bfloat16, | ||
complex64, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,5 +62,6 @@ PD_REGISTER_KERNEL(divide_raw, | |
double, | ||
int, | ||
int64_t, | ||
bool, | ||
complex64, | ||
complex128) {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,7 @@ PD_REGISTER_KERNEL(divide_raw, | |
int16_t, | ||
int, | ||
int64_t, | ||
bool, | ||
float16, | ||
bfloat16, | ||
complex64, | ||
|
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.
缺少单规则模块的单测,可以参考 test/auto_parallel/spmd_rules/test_elementwise_rule.py
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.
新提一个PR补充