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 2024/07/29 15:24:24 UTC
[PR] [Relax] Refactor RealizeVDevice to remove in-place mutation [tvm]
Lunderberg opened a new pull request, #17213:
URL: https://github.com/apache/tvm/pull/17213
Prior to this commit, the `relax.transform.RealizeVDevice` pass performed in-place update on expressions appearing in its input `IRModule`, overwriting their struct info. In-place mutation of TVM's IR types is only legal when the scope has sole ownership of the IR object, such as through the `CopyOnWrite` functionality, and is not allowed when the object is shared. As a result, applying `RealizeVDevice` would cause unexpected updates in unrelated expressions. Most noticeably, the `IRModule` used as input to `RealizeVDevice` would have its variable erroneously updated.
This commit refactors the `RealizeVDevice` transform to remove all in-place mutation. The same propagation rules are followed, with known `VDevice` annotations propagated forward from the output of `R.hint_on_device`, and propagated backwards from the input of `R.hint_on_device` if no such annotation already exists.
Closes https://github.com/apache/tvm/issues/17205.
--
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] [Relax] Refactor RealizeVDevice to remove in-place mutation [tvm]
Posted by "Hzfengsy (via GitHub)" <gi...@apache.org>.
Hzfengsy merged PR #17213:
URL: https://github.com/apache/tvm/pull/17213
--
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