Skip to content

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

Merged
tqchen merged 1 commit intoapache:mainfrom
MasterJH5574:tvm-dev/2024-03-22-purity-flag
Mar 24, 2024
Merged

[Fix] Fix the purity flag of "vm.call_tir_dyn" and "kill" ops#16773
tqchen merged 1 commit intoapache:mainfrom
MasterJH5574:tvm-dev/2024-03-22-purity-flag

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
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