You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "Lunderberg (via GitHub)" <gi...@apache.org> on 2023/12/01 21:38:22 UTC
[PR] [Unity] Check usage location when canonicalizing trivial bindings [tvm]
Lunderberg opened a new pull request, #16193:
URL: https://github.com/apache/tvm/pull/16193
Prior to this commit, the `CanonicalizeBindings` transform handled trivial bindings, including binding of a `DataflowVar` to a `Var`, and usage of `Var` where a `DataflowVar` should be used instead. However, it did not handle the case where both of these occur at the same time. That is, a binding of `var_x = dataflow_y`, where `var_x` is only used within the dataflow block. For these cases, `CanonicalizeBindings` would need to be run repeatedly.
This commit updates `CanonicalizeBindings` to check if a trivial binding is used outside the dataflow block. This avoids producing output that requires further canonicalization.
--
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
Re: [PR] [Unity] Check usage location when canonicalizing trivial bindings [tvm]
Posted by "slyubomirsky (via GitHub)" <gi...@apache.org>.
slyubomirsky merged PR #16193:
URL: https://github.com/apache/tvm/pull/16193
--
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
Re: [PR] [Unity] Check usage location when canonicalizing trivial bindings [tvm]
Posted by "Lunderberg (via GitHub)" <gi...@apache.org>.
Lunderberg commented on PR #16193:
URL: https://github.com/apache/tvm/pull/16193#issuecomment-1841051346
@slyubomirsky Good call, and I've added a unit test for this behavior. I actually ran into this case during development, and needed to change the `test_multiple_outputs` test so that it *didn't* test the new behavior. I've added a new test which validates the behavior when a non-dataflow variable is being replaced by dataflow, and is also part of a trivial binding being replaced.
--
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
Re: [PR] [Unity] Check usage location when canonicalizing trivial bindings [tvm]
Posted by "slyubomirsky (via GitHub)" <gi...@apache.org>.
slyubomirsky commented on PR #16193:
URL: https://github.com/apache/tvm/pull/16193#issuecomment-1839970965
Possible other case to try: The LHS and RHS are both non-dataflow vars that appear only inside a dataflow block. They should both be turned into dataflow vars and may need to be eliminated. I encountered this case when messing with another pass.
Example:
```
with R.dataflow()
z = R.add(x, y)
q = z
r = q
w = R.multiply(r, r)
R.output(z, q, r, w)
...
# let's say only w is used
```
Should be canonicalized into
```
with R.dataflow():
z = R.add(x, y)
w = R.multiply(z, z)
R.output(w)
...
```
I believe your changes should handle it but it would be a good one to check. This did not end up working when I tried it without your 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