tilelang.autotuner.capture

Classes

CaptureStack

A simple stack implementation for capturing items in a thread-local context.

AutotuneInputsCapture

Functions

set_autotune_inputs(*args)

Set input tensors for auto-tuning.

get_autotune_inputs()

Get the current autotune inputs from the stack.

Module Contents

class tilelang.autotuner.capture.CaptureStack

A simple stack implementation for capturing items in a thread-local context. Used to manage a stack of items (e.g., input tensors) for auto-tuning capture.

stack = []
push(item)

Push an item onto the top of the stack.

参数:

item -- The item to be pushed onto the stack.

pop()

Pop and return the top item from the stack.

返回:

The item at the top of the stack.

抛出:

IndexError -- If the stack is empty.

top()

Return the item at the top of the stack without removing it.

返回:

The item at the top of the stack.

抛出:

IndexError -- If the stack is empty.

size()

Return the number of items in the stack.

返回:

The size of the stack.

返回类型:

int

__len__()

Return the number of items in the stack (len operator support).

返回:

The size of the stack.

返回类型:

int

__bool__()

Return True if the stack is not empty, False otherwise.

返回:

Whether the stack contains any items.

返回类型:

bool

class tilelang.autotuner.capture.AutotuneInputsCapture(tensors)
参数:

tensors (list[Any])

__slots__ = 'tensors'
tensors
__enter__()
返回类型:

None

__exit__(exc_type, exc_val, exc_tb)
tilelang.autotuner.capture.set_autotune_inputs(*args)

Set input tensors for auto-tuning.

This function creates a context manager for capturing input tensors during the auto-tuning process. It supports both:

set_autotune_inputs(a, b, c) set_autotune_inputs([a, b, c])

参数:

*args -- Either a single list/tuple of tensors, or multiple tensor arguments.

返回:

A context manager for auto-tuning inputs.

返回类型:

AutotuneInputsCapture

tilelang.autotuner.capture.get_autotune_inputs()

Get the current autotune inputs from the stack.

返回类型:

list[Any] | None