Skip to content
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

[Fix] Fix the purity flag of "vm.call_tir_dyn" and "kill" ops #16773

Merged
merged 1 commit into from
Mar 24, 2024

Conversation

MasterJH5574
Copy link
Contributor

This PR fixes the purity flag of relax.vm.call_tir_dyn and another few "kill" ops. Their purity flags were set to True, which made them possible to be removed by remove_all_unused.

  • relax.vm.call_tir_dyn works by mutating the input args in place, which is not pure.
  • though the "kill" ops have no actions so far, their semantics suggest that they are impure.

A regression test is added to prevent the unexpected removal from happening again.

This PR fixes the purity flag of `relax.vm.call_tir_dyn` and another
few "kill" ops. Their purity flags were set to True, which made them
possible to be removed by `remove_all_unused`.

* `relax.vm.call_tir_dyn` works by mutating the input args in place,
which is not pure.
* though the "kill" ops have no actions so far, their semantics
suggest that they are impure.

A regression test is added to prevent the unexpected removal from
happening again.
@MasterJH5574 MasterJH5574 force-pushed the tvm-dev/2024-03-22-purity-flag branch from 1f5733c to cf4d113 Compare March 24, 2024 00:24
@tqchen tqchen merged commit 6d97b95 into apache:main Mar 24, 2024
18 checks passed
thaisacs pushed a commit to thaisacs/tvm that referenced this pull request Apr 3, 2024
…#16773)

This PR fixes the purity flag of `relax.vm.call_tir_dyn` and another
few "kill" ops. Their purity flags were set to True, which made them
possible to be removed by `remove_all_unused`.

* `relax.vm.call_tir_dyn` works by mutating the input args in place,
which is not pure.
* though the "kill" ops have no actions so far, their semantics
suggest that they are impure.

A regression test is added to prevent the unexpected removal from
happening again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants