Skip to content

Latest commit

 

History

History
179 lines (117 loc) · 5.08 KB

yatuner.tuner.md

File metadata and controls

179 lines (117 loc) · 5.08 KB

module yatuner.tuner

Global Variables

  • inf

class Tuner

method __init__

__init__(
    call_compile: Callable[[Sequence[str], Mapping, str], NoneType],
    call_running: Callable[[], float],
    optimizers: Sequence[str],
    parameters: Mapping[str, Tuple],
    call_perf: Callable[[], Dict[str, Any]] = None,
    workspace='yatuner.db',
    log_level=10,
    norm_range=None,
    deterministic=False
) → None

A tuner.

Args:

  • call_compile ((Sequence[str], Mapping, str) -> None): A function runing compilation process.
  • call_running (() -> float): A function fetching result of target program.
  • optimizers (Sequence[str]): List of on/of options.
  • parameters (Mapping[str, Tuple]): List of parameters, in format of param: (min, max, default)
  • call_perf (() -> Dict[str, Any], optional): Fectch feature of given program, used in linUCB. Defaults to None.
  • workspace (str, optional): Directory to store output files. Defaults to 'yatuner.db'.
  • log_level (optional): Log level. Defaults to logging.DEBUG.
  • norm_range (float, optional): Cut the data of test run to get more accurate result, None if doing a symmetrization. Defaults to None.
  • deterministic (bool): False if the result of call_compile is random to a certain extent, otherwise True. Defaults to False.

method hypotest_optimizers

hypotest_optimizers(
    num_samples=10,
    z_threshold=0.05,
    t_threshold=0.05,
    num_epochs=30
)

Hypothesis test for on/of options.

Args:

  • num_samples (int, optional): Sampling times for each option. Defaults to 10.
  • z_threshold (float, optional): Z threshold. Defaults to 0.05.
  • t_threshold (float, optional): T threshold. Defaults to 0.05.
  • num_epochs (int, optional): optimization epoches after selection. Defaults to 30.

method hypotest_parameters

hypotest_parameters(num_samples=10, t_threshold=0.05)

Hypothesis test for parameters.

Args:

  • num_samples (int, optional): Sampling times for each parameter. Defaults to 10.
  • t_threshold (float, optional): T threshold. Defaults to 0.05.

method initialize

initialize()

method optimize

optimize(num_samples=10, num_epochs=60) → None

Optimize selected parameters with bayesian.


method optimize_linUCB

optimize_linUCB(
    alpha=0.5,
    num_epochs=200,
    num_samples=10,
    num_bins=25,
    nth_choice=3,
    metric='cpu-cycles'
) → None

Optimize selected parameters with linUCB.


method plot_data

plot_data() → None

Plot result in violin graph.


method run

run(num_samples=10)

Run result and existing options to compare.

Args:

  • num_samples (int, optional): Sampling times. Defaults to 10.

method test_run

test_run(num_samples=200, warmup=50)

Doing a test run with no options indicated.

Args:

  • num_samples (int, optional): Times to run. Defaults to 200.
  • warmup (int, optional): Times to warmup. Defaults to 50.

This file was automatically generated via lazydocs.