tilelang.carver.template.general_reduce module#

class tilelang.carver.template.general_reduce.GeneralReductionTemplate(structure: Union[str, List[str]] = None, shape: List[int] = None, dtype: str = 'float16')#

Bases: BaseTemplate

property class_attributes#
dtype: str = 'float16'#
get_hardware_aware_configs(arch: Optional[TileDevice] = None, topk: int = 10) List[Hint]#

Abstract method that must be implemented by subclasses. It should return a list of hardware-aware configurations (hints) based on the specified architecture.

Parameters:
  • arch (TileDevice, optional) – The target architecture. Defaults to None.

  • topk (int, optional) – Number of top configurations to return. Defaults to 10.

Returns:

A list of recommended hardware-aware configurations.

Return type:

List[Hint]

initialize_function() None#

Parse the structure (e.g., ‘SSR’), build the TVM compute definition with the appropriate spatial and reduce axes, and store it in self._func.

params_as_dict()#
shape: List[int] = None#
structure: Union[str, List[str]] = None#