* In llvm, we have a combine pass to transform some operators to another 
operator , sush as mull + add --> mla/madd.
  so I make a simple demo to test it in tvm(tbe), and find it is not done in 
**tir passes** (common pass for tvm and tbe), does TVM have similar pass  to 
combine the operators? 

> PS:I don't want it is been done in graph as such operator may be the part of 
> some operator , which are not independent operator.

*  test: 
```
(py310) /data/zhongyunde/source/test/dsl # cat testMadd.py 
# import tvm
import te.lang.cce
from tbe import tvm
from tbe import dsl
from tbe.common.platform import set_current_compile_soc_info


set_current_compile_soc_info("Ascend310P3")

shape = (280000,280000)
dtype = "float16"

data = tvm.placeholder(shape, name="data", dtype=dtype)

with tvm.target.cce():
    const_val = tvm.const(-1, "float32")
    mul_val = te.lang.cce.vmuls(data, const_val)
    res = te.lang.cce.vadds(mul_val, const_val)
    sch = dsl.auto_schedule(res)
    print (res)
    print (sch)

config = { "name" : "abs_28_28_float16", "tensor_list" : [data,res]}

dsl.build(sch, config)
```





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/which-pass-is-expected-to-fused-or-combined-operator-in-tvm/18398/1)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/3cf4bcdf0c69b98ccbee5c8a0cff53604325dda2b3024a52a5c96daf1ed4267f).

Reply via email to