tilelang.autotuner.capture¶
Classes¶
A simple stack implementation for capturing items in a thread-local context. |
|
Functions¶
|
Set input tensors for auto-tuning. |
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.
- Parameters:
item – The item to be pushed onto the stack.
- pop()¶
Pop and return the top item from the stack.
- Returns:
The item at the top of the stack.
- Raises:
IndexError – If the stack is empty.
- top()¶
Return the item at the top of the stack without removing it.
- Returns:
The item at the top of the stack.
- Raises:
IndexError – If the stack is empty.
- size()¶
Return the number of items in the stack.
- Returns:
The size of the stack.
- Return type:
int
- __len__()¶
Return the number of items in the stack (len operator support).
- Returns:
The size of the stack.
- Return type:
int
- __bool__()¶
Return True if the stack is not empty, False otherwise.
- Returns:
Whether the stack contains any items.
- Return type:
bool
- class tilelang.autotuner.capture.AutotuneInputsCapture(tensors)¶
- Parameters:
tensors (List[Any])
- __slots__ = 'tensors'¶
- tensors¶
- __enter__()¶
- Return type:
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])
- Parameters:
*args – Either a single list/tuple of tensors, or multiple tensor arguments.
- Returns:
A context manager for auto-tuning inputs.
- Return type:
- tilelang.autotuner.capture.get_autotune_inputs()¶
Get the current autotune inputs from the stack.
- Return type:
Optional[List[Any]]