Skip to content

Commit

Permalink
【Hackathon 6th Fundable Projects 3 No.149-152】fluid operator fused_el…
Browse files Browse the repository at this point in the history
…ementwise_add (#63996)

* Fix

* Fix

* Fix

* Fix

* Fix
  • Loading branch information
co63oc authored May 10, 2024
1 parent cd7f35d commit 7fbd868
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 187 deletions.
95 changes: 0 additions & 95 deletions paddle/fluid/operators/fused/fused_elementwise_op.cc

This file was deleted.

92 changes: 0 additions & 92 deletions paddle/fluid/operators/ops_signature/fused_elementwise_sig.cc

This file was deleted.

4 changes: 4 additions & 0 deletions paddle/fluid/pir/dialect/op_generator/ops_api_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@
'fused_token_prune',
'fused_dconv_drelu_dbn',
'fused_dot_product_attention',
'fused_elementwise_add',
'fused_elementwise_div',
'fused_elementwise_mul',
'fused_elementwise_sub',
'nce',
'lars_momentum',
'lars_momentum_',
Expand Down
52 changes: 52 additions & 0 deletions paddle/phi/api/yaml/fused_ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,58 @@
backward : fused_dropout_add_grad
support_dygraph_mode : true

- 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
support_dygraph_mode : true

- 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
support_dygraph_mode : true

- op : fused_elementwise_mul
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_mul
data_type : x
support_dygraph_mode : true

- op : fused_elementwise_sub
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_sub
data_type : x
support_dygraph_mode : true

- op : fused_embedding_eltwise_layernorm
args : (Tensor[] ids, Tensor[] embs, Tensor bias, Tensor scale, float epsilon = 0.00001f)
output : Tensor(out)
Expand Down
Loading

0 comments on commit 7fbd868

Please sign in to comment.