You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "Cody H. Yu via Apache TVM Discuss" <no...@discuss.tvm.ai> on 2021/08/13 18:39:06 UTC

[Apache TVM Discuss] [Questions] Create a `relay.Expr` from a `auto_scheduler.SearchTask`


This is impossible. The `tensors` you are referring to are already lowered from Relay to TE, so you cannot reverse them back to Relay.





---
[Visit Topic](https://discuss.tvm.apache.org/t/create-a-relay-expr-from-a-auto-scheduler-searchtask/10795/2) 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/8f6becbf32687f5eeb9253bb918d70b536fefd948868bdedc81319d0e6e7ca3d).

[Apache TVM Discuss] [Questions] Create a `relay.Expr` from a `auto_scheduler.SearchTask`

Posted by "Cody H. Yu via Apache TVM Discuss" <no...@discuss.tvm.ai>.

I'm not sure I understand your question. Relay expression and TE expression are at different levels. For example `T_dense` is a TE tensor compute, which corresponds to one Relay op (e.g., `nn.dense`). On the other hand, TE compute can also be a result of a sequence of Relay ops. For example `T_dense[ax0, ax1] + placeholder[ax1]` can be lowered from `nn.bias_add(nn.dense(x, w), b)`.

In short, automatically generate `nn.bias_add(nn.dense(x, w), b)` from `T_dense[ax0, ax1] + placeholder[ax1]` seems impossible to me. You probably can only do it manually.





---
[Visit Topic](https://discuss.tvm.apache.org/t/create-a-relay-expr-from-a-auto-scheduler-searchtask/10795/4) 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/c9adeb5c98ef8f8fc2ee0af16a25361331af9bb69b65150895d419e2b34f99b6).

[Apache TVM Discuss] [Questions] Create a `relay.Expr` from a `auto_scheduler.SearchTask`

Posted by Wheest via Apache TVM Discuss <no...@discuss.tvm.ai>.

Thanks for the reply @comaniac.

I don't need these _exact_ tensors, just to recreate them from the available properties (e.g. their shapes, expressions of how they are generated).  I'm wondering if it's possible to recreate them from scratch at the Relay level, just by reading the properties at the TE level.

E.g. for the placeholder tensors I store in `my_vars`, I make them from scratch, only copying the shape property from the lowered TE tensors to make new tensors at the Relay level.

Tthe final tensor, which is not a placeholder, is made from the expression `T_dense[ax0, ax1] + placeholder[ax1]`.  I am not looking to convert `tensors[-1].op` to an `tvm.relay.Expr`.  Instead, I am wondering if I can define a fresh expression that takes this information (e.g. the `body`, `axis`, etc) to make a new `tvm.relay.Expr`.





---
[Visit Topic](https://discuss.tvm.apache.org/t/create-a-relay-expr-from-a-auto-scheduler-searchtask/10795/3) 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/6c6224cb00ab02cb157bf7a94d949d90155ffc7ebf8eec93e476e856910830b7).