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 夏余鑫 via Apache TVM Discuss <no...@discuss.tvm.ai> on 2022/06/08 04:05:18 UTC

[Apache TVM Discuss] [Questions] How do I add custom data load and write back through TIR?


This is the relationship and the source of the data:
![image|622x499](upload://qZxuxp1ZZwlyFisdyyu8KSww53p.png) 
In the picture, the top is what I have and the bottom is what I want.
Among them:
x == A,y == B,z == C;
GM2LM is data loading
LM2GM is data write back
How can I add something to TIR to facilitate my code generation?





---
[Visit Topic](https://discuss.tvm.apache.org/t/how-do-i-add-custom-data-load-and-write-back-through-tir/12927/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/8865c81ea910e83521e424a2039c802b180530cd07a2ff825535b28a4674a80c).

[Apache TVM Discuss] [Questions] How do I add custom data load and write back through TIR?

Posted by 夏余鑫 via Apache TVM Discuss <no...@discuss.tvm.ai>.

Thank you very much for your answer, I think I get it.





---
[Visit Topic](https://discuss.tvm.apache.org/t/how-do-i-add-custom-data-load-and-write-back-through-tir/12927/5) 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/06cdd897306ce8230218d76adba7bb9f599096b74c6b958f7736d7f714a92348).

[Apache TVM Discuss] [Questions] How do I add custom data load and write back through TIR?

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

The way to do it is using the "pragma" method of the stage. There are examples [here](https://github.com/apache/tvm/blob/6fca5c657a2fadc16fd7ff44de8a6a9656d50c1b/vta/python/vta/top/vta_conv2d.py#L148) and [here](https://github.com/apache/tvm/blob/6fca5c657a2fadc16fd7ff44de8a6a9656d50c1b/apps/topi_recipe/gemm/gemm_int8.py#L119).





---
[Visit Topic](https://discuss.tvm.apache.org/t/how-do-i-add-custom-data-load-and-write-back-through-tir/12927/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/86009dadbc16dc42bb6baeaafc29111382cdfd080b746a2a904fe8ca805f0546).

[Apache TVM Discuss] [Questions] How do I add custom data load and write back through TIR?

Posted by 夏余鑫 via Apache TVM Discuss <no...@discuss.tvm.ai>.

Thank you for your answer. I would like to know how to tag read/write stages with specific pragmas.





---
[Visit Topic](https://discuss.tvm.apache.org/t/how-do-i-add-custom-data-load-and-write-back-through-tir/12927/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/a7d624d11fd70ce798cce4b1e90ba706b8700c62e05b49f922a75a02c48b2941).

[Apache TVM Discuss] [Questions] How do I add custom data load and write back through TIR?

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

I would advise you to take a look at the cache_read and cache_write methods of the schedules. In my particular case (I don't know if this is exactly what you are looking for) I use this 2 methods to generate read and write stages, and then tag this stages with specific pragmas. Then, I have 2 separate passes that replace the loops tagged with this pragmas with my own load and store macros.





---
[Visit Topic](https://discuss.tvm.apache.org/t/how-do-i-add-custom-data-load-and-write-back-through-tir/12927/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/211df137ec43395e4665b5970e131d76c72ed4373d1a68c98722cb53369db27b).