tilelang.carver.analysis ======================== .. py:module:: tilelang.carver.analysis .. autoapi-nested-parse:: Analysis on TIR blocks, loops and functions. Classes ------- .. autoapisummary:: tilelang.carver.analysis.IterInfo tilelang.carver.analysis.BlockInfo Functions --------- .. autoapisummary:: tilelang.carver.analysis.normalize_prim_func tilelang.carver.analysis.find_var_from_func tilelang.carver.analysis.check_func_with_dynamic tilelang.carver.analysis.get_max_threads_per_block tilelang.carver.analysis.get_max_shared_memory_per_block tilelang.carver.analysis.get_root_block tilelang.carver.analysis.collect_block_iter_vars_used_in_access_region tilelang.carver.analysis.collect_vars_used_in_prim_expr tilelang.carver.analysis.detect_dominant_read tilelang.carver.analysis.is_broadcast_epilogue tilelang.carver.analysis.get_reduction_blocks tilelang.carver.analysis.get_coalesced_veclen Module Contents --------------- .. py:class:: IterInfo(kind, var, dom, loop_rv) Information about a loop/iter var. .. py:attribute:: kind :type: typing_extensions.Literal[S, R, O] .. py:attribute:: var :type: tvm.tir.Var .. py:attribute:: loop_rv :type: tvm.tir.schedule.LoopRV .. py:property:: dom :type: Union[int, tvm.tir.PrimExpr] The iteration domain of the loop. .. py:method:: __str__() .. py:method:: __repr__() .. py:class:: BlockInfo(name, iters, block_rv, reduction_block = False) Information about a TIR block. .. py:attribute:: name :type: str .. py:attribute:: iters :type: List[IterInfo] .. py:attribute:: block_rv :type: tvm.tir.schedule.BlockRV .. py:method:: dom() The iteration domain of the block. .. py:method:: dom_kind() The iteration domain kind of the block, for example, SSSS, SSSR. .. py:method:: is_injective() Whether the block is injective, i.e. all its iteration domains are injective. .. py:method:: is_elementwise(sch) Whether the block is elementwise, i.e. trivial mapping between read/write region .. py:method:: is_reduction() Whether the block is a reduction workload. .. py:method:: is_gemv() :abstractmethod: Whether the block is a GEMV workload. .. py:method:: is_gemm() :abstractmethod: Whether the block is a GEMM workload. .. py:method:: __str__() .. py:method:: __repr__() .. py:function:: normalize_prim_func(sch) Normalize the primfunc to normal form .. py:function:: find_var_from_func(func, var) .. py:function:: check_func_with_dynamic(func) .. py:function:: get_max_threads_per_block(target) .. py:function:: get_max_shared_memory_per_block(target) .. py:function:: get_root_block(sch, func_name = 'main') .. py:function:: collect_block_iter_vars_used_in_access_region(block, region) Collect the block iter variables used in the access region of a buffer region. .. py:function:: collect_vars_used_in_prim_expr(expr) Collect the variables used in the PrimExpr. .. py:function:: detect_dominant_read(block) Detect the dominant read indices in the block. .. py:function:: is_broadcast_epilogue(sch, block, epilogue) Check if the epilogue block is a broadcast pattern .. py:function:: get_reduction_blocks(sch, blocks) .. py:function:: get_coalesced_veclen(block_stmt, target_bits = 128)