tilelang.carver.template.gemv

Classes

GEMVTemplate

A template for Generalized Matrix-Vector Multiplication (GEMV).

Module Contents

class tilelang.carver.template.gemv.GEMVTemplate

Bases: tilelang.carver.template.base.BaseTemplate

A template for Generalized Matrix-Vector Multiplication (GEMV).

This template defines the computation for a matrix-vector multiplication with configurable parameters such as transposition, data types, and bias addition.

N: int = None
K: int = None
trans_B: bool = True
in_dtype: str = 'float16'
out_dtype: str = 'float16'
accum_dtype: str = 'float16'
with_bias: bool = False
get_hardware_aware_configs(arch=None, topk=10)

Retrieves optimized hardware-aware configurations.

参数:
  • arch (TileDevice, optional) -- The target hardware architecture.

  • topk (int, optional) -- Number of top configurations to consider.

返回:

A list of optimization hints for hardware acceleration.

返回类型:

List[Hint]

initialize_function()

Defines and initializes the GEMV computation function.

This method sets up placeholders for input matrices, computes the matrix-vector multiplication using TVM's compute API, and optionally applies bias and type casting.

返回类型:

None

params_as_dict()

Returns the template parameters as a dictionary.

返回:

Dictionary containing template parameter values.

返回类型:

dict

property class_attributes

Returns the class attributes in dictionary form.

返回:

Dictionary of class attributes.

返回类型:

dict

__repr__()

Returns a string representation of the class instance.

返回:

A formatted string representation of the class.

返回类型:

str