ece644c5ed
* [IR][Pass][Instrument] Pass instrument framework
This commit provides utilies to instrument passes:
1. Add a new namespace tvm.instrument
2. Introduce PassInstrument and PassInstrumentor to PassContext
Example
-------
passes_mem = #... Impl of memory instrument
passes_time = tvm.instrument.PassesTimeInstrument()
with tvm.transform.PassContext(
pass_instrumentor=PassInstrumentor([passes_mem, passes_time])):
tvm.relay.build(mod, 'llvm')
passes_mem.rendor()
passes_time.rendor()
3. Integrate existing PassContext::Trace() and timing profile
* [IR][Pass][Instrument] Fix python test_pass_manager.py
* Fix comment
* Fix lint
* Fix test_pass_annotation
* Fix test_pass_annotation.py
* Fix lint
* Fix test_pass_annotation.py
* Fix test_pass_annotation.py
* Fix review comments
* Fix tutorial use_pass_infra.py
* Fix review comments
* Fix review comments
* Fix typo
* Fix review comments
* Fix review comments
* Fix unittest error: test_cow_pass
* Fix unittest error
* Add more test cases for exceptions
* Fix nit
* Doc override_instruments()
* Fix review comments
* Fix lint
* Fix EnterContext exception behavior