You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "slyubomirsky (via GitHub)" <gi...@apache.org> on 2023/05/11 18:59:43 UTC
[GitHub] [tvm] slyubomirsky opened a new issue, #14829: [Bug][Unity] `LazyTransformParams` introduces impure actions inside `DataflowBlock`s
slyubomirsky opened a new issue, #14829:
URL: https://github.com/apache/tvm/issues/14829
The test case for the pass `LazyTransformParams` reveals a significant bug that should require rethinking how the pass works:
https://github.com/apache/tvm/blob/28567bdc248464c9b1d4f728f3aca3b64966fa90/tests/python/relax/test_transform_lazy_transform_params.py#L77-L98
Here is the intended transformed function:
```python
@R.function
def main_transform_params() -> R.Tuple(R.Object, R.Object):
cls = Expected
with R.dataflow():
lv: R.Object = R.call_packed("get_item", R.prim_value(1), sinfo_args=(R.Object,))
lv1: R.Object = R.call_packed(
"set_item", R.prim_value(0), lv, sinfo_args=(R.Object,)
)
lv2: R.Tuple = R.vm.kill_object(lv)
lv1_1: R.Object = R.call_packed("get_item", R.prim_value(0), sinfo_args=(R.Object,))
lv3 = R.call_tir(
cls.transform_layout_IOHW_to_OIHW,
(lv1_1,),
out_sinfo=R.Tensor((16, 3, 3, 3), dtype="float32"),
)
lv4: R.Object = R.call_packed(
"set_item", R.prim_value(1), lv3, sinfo_args=(R.Object,)
)
lv5: R.Tuple = R.vm.kill_object(lv1_1)
gv: R.Tuple(R.Object, R.Object) = (lv1, lv4)
R.output(gv)
return gv
```
Notice that there are calls to a `PackedFunc` called `set_item` inside the dataflow block. This is an impure action and thus should not be permitted inside the dataflow block. In principle, I would argue this pass should come after `ToNonDataflow` in the phase ordering, but the pass also includes a liveness analysis that _relies_ on dataflow blocks, so that is not an option. Either way, there should be some careful redesign here. I don't think it's valid to include that mutation inside a dataflow block.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] slyubomirsky commented on issue #14829: [Bug][Unity] `LazyTransformParams` introduces impure actions inside `DataflowBlock`s
Posted by "slyubomirsky (via GitHub)" <gi...@apache.org>.
slyubomirsky commented on issue #14829:
URL: https://github.com/apache/tvm/issues/14829#issuecomment-1552256107
Fixed in #14864
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] slyubomirsky commented on issue #14829: [Bug][Unity] `LazyTransformParams` introduces impure actions inside `DataflowBlock`s
Posted by "slyubomirsky (via GitHub)" <gi...@apache.org>.
slyubomirsky commented on issue #14829:
URL: https://github.com/apache/tvm/issues/14829#issuecomment-1544604751
I tried running `ToNonDataflow` (and agree that it's what one would expect to work), but the pass fails due to the liveness analysis breaking.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] jinhongyii commented on issue #14829: [Bug][Unity] `LazyTransformParams` introduces impure actions inside `DataflowBlock`s
Posted by "jinhongyii (via GitHub)" <gi...@apache.org>.
jinhongyii commented on issue #14829:
URL: https://github.com/apache/tvm/issues/14829#issuecomment-1544619540
this is a really good point! Thanks @slyubomirsky. I will change the logic of liveness analysis and push a fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] slyubomirsky closed issue #14829: [Bug][Unity] `LazyTransformParams` introduces impure actions inside `DataflowBlock`s
Posted by "slyubomirsky (via GitHub)" <gi...@apache.org>.
slyubomirsky closed issue #14829: [Bug][Unity] `LazyTransformParams` introduces impure actions inside `DataflowBlock`s
URL: https://github.com/apache/tvm/issues/14829
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tqchen commented on issue #14829: [Bug][Unity] `LazyTransformParams` introduces impure actions inside `DataflowBlock`s
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on issue #14829:
URL: https://github.com/apache/tvm/issues/14829#issuecomment-1544576007
cc @jinhongyii
I think ideally it should be done after ToNonDataflow
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org