tilelang.tools.pass_timing ========================== .. py:module:: tilelang.tools.pass_timing .. autoapi-nested-parse:: Pass-timing tool for TileLang compilation pipelines. Records inclusive and self wall-clock duration for each pass using ``time.monotonic()``. Data persists after PassContext exit for post-compilation reporting. Enabled via TILELANG_PASS_PROFILE=1 env var or PassConfigKey.TL_PASS_PROFILE pass config. Classes ------- .. autoapisummary:: tilelang.tools.pass_timing.PassTimingRecord tilelang.tools.pass_timing.TileLangPassTimingInstrument tilelang.tools.pass_timing.PassTimingTool Functions --------- .. autoapisummary:: tilelang.tools.pass_timing.create_pass_timing_tool Module Contents --------------- .. py:class:: PassTimingRecord Single completed pass execution record. .. py:attribute:: name :type: str .. py:attribute:: duration_s :type: float .. py:attribute:: depth :type: int .. py:attribute:: self_duration_s :type: float :value: 0.0 .. py:attribute:: sequence :type: int :value: 0 .. py:attribute:: kernel :type: str :value: '' .. py:class:: TileLangPassTimingInstrument(threshold_ms = 0.0) Per-pass timing instrument for tilelang compilation pipelines. This is a plain-Python wrapper that creates a TVM ``PassInstrument`` internally. Callback state is kept separate so the native instrument does not retain this wrapper. :param threshold_ms: Only show passes whose inclusive duration meets this threshold (ms). 0.0 means show all passes. :type threshold_ms: float .. py:property:: instrument The underlying TVM PassInstrument to add to ``PassContext``. .. py:property:: records :type: list[PassTimingRecord] .. py:property:: total_duration_s :type: float .. py:method:: report(context = None) Generate a formatted timing report string. .. py:method:: print_report(context = None) Print the timing report to the logger. .. py:class:: PassTimingTool(threshold_ms = 0.0) Bases: :py:obj:`tilelang.instrumentation.PassInstrumentationTool` Per-compile owner of timing callbacks and their combined report. .. py:attribute:: pass_instrument_priority :value: -100 .. py:attribute:: threshold_ms :value: 0.0 .. py:method:: create_pass_instrument() .. py:property:: timings :type: tuple[TileLangPassTimingInstrument, Ellipsis] .. py:property:: contexts :type: tuple[str | None, Ellipsis] .. py:property:: records :type: list[PassTimingRecord] .. py:method:: report() Generate one compile report containing one section per PassContext. .. py:method:: print_report() Print all PassContext timing sections in one logger call. .. py:method:: finish(error) .. py:function:: create_pass_timing_tool(pass_configs) Create the per-compile timing tool when config or environment enables it.