tilelang.carver.template.base ============================= .. py:module:: tilelang.carver.template.base Classes ------- .. autoapisummary:: tilelang.carver.template.base.BaseTemplate Module Contents --------------- .. py:class:: BaseTemplate Bases: :py:obj:`abc.ABC` 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. .. py:method:: get_hardware_aware_configs(arch = None, topk = 10) :abstractmethod: Abstract method that must be implemented by subclasses. It should return a list of hardware-aware configurations (hints) based on the specified architecture. :param arch: The target architecture. Defaults to None. :type arch: TileDevice, optional :param topk: Number of top configurations to return. Defaults to 10. :type topk: int, optional :returns: A list of recommended hardware-aware configurations. :rtype: List[Hint] .. py:method:: with_arch(arch) Sets the architecture for this template and returns itself. :param arch: The architecture to set. :type arch: TileDevice :returns: The instance with the updated architecture. :rtype: BaseTemplate .. py:method:: has_arch() Checks whether the architecture is set. :returns: True if the architecture is set, False otherwise. :rtype: bool .. py:method:: is_volta_arch() Checks if the current architecture is a Volta architecture. :returns: True if the architecture is Volta, False otherwise. :rtype: bool .. py:method:: is_ampere_arch() Checks if the current architecture is an Ampere architecture. :returns: True if the architecture is Ampere, False otherwise. :rtype: bool .. py:method:: is_cdna_arch() Checks if the current architecture is a CDNA architecture. :returns: True if the architecture is CDNA, False otherwise. :rtype: bool .. py:method:: equivalent_function() Returns the function associated with this template. :returns: The stored function. :rtype: PrimFunc .. py:method:: initialize_function() :abstractmethod: Placeholder method that should be implemented by subclasses. This method is responsible for initializing the function. :raises NotImplementedError: If not implemented in the subclass. .. py:method:: set_function(func) Sets the function for this template and returns itself. :param func: The function to associate with this template. :type func: PrimFunc :returns: The instance with the updated function. :rtype: BaseTemplate .. py:method:: set_output_nodes(output_nodes) Sets the output nodes for this template and returns itself. :param output_nodes: The output nodes to associate with this template. :type output_nodes: List[OutputNode] :returns: The instance with the updated output nodes. :rtype: BaseTemplate .. py:method:: recommend_hints(topk = 10) Provides a list of recommended hardware-aware configurations. :param topk: Number of top configurations to return. Defaults to 10. :type topk: int, optional :returns: A list of recommended configurations. :rtype: List[Hint] .. py:property:: arch :type: tilelang.carver.arch.TileDevice Returns the current architecture. :returns: The architecture of this template. :rtype: TileDevice .. py:property:: output_nodes :type: List[tilelang.carver.roller.node.OutputNode] Returns the output nodes associated with this template. :returns: The output nodes. :rtype: List[OutputNode] .. py:method:: __post_init__() Post-initialization method that is called after the data class is created. Ensures that the function is initialized.