tilelang.autotuner.capture

類別

CaptureStack

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

AutotuneInputsCapture

函式

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