@Lyken17 I think your code is passing the function (mod['main']) instead of the
module (mod) to `relay.optimize`, though the arguments will still be binded if
you use module
(https://github.com/apache/tvm/blob/main/python/tvm/relay/build_module.py#L188).
Using:
```python
import tvm
import tv
I think generally **device** is **hardware (primitives)**. **(codegen) target**
is **software** that drives the **deivice**.
examples of dev v.s. target:
- NVIDIA GPU ~ CUDA (=> NVPTX)
- AMD GPU ~ ROCm
- CPU ~ OPENCL/C/C++ (compiler)
- PhD students ~ advisors
But if you look at
https://tvm.ap
This is because `relay.build` optimizes the constants through constant folding.
That said, those constants you marked have been folded and simplified.
Actually, it is simplified in the `bind_params_by_name` function in
`relay.build`. And if you print the output module of that you see:
```
de
This case seems to occur when we apply the basic block form pass. Other passes,
e.g., `FuseOps` will not result in such results. So I am wondering if it is
expected to modify the input argument (old module) by some passes.
---
[Visit
Topic](https://discuss.tvm.apache.org/t/how-to-efficien
@junrushao1994 Thank you Junru! It did become faster!

Another related question is: will passes alter the original module (i mean if
`mod` will be modified after applying `new_mod = pass(mod)`). It seems this is
the case and I have to
Hi all, I wonder how to copy an IR in tvm:
What I tried:
1. `deepcopy`: not working. will produce error for some IR.
2. `astext` + `fromtext`: will work but kinda slow (2s for big models).
Thanks!
---
[Visit
Topic](https://discuss.tvm.apache.org/t/how-to-efficiently-copy-an-ir/10798/1)
Another thing is that I am still confused about the executors... There are
"graph", "debug" (interpreter), "vm", "aot" ...
Some executor cannot support dynamic shapes (i.e., graph). The default
optimization passes of them are not the same. I think any instructions on which
one should users p
Hi @yuchenj, thank you for your kind reply! I want to confirm some follow-up
questions and report some issues.
It seems in your mentioned line (`Optimize` function, `build_module.cc:303`), a
set of (default I think) passes are given. Is that the case: in `BuildRelay` we
will collect some **de