xma.xtuner.tuner

class XTunedFunction(function: Callable, configs: list[XTuneConfig], triggers: set[str], warmup_iterations: int, benchmark_iterations: int, functional_triggers: dict[str, Callable] = {}, reset_to_zero: dict = {})[source]

Bases: object

xtune(configs: list[XTuneConfig], triggers: set[str] = {}, functional_triggers: dict[str, Callable] = {}, warmup_iterations: int = 5, benchmark_iterations: int = 10, reset_to_zero: dict = {}) XTunedFunction[source]

autotuner for any function or kernel

Parameters:
  • configs (list[XTuneConfig]) – list of configs to autotune over

  • triggers (set[str]) – change in these parameters will trigger autotuning

  • functional_triggers (dict[str, Callable]) – key, function mapping. change in the function outputs will trigger autotuning.

  • warmup_iterations (int) – iterations for warmup. Defaults to 5.

  • benchmark_iterations (int) – iterations for benchmarking. Defaults to 10.

  • reset_to_zero (dict) – A dictionary mapping tensor argument names to an optional callable condition. The specified tensors will be zeroed out after each benchmark iteration if the condition (if provided) returns True.

Returns:

autotuned version of the function

Return type:

_XTune