chiwwang commented on a change in pull request #8220:
URL: https://github.com/apache/tvm/pull/8220#discussion_r651525882
##########
File path: docs/dev/pass_infra.rst
##########
@@ -526,16 +663,93 @@ decorators and then invoke it. For more examples about
how to customize your own
optimization pipeline and debug Relay and tir passes, please refer to the
`use pass infra`_ tutorial.
+
+.. _pass_instrument_py_frontend:
+
+Pass Instrument
+^^^^^^^^^^^^^^^
+
+A customizable framework to instrument passes is provided. ``PassInstrument``
classes can be registered while constructing ``PassContext``.
+
+.. code:: python
+
+ @tvm._ffi.register_object("transform.PassContext")
+ class PassContext(tvm.runtime.Object):
+ def __init__(
+ self,
+ opt_level=2,
+ required_pass=None,
+ disabled_pass=None,
+ instruments=None,
+ config=None,
+ ):
+ # ...
+
+One can implement a ``PassInstrument`` by using the ``pass_instrument``
decorator(`python/tvm/ir/instrument.py`_) on a class implementing following
methods:
Review comment:
Done
##########
File path: docs/dev/pass_infra.rst
##########
@@ -389,6 +396,136 @@ To allow other C++ modules to apply this pass, we declare
a free function in
TVM_DLL Pass FoldConstant();
+.. _pass_instrument_cpp_backend:
+
+Pass Instrument
+^^^^^^^^^^^^^^^
+
+Currently we introduce four instrument point in the life-cycle of
``PassContext``.
Review comment:
Done
##########
File path: docs/dev/pass_infra.rst
##########
@@ -526,16 +663,93 @@ decorators and then invoke it. For more examples about
how to customize your own
optimization pipeline and debug Relay and tir passes, please refer to the
`use pass infra`_ tutorial.
+
+.. _pass_instrument_py_frontend:
+
+Pass Instrument
+^^^^^^^^^^^^^^^
+
+A customizable framework to instrument passes is provided. ``PassInstrument``
classes can be registered while constructing ``PassContext``.
+
+.. code:: python
+
+ @tvm._ffi.register_object("transform.PassContext")
+ class PassContext(tvm.runtime.Object):
+ def __init__(
+ self,
+ opt_level=2,
+ required_pass=None,
+ disabled_pass=None,
+ instruments=None,
+ config=None,
+ ):
+ # ...
+
+One can implement a ``PassInstrument`` by using the ``pass_instrument``
decorator(`python/tvm/ir/instrument.py`_) on a class implementing following
methods:
Review comment:
Done
--
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]