Skip to content

Commit

Permalink
[NewIR]new ir support op fusion and fusion merge pass (PaddlePaddle#5…
Browse files Browse the repository at this point in the history
…6111)

* update

* update

* update

* remove cerr

* update

* fix compile error

* polish code

* fix compile bug

* move op fusion to cinn folder

* update

* using cinn dialect op

* [NewIR]Refine CINN Dilact directory

* fix conflict

* fix deps

* update

* fix unittest deps

* fix header bug

* update

* fix proto dtype depency bug

* remove useless op

* Fix CI conflict

* Also remove included header

* Final Fix try

* update

* fix bug

* update

* update

* update

* fix compile bug

* fix op input bug

* add Get attr interface

* remove usless code

---------

Co-authored-by: Aurelius84 <zhangliujie@baidu.com>
Co-authored-by: zhhsplendid <zhhsplendid@163.com>
  • Loading branch information
3 people authored Oct 16, 2023
1 parent 7600e43 commit f6494ab
Show file tree
Hide file tree
Showing 22 changed files with 5,238 additions and 48 deletions.
1 change: 1 addition & 0 deletions paddle/cinn/hlir/dialect/operator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
add_subdirectory(ir)
add_subdirectory(transforms)
27 changes: 22 additions & 5 deletions paddle/cinn/hlir/dialect/operator/ir/ops.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
- op : add
args : (Tensor x, Tensor y)
- op : broadcast
args : (Tensor x, int64_t[] broadcast_axes, int64_t[] out_shape)
output : Tensor(out)
infer_meta :
func : ElementwiseInferMeta
func : CINNBroadcastInferMeta
param : [x, broadcast_axes, out_shape]
kernel :
func : add
inplace : (x -> out)
func : expand
param : [x, broadcast_axes]

- op : reduce_max
args : (Tensor x, int64_t[] axis, bool keep_dim)
output : Tensor(out)
infer_meta :
func : ReduceInferMeta
kernel :
func : frobenius_norm

- op : reduce_sum
args : (Tensor x, int64_t[] axis, bool keep_dim)
output : Tensor(out)
infer_meta :
func : ReduceInferMeta
kernel :
func : frobenius_norm
10 changes: 10 additions & 0 deletions paddle/cinn/hlir/dialect/operator/transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if(NOT CINN_ONLY)
cinn_cc_library(
op_with_group_merge_pass
SRCS
group_with_group_merge_pass.cc
op_with_group_merge_pass.cc
tensor_node.cc
DEPS
pd_op_dialect)
endif()
Loading

0 comments on commit f6494ab

Please sign in to comment.