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 Pcheng L via TVM Discuss <no...@discuss.tvm.ai> on 2020/04/28 09:28:37 UTC

[TVM Discuss] [Questions] [BYOC] Problem about subgraph with TupleTypeNode inputs


Now, I want to use BYOC to run SSD-ResNet34 model and I met some problems. 
About the "concatenate" operator, if it is a subgraph, the partitioned graph is:

    def @ssdnn_0(%ssdnn_0_i0: (Tensor[(64, 4, 5776), float32], Tensor[(64, 4, 2166), float32], Tensor[(64, 4, 600), float32], Tensor[(64, 4, 150), float32], Tensor[(64, 4, 36), float32], Tensor[(64, 4, 4), float32]), Compiler="ssdnn", Inline=1, Primitive=1, global_symbol="ssdnn_0") -> Tensor[(64, 4, 8732), float32] {
      concatenate(%ssdnn_0_i0, axis=2) /* ty=Tensor[(64, 4, 8732), float32] */
    }

After codegen,  the cSource code is generated:

extern "C" int ssdnn_0_wrapper_(DLTensor* arg0,
        DLTensor* arg1) {
  ssdnn_0_(static_cast<float*>(arg0->data),
  static_cast<float*>(arg1->data));
  return 0;
}

extern "C" void ssdnn_0_(float* ssdnn_0_i0, float* out) {
  ...
  ssdnn_concat(1, buf_0, 0, 2, 3, 64, 4, 8732, 1, ssdnn_0_i0);
  std::memcpy(out, buf_0->data(), 4 * 2235392);
  ...
}


The parameter of "ssdnn_0_i0" is a tupleTypeNode,
But I need to know each field's data after codegen.
I wonder if there is any idear to get the each element of TupeTypeNode after codegen, or after graph partition, not input the TupleTypeNode but give each element of the TupleTypeNode?
@comaniac @manupa-arm





---
[Visit Topic](https://discuss.tvm.ai/t/byoc-problem-about-subgraph-with-tupletypenode-inputs/6522/1) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/f83d54d881dd31ee01ce91f8cd9e76c493af42f49521233cabdeb7c41f436ea0).

[TVM Discuss] [Questions] [BYOC] Problem about subgraph with TupleTypeNode inputs

Posted by Matt Barrett via TVM Discuss <no...@discuss.tvm.ai>.

I have a candidate fix with this PR: https://github.com/apache/incubator-tvm/pull/5476





---
[Visit Topic](https://discuss.tvm.ai/t/byoc-problem-about-subgraph-with-tupletypenode-inputs/6522/6) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/2634119bdaa95464e47b2ece35c72a85af4683d8da6fac3cc526661b2442b90a).

[TVM Discuss] [Questions] [BYOC] Problem about subgraph with TupleTypeNode inputs

Posted by Ramana Radhakrishnan via TVM Discuss <no...@discuss.tvm.ai>.

@matt-arm : you may find this interesting.





---
[Visit Topic](https://discuss.tvm.ai/t/byoc-problem-about-subgraph-with-tupletypenode-inputs/6522/3) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/31873a31ede08609325ecbf8fd1d33fa6cdf9d87a8e65111238a77b3b270ae99).

[TVM Discuss] [Questions] [BYOC] Problem about subgraph with TupleTypeNode inputs

Posted by Pcheng L via TVM Discuss <no...@discuss.tvm.ai>.

I will have a try. Thanks very much.





---
[Visit Topic](https://discuss.tvm.ai/t/byoc-problem-about-subgraph-with-tupletypenode-inputs/6522/4) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/7596760f9bc0e40e464469c8b6525d4588a41cba9cdd427d344ffa4d10969ea0).

[TVM Discuss] [Questions] [BYOC] Problem about subgraph with TupleTypeNode inputs

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

At this moment we suggest your codegen flatting a tuple here:

https://github.com/apache/incubator-tvm/blob/master/src/relay/backend/contrib/dnnl/codegen.cc#L141

In addition, when processing concatenate nodes, your codegen can retrieve the tuple information when processing concatenate nodes by accessing their `args`.

Apart from that, it's not recommended offloading concatenate nodes especially this subgraph contains only one concatenate node.





---
[Visit Topic](https://discuss.tvm.ai/t/byoc-problem-about-subgraph-with-tupletypenode-inputs/6522/2) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/7a690d68897f812302506019b633452932bf057b3cc10d170c205f2dfcbb8e06).

[TVM Discuss] [Questions] [BYOC] Problem about subgraph with TupleTypeNode inputs

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

@matt-arm the PR you posted solved the issue of tuple constant propagation, but it seems not solving the tuple var node issue. In this particular case, for example, we will still have a tuple of data in the first argument.





---
[Visit Topic](https://discuss.tvm.ai/t/byoc-problem-about-subgraph-with-tupletypenode-inputs/6522/7) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/bbe4ca1db35e88f27cfee0dbc32f51c5fb52bf0ea400dbd5f3429a16f196616a).

[TVM Discuss] [Questions] [BYOC] Problem about subgraph with TupleTypeNode inputs

Posted by Matt Barrett via TVM Discuss <no...@discuss.tvm.ai>.

Hi, welcome to the forum :) I'm working on fixing this exact issue at the moment. It comes about because constant tuples are not correctly propagated into the partitioned regions so you can't see the data of the tuple, only its type. I hope to have a fix in review either later today or tomorrow.





---
[Visit Topic](https://discuss.tvm.ai/t/byoc-problem-about-subgraph-with-tupletypenode-inputs/6522/5) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/54075c9b11ba73516c9c30f266373e883b11c593c824b397eab71b0ee83aed38).