def start_forever_strategy(wf): """ executes forever - changes must come from definition file """ info("> ExecStrategy | Forever ", Fore.CYAN) wf.totalExperiments = -1 while True: experimentFunction(wf, { "knobs": {"forever": True}, "ignore_first_n_results": wf.execution_strategy["ignore_first_n_results"], "sample_size": wf.execution_strategy["sample_size"], })
def start_sequential_strategy(wf): """ executes all experiments from the definition file """ info("> ExecStrategy | Sequential", Fore.CYAN) wf.totalExperiments = len(wf.execution_strategy["knobs"]) for kn in wf.execution_strategy["knobs"]: experimentFunction( wf, { "knobs": kn, "ignore_first_n_results": wf.execution_strategy["ignore_first_n_results"], "sample_size": wf.execution_strategy["sample_size"], })
def start_sequential_strategy(wf): applyInitKnobs(wf) """ executes all experiments from the definition file """ info("> ExecStrategy | Sequential", Fore.CYAN) wf.totalExperiments = len(wf.execution_strategy["knobs"]) for knob in wf.execution_strategy["knobs"]: knob = parseKnobs(knob) wf.setup_stage(wf, knob) experimentFunction(wf, { "knobs": knob, "ignore_first_n_samples": wf.primary_data_provider["ignore_first_n_samples"], "sample_size": wf.execution_strategy["sample_size"], }) # finished info(">") applyDefaultKnobs(wf)
def self_optimizer_execution(wf, opti_values, variables): """ this is the function we call and that returns a value for optimization """ knob_object = recreate_knob_from_optimizer_values(variables, opti_values) # create a new experiment to run in execution exp = dict() exp["ignore_first_n_results"] = wf.execution_strategy[ "ignore_first_n_results"] exp["sample_size"] = wf.execution_strategy["sample_size"] exp["knobs"] = knob_object return experimentFunction(wf, exp)
def self_optimizer_execution(wf, opti_values, variables): """ this is the function we call and that returns a value for optimization """ knob_object = recreate_knob_from_optimizer_values(variables, opti_values) print("knob_object in self_opt_execution", knob_object) # create a new experiment to run in execution exp = dict() exp["ignore_first_n_samples"] = wf.primary_data_provider[ "ignore_first_n_samples"] exp["sample_size"] = wf.execution_strategy["sample_size"] exp["knobs"] = knob_object wf.setup_stage(wf, exp["knobs"]) return experimentFunction(wf, exp)
def step_execution(wf, knob): """ runs a single step_execution experiment """ knob = parseKnobs(knob) debug("knob in step_execution" + str(knob), Fore.GREEN) # create a new experiment to run in execution exp = dict() exp["ignore_first_n_samples"] = wf.primary_data_provider[ "ignore_first_n_samples"] # anova process will call this part, so set sample_size accordingly exp["sample_size"] = wf.analysis["sample_size"] exp["knobs"] = knob wf.setup_stage(wf, exp["knobs"]) return experimentFunction(wf, exp)
def step_execution(wf, configuration, variables): """ runs a single step_execution experiment """ knob_object = recreate_knob_from_step_explorer_values( variables, configuration) debug("knob_object in step_execution" + str(knob_object), Fore.GREEN) # create a new experiment to run in execution exp = dict() exp["ignore_first_n_results"] = wf.execution_strategy[ "ignore_first_n_results"] exp["sample_size"] = wf.execution_strategy["sample_size"] exp["knobs"] = knob_object wf.setup_stage(wf, exp["knobs"]) return experimentFunction(wf, exp)
def random_execution(wf, optimum_values, variables): """ this is the function we call and that returns a value for optimization """ knob_object = recreate_knob_from_optimizer_values(variables, optimum_values) # create a new experiment to run in execution exp = dict() exp["ignore_first_n_results"] = wf.execution_strategy[ "ignore_first_n_results"] exp["sample_size"] = wf.execution_strategy["sample_size"] exp["knobs"] = knob_object wf.setup_stage(wf, exp["knobs"]) execution_result = experimentFunction(wf, exp) info("> | execution_result: " + str(execution_result)) return execution_result