tilelang.language.eager.utils¶

Attributes¶

Functions¶

disk_compile(source, name)

get_func_nonlocals(func)

A modified version of inspect.getclosurevars

get_ast(func)

get_compiled_object(source, name[, filename, globals])

construct_strides(shape[, allow_prim_expr])

Construct contiguous row-major strides from shape.

Module Contents¶

tilelang.language.eager.utils.disk_compile(source, name)¶
tilelang.language.eager.utils.get_func_nonlocals(func)¶

A modified version of inspect.getclosurevars

tilelang.language.eager.utils.get_ast(func)¶
Parameters:

func (collections.abc.Callable)

tilelang.language.eager.utils.CompileMethod¶
tilelang.language.eager.utils.get_compiled_object(source, name, filename=None, globals=None)¶
Parameters:
  • source (str | ast.AST)

  • name (str)

  • filename (str)

  • globals (dict[str, Any])

tilelang.language.eager.utils.construct_strides(shape, allow_prim_expr=True)¶

Construct contiguous row-major strides from shape.

This is the single source of truth for default (contiguous) strides in the Python frontend; T.Tensor, T.out and retrieve_stride all route here so they cannot drift apart.

The result always has the same rank as shape. In particular a rank-0 (scalar) shape yields an empty stride tuple, matching the TIR convention that len(buffer.strides) is either 0 or len(buffer.shape). Entries may be int or PrimExpr depending on shape; pass allow_prim_expr=False to require fully static strides.

Parameters:
  • shape (collections.abc.Sequence[Any])

  • allow_prim_expr (bool)

Return type:

tuple[Any, Ellipsis]