You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tvm.apache.org by Xqdan via TVM Discuss <no...@discuss.tvm.ai> on 2020/04/28 03:02:44 UTC

[TVM Discuss] [Development/RFC] [IR] Unified TVM IR Infra


@tqchen do we have abstractions in TVM’s unfied IR infra?

1,  multi-stage ir for relay::Function:
```
c = IRModule A(a, b){
  a = a + 1;
  b = b + 1;
  return a+b;
}

e =  IRModule B(c, d){
  c = c + 1;
  d = d + 1;
  return c+d;
}
```
With this abstraction, we can express complex/big ops with limited small ops; also we can treat big op as white box op, so we can do some computation optimizations globally.

2, multi-stage ir for tir::PrimFunc:
```
c = IRModule A(a, b){
 lowered tir
}

e =  IRModule B(c, d){
  lowered tir
}
```
with this abstraction, we can do some low level global optimizations, like dma preload for local buffers.
we may need to break lower into several api, so we can utilize different property of tir, like before stroageflatten or after.





---
[Visit Topic](https://discuss.tvm.ai/t/ir-unified-tvm-ir-infra/4801/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/25ea4666880cf9d3e1284d1f1a02df0edef00e3874eceec1a426fff8ebab18af).

[TVM Discuss] [Development/RFC] [IR] Unified TVM IR Infra

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

Yes, textformat and round trip is on the roadmap





---
[Visit Topic](https://discuss.tvm.ai/t/ir-unified-tvm-ir-infra/4801/11) 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/f8b6a57352dc6f1519a0b40069fd9353f8330793c3cea2c39bba5ea4baf05fac).

[TVM Discuss] [Development/RFC] [IR] Unified TVM IR Infra

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

Do we support round trip ir?  which can parser a readable ir and construct ir objects as inputs for compiler.





---
[Visit Topic](https://discuss.tvm.ai/t/ir-unified-tvm-ir-infra/4801/10) 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/e82be81fe5b5399ec73d4c0b36d9f94b7e6cdda5a361ddf18f7e2e771d5d7dc1).

[TVM Discuss] [Development/RFC] [IR] Unified TVM IR Infra

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

We are moving the pass infrastructure to use the Pass infrastructure https://docs.tvm.ai/api/python/ir.html#module-tvm.transform

After the refactor is completed, we should be able to use the trace API to handle IR printing both in relay and tir. https://docs.tvm.ai/api/python/ir.html#tvm.transform.PassContext





---
[Visit Topic](https://discuss.tvm.ai/t/ir-unified-tvm-ir-infra/4801/9) 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/c194e75db659d943ae6df67ce756e5b7918073ccd4f94ce37d1be06170824f7c).

[TVM Discuss] [Development/RFC] [IR] Unified TVM IR Infra

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

@tqchen That's great!
BTW I notice you delete ir dump in recently pr, but this is very very important utility for compiler development in HW projects, do we have other alternatives in tvm?





---
[Visit Topic](https://discuss.tvm.ai/t/ir-unified-tvm-ir-infra/4801/8) 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/a86eb74693b834cdc0a185bb83b8bf69dcb711df80e06d83df460989d68d5341).

[TVM Discuss] [Development/RFC] [IR] Unified TVM IR Infra

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

@xqdan you are right, we can also mix functions of different levels in the same IRModule





---
[Visit Topic](https://discuss.tvm.ai/t/ir-unified-tvm-ir-infra/4801/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/b8b60155ea2d7135d1e1b066ebed4d190a164c2473e438f51356c3fe0cb7ad66).