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

【Hackathon 6th Fundable Projects 3 No.149-152】fluid operator fused_elementwise_add #63996

Merged
merged 5 commits into from
May 10, 2024

Conversation

co63oc
Copy link
Contributor

@co63oc co63oc commented Apr 30, 2024

PR Category

Others

PR Types

Others

Description

迁移
fused_elementwise_add
fused_elementwise_div
fused_elementwise_mul
fused_elementwise_sub

Copy link

paddle-bot bot commented Apr 30, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Apr 30, 2024
Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

同样,op.cc和sig.cc不能删除。

@co63oc
Copy link
Contributor Author

co63oc commented May 6, 2024

paddle/fluid/operators/ops_signature/generated_sig.cc 生成sig信息
image

paddle/fluid/operators/generated_op2.cc OpMaker
image

wanghuancoder
wanghuancoder previously approved these changes May 7, 2024
Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 1230 to 1254
- op : fused_elementwise_add
args: (Tensor x, Tensor y, int axis = -1, str fuse_activation = "", float fuse_alpha
= 0.0f, float fuse_beta = 0.0f, float fused_output_scale = 1.0f, int[] fused_unsqueeze2_axes
= {}, float scale_x = 1.0f, float scale_y = 1.0f, float scale_out = 1.0f)
output: Tensor (out)
infer_meta:
func: ElementwiseInferMeta
param : [x, y]
kernel :
func : fused_elementwise_add
data_type : x

- op : fused_elementwise_div
args: (Tensor x, Tensor y, int axis = -1, str fuse_activation = "", float fuse_alpha
= 0.0f, float fuse_beta = 0.0f, float fused_output_scale = 1.0f, int[] fused_unsqueeze2_axes
= {}, float scale_x = 1.0f, float scale_y = 1.0f, float scale_out = 1.0f)
output: Tensor (out)
infer_meta:
func: ElementwiseInferMeta
param : [x, y]
kernel :
func : fused_elementwise_div
data_type : x

- op : fused_elementwise_mul
Copy link
Contributor

Choose a reason for hiding this comment

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

这些fuse类算子放到fused_ops.yaml中

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

@@ -0,0 +1,153 @@
// Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

2023 -> 2024

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

Comment on lines +22 to +25
#include "paddle/phi/kernels/legacy/elementwise_add_kernel.h"
#include "paddle/phi/kernels/legacy/elementwise_divide_kernel.h"
#include "paddle/phi/kernels/legacy/elementwise_multipy_kernel.h"
#include "paddle/phi/kernels/legacy/elementwise_subtract_kernel.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

这几个头文件引用是否可以去掉?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

需要调用这几个头文件中的RawKernel

// See the License for the specific language governing permissions and
// limitations under the License.

#include "paddle/phi/api/ext/dispatch.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

这个头文件可以删掉吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

@luotao1 luotao1 merged commit 7fbd868 into PaddlePaddle:develop May 10, 2024
31 checks passed
co63oc added a commit to co63oc/Paddle that referenced this pull request May 11, 2024
@co63oc co63oc deleted the fix_ele_add branch May 11, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants