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 Aleks Knezevic via Apache TVM Discuss <no...@discuss.tvm.ai> on 2022/03/14 16:21:38 UTC

[Apache TVM Discuss] [Questions] Hierarchy in TVM


Hey all, 

I've been working with the TVM stack lately, and love it! 

Does the TVM stack support a concept of hierarchy? That is, when compiling a model with repeating operations (i.e. BERT) is there any way to extract the fact that there are 12 identical layers, and which operators belong to those layers?

Thanks!
Aleks





---
[Visit Topic](https://discuss.tvm.apache.org/t/hierarchy-in-tvm/12306/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/227b22ac6daa6e07d04c624dfb580edf933adc96c7b40cd46b4576d7d974745b).

[Apache TVM Discuss] [Questions] Hierarchy in TVM

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

Is it possibile to extend tf/pytorch to keep this information?





---
[Visit Topic](https://discuss.tvm.apache.org/t/hierarchy-in-tvm/12306/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/816e7f30b5bfcbcdce8d2f94a8fb7203047543414b461f879f6e399ad7411d76).

[Apache TVM Discuss] [Questions] Hierarchy in TVM

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

This is an interesting question and I'm looking into this recently too.

It depends on how the model was implemented. If the model was implemented in other frameworks (e.g., TensorFlow, PyTorch, etc), then there's no way for TVM to keep this information, because this hierarchy doesn't a part of the IR graph but just a nested Python class instance.

If the model was implemented in Relay, then it's possible to do so by implementing multiple Relay functions. However, I'm not 100% for sure if that would work because some Relay passes may not deal with multiple functions well. More importantly, it may hurt the final end-to-end performance due to unnecessary IR boundaries.





---
[Visit Topic](https://discuss.tvm.apache.org/t/hierarchy-in-tvm/12306/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/a5e6c665c6abfdd086554936840bbb849aa7ce6a7b175dd1fb376831d7577a6e).

[Apache TVM Discuss] [Questions] Hierarchy in TVM

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

Interesting point. I agree that having a hierachy would make the IR more readable. Perhaps the nested structure can be achieved in A-norm form and can be flatten to graph-norm when we need to tune the model?





---
[Visit Topic](https://discuss.tvm.apache.org/t/hierarchy-in-tvm/12306/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/0241c25bdd8084888682f8e6d81d5fd17a6ec12f3ce1630f24c8405c666389a8).