-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create utility that asserts that IRModules aren't modified in-place #11372
Comments
@gigiblender may take a look at this |
4 tasks
Lunderberg
added a commit
to Lunderberg/mlc-llm
that referenced
this issue
Feb 14, 2024
A pass must not mutate the `IRModule` that it receives as input. Unlike most functions exposed through the python API, the `IRModule.__setitem__` method mutates the underlying `IRModuleNode`. This can impact other users of the shared `IRModule` object, which expect mutation to be done using copy-on-write. See apache/tvm#11372 for more details.
MasterJH5574
pushed a commit
to mlc-ai/mlc-llm
that referenced
this issue
Feb 14, 2024
A pass must not mutate the `IRModule` that it receives as input. Unlike most functions exposed through the python API, the `IRModule.__setitem__` method mutates the underlying `IRModuleNode`. This can impact other users of the shared `IRModule` object, which expect mutation to be done using copy-on-write. See apache/tvm#11372 for more details.
Lunderberg
added a commit
to octoml/mlc-llm
that referenced
this issue
Feb 15, 2024
A pass must not mutate the `IRModule` that it receives as input. Unlike most functions exposed through the python API, the `IRModule.__setitem__` method mutates the underlying `IRModuleNode`. This can impact other users of the shared `IRModule` object, which expect mutation to be done using copy-on-write. See apache/tvm#11372 for more details.
Lunderberg
added a commit
to octoml/mlc-llm
that referenced
this issue
Feb 15, 2024
A pass must not mutate the `IRModule` that it receives as input. Unlike most functions exposed through the python API, the `IRModule.__setitem__` method mutates the underlying `IRModuleNode`. This can impact other users of the shared `IRModule` object, which expect mutation to be done using copy-on-write. See apache/tvm#11372 for more details.
Lunderberg
added a commit
to octoml/mlc-llm
that referenced
this issue
Feb 22, 2024
A pass must not mutate the `IRModule` that it receives as input. Unlike most functions exposed through the python API, the `IRModule.__setitem__` method mutates the underlying `IRModuleNode`. This can impact other users of the shared `IRModule` object, which expect mutation to be done using copy-on-write. See apache/tvm#11372 for more details.
Lunderberg
added a commit
to octoml/mlc-llm
that referenced
this issue
Feb 28, 2024
A pass must not mutate the `IRModule` that it receives as input. Unlike most functions exposed through the python API, the `IRModule.__setitem__` method mutates the underlying `IRModuleNode`. This can impact other users of the shared `IRModule` object, which expect mutation to be done using copy-on-write. See apache/tvm#11372 for more details.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background: In TVM, the IRModule data structure is intended to be immutable. This is a property which unfortunately can't be enforced by a C++ language construct such as
const
because it is perceived to be too big of a hammer for that problem (I think one of the core challenges is that due to pointers, it's too difficult to propagateconst
through generic data structures such asMap
). Instead, we have to enforce this through convention of not implementing functions on IR data structures which may mutate them.We are pretty good about this but unfortunately definitely not perfect. We could use a backstop here to provide us a guarantee, in test, that a pass doesn't mutate an IRModule but instead creates a copy wherever state is changed. This task captures writing that test utility.
The text was updated successfully, but these errors were encountered: