tilelang.language.eager.utils¶
Attributes¶
Functions¶
|
|
|
A modified version of inspect.getclosurevars |
|
|
|
|
|
Construct contiguous row-major strides from |
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.outandretrieve_strideall 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 thatlen(buffer.strides)is either0orlen(buffer.shape). Entries may beintorPrimExprdepending onshape; passallow_prim_expr=Falseto require fully static strides.- Parameters:
shape (collections.abc.Sequence[Any])
allow_prim_expr (bool)
- Return type:
tuple[Any, Ellipsis]