tilelang.carver.template.general_reduce¶

Classes¶

GeneralReductionTemplate

Base class template for hardware-aware configurations.

Module Contents¶

class tilelang.carver.template.general_reduce.GeneralReductionTemplate¶

Bases: tilelang.carver.template.base.BaseTemplate

Base class template for hardware-aware configurations. This serves as an abstract base class (ABC) that defines the structure for subclasses implementing hardware-specific optimizations.

structure: str | List[str] = None¶
shape: List[int] = None¶
dtype: str = 'float16'¶
get_hardware_aware_configs(arch=None, topk=10)¶

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()¶

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

Return type:

None

params_as_dict()¶
property class_attributes¶
__repr__()¶
Return type:

str