zackcquic commented on a change in pull request #7952:
URL: https://github.com/apache/tvm/pull/7952#discussion_r638396364
##########
File path: tests/python/relay/test_pass_manager.py
##########
@@ -559,15 +569,20 @@ def test_print_debug_callback():
]
)
- assert __TRACE_COUNTER__ == 0
mod = tvm.IRModule({"main": func})
- with tvm.transform.PassContext(opt_level=3, trace=_tracer):
+ pass_counter = PassCounter()
+ with tvm.transform.PassContext(opt_level=3, instruments=[pass_counter]):
+ # Should be reseted when entering pass context
+ assert pass_counter.get_counts() == 0
mod = seq(mod)
- # TODO(@jroesch): when we remove new fn pass behavior we need to remove
- # change this back to 3
- assert __TRACE_COUNTER__ == 5
+ # TODO(@jroesch): when we remove new fn pass behavior we need to remove
+ # change this back to match correct behavior
+ assert pass_counter.get_counts() == 6
Review comment:
As mentioned before, FunctionPassNode's InfterType() and
SequentialPass() are not traced before.
In this PR, we override pass::operator() to instrument instead of
instrumenting in subclasses::operator().
In this test case, sequential pass now is instrumented (counted).
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]