tilelang.engine.param¶

The profiler and convert to torch utils

Classes¶

KernelParam

Represents parameters for a kernel operation, storing dtype and shape information.

CompiledArtifact

Represents a compiled kernel artifact containing both host and device code.

Module Contents¶

class tilelang.engine.param.KernelParam¶

Represents parameters for a kernel operation, storing dtype and shape information. Used to describe tensor or scalar parameters in TVM/PyTorch interop.

dtype: torch.dtype¶
shape: List[int | tvm.tir.Var]¶
classmethod from_buffer(buffer)¶

Creates a KernelParam instance from a TVM Buffer object.

Parameters:

buffer (tvm.tir.Buffer) – TVM Buffer object containing dtype and shape information

Returns:

KernelParam instance with converted dtype and shape

Raises:

ValueError – If dimension type is not supported (not IntImm or Var)

classmethod from_var(var)¶

Creates a KernelParam instance from a TVM Variable object. Used for scalar parameters.

Parameters:

var (tvm.tir.Var) – TVM Variable object containing dtype information

Returns:

KernelParam instance representing a scalar (empty shape)

is_scalar()¶

Checks if the parameter represents a scalar value.

Returns:

True if parameter has no dimensions (empty shape), False otherwise

Return type:

bool

is_unsigned()¶

Checks if the parameter represents an unsigned integer type.

Returns:

True if parameter is an unsigned integer type, False otherwise

Return type:

bool

is_float8()¶

Checks if the parameter represents a float8 type.

Returns:

True if parameter is a float8 type, False otherwise

Return type:

bool

is_boolean()¶

Checks if the parameter represents a boolean type.

Returns:

True if parameter is a boolean type, False otherwise

Return type:

bool

class tilelang.engine.param.CompiledArtifact¶

Represents a compiled kernel artifact containing both host and device code. Stores all necessary components for kernel execution in the TVM runtime.

host_mod: tilelang.tvm.IRModule¶
device_mod: tilelang.tvm.IRModule¶
params: List[KernelParam]¶
kernel_source: str¶
rt_mod: tilelang.tvm.runtime.Module | None = None¶