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 Tristan Konolige via Apache TVM Discuss <no...@discuss.tvm.ai> on 2020/09/15 22:53:49 UTC

[Apache TVM Discuss] [Questions] Modifying weight parameters in OpStrategy


I'm working on improving the current `sparse_dense` kernels on the GPU. I have a performant implementation, but it requires modification of the input sparse matrix to make it more amenable to the GPU (I have been doing this modification at compile time as the input sparse matrix is always a static weight). I have tried adding my implementation as new strategy implementation (via `OpStrategy.add_implementation`), but I cannot get it to work because I need to modify the input matrix. Is there a way to modify the inputs in this way? If not, do I need to write a new operator that uses my kernel and then write a new pass to replace existing `sparse_dense` operations with mine?

 @haichen





---
[Visit Topic](https://discuss.tvm.apache.org/t/modifying-weight-parameters-in-opstrategy/7914/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/cb133a31cdd6e9ce571d4702eceabda5c42b8ba2925656619b8cf0141da0bca3).

[Apache TVM Discuss] [Questions] Modifying weight parameters in OpStrategy

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

@haichen, I'm trying this, but the alter_op_layout is never called because the layouts appear to be invalid. Specifically, this line https://github.com/apache/incubator-tvm/blob/master/src/relay/transforms/transform_layout.h#L285-L286 always returns `success=false`. I tried adding the `ElemwiseArbitraryLayout` to sparse dense, but that did not fix the problem. Is there a way to add the correct layout (which I assume is just the identity?) or a way to skip this layout business altogether?





---
[Visit Topic](https://discuss.tvm.apache.org/t/modifying-weight-parameters-in-opstrategy/7914/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/d5dc6a15e25768bcf918bb7ccc8d4ea063c380bc5496504415d4b32d490367a0).

[Apache TVM Discuss] [Questions] Modifying weight parameters in OpStrategy

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

In this case, you can it in the op alter layout. You can check out the example from https://github.com/apache/incubator-tvm/blob/master/python/tvm/topi/x86/conv2d_alter_op.py#L40.





---
[Visit Topic](https://discuss.tvm.apache.org/t/modifying-weight-parameters-in-opstrategy/7914/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/fa0d290a719de62303ffd01ad36f49326f7c4eec0c2492420b2cf7580353fca6).