kparzysz-quic commented on code in PR #15507:
URL: https://github.com/apache/tvm/pull/15507#discussion_r1289020064
##########
tests/python/relax/test_analysis.py:
##########
@@ -117,6 +117,53 @@ def main(x: R.Tensor((32, 32), "float32")) -> R.Tensor:
tvm.ir.assert_structural_equal(optimized, GroundTruth["main"])
+def test_binding_block_remove_all_unused_without_dataflow():
+ @tvm.script.ir_module
+ class IdentityUnused:
+ @R.function
+ def main(x: R.Tensor((32, 32), "float32")) -> R.Tensor:
+ lv0 = x
+ unused0 = R.call_dps_packed("my_sigmoid", (x,), R.Tensor((32, 32),
dtype="float32"))
+ unused1 = R.call_dps_packed(
+ "my_dps_func", (unused0,), R.Tensor((32, 32), dtype="float32")
+ )
+ z = R.call_packed("vm.builtin.copy", lv0,
sinfo_args=(R.Tensor((32, 32), "float32")))
+ return z
+
+ optimized = remove_all_unused(IdentityUnused["main"])
+
+ GroundTruth = IdentityUnused
Review Comment:
Shouldn't the two `unused`s be removed? I think this whole algorithm (not
your change specifically) is somewhat deficient if it doesn't keep track of
newly-unused objects.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]