Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# The default bandit, plus our custom techniques.
from opentuner.search import technique, bandittechniques, differentialevolution, evolutionarytechniques, simplextechniques
technique.register(bandittechniques.AUCBanditMetaTechnique([
sjtechniques.FixedTechnique(seed_configs),
differentialevolution.DifferentialEvolutionAlt(),
evolutionarytechniques.UniformGreedyMutation(),
evolutionarytechniques.NormalGreedyMutation(mutation_rate=0.3),
simplextechniques.RandomNelderMead(),
sjtechniques.ForceRemove(),
sjtechniques.ForceFuse(),
sjtechniques.ForceUnbox(),
sjtechniques.ForceEqualDivision(),
sjtechniques.CrossSocketBeforeHyperthreadingAffinity(),
], name = "StreamJITBandit"))
mi = StreamJITMI(args, cfg, jvm_options, manipulator, FixedInputManager(), MinimizeTime())
m = TuningRunMain(mi, args)
m.main()
def main(args, cfg, ss):
logging.basicConfig(level=logging.INFO)
manipulator = ConfigurationManipulator()
params = cfg.getAllParameters()
#print "\nFeature variables...."
for key in params.keys():
#print "\t", key
manipulator.add_parameter(cfg.getParameter(key))
mi = StreamJitMI(args, ss, manipulator, FixedInputManager(),
MinimizeTime())
m = TuningRunMain(mi, args)
m.main()
def main(args, cfg, jvmOptions):
logging.basicConfig(level=logging.INFO)
manipulator = ConfigurationManipulator()
params = dict(cfg.items() + jvmOptions.items())
#print "\nFeature variables...."
for key in params.keys():
#print "\t", key
manipulator.add_parameter(params.get(key))
mi = StreamJitMI(args,jvmOptions, manipulator, FixedInputManager(),
MinimizeTime())
m = TuningRunMain(mi, args)
m.main()
def __init__(self, args):
self.program_settings = json.load(open(args.program_settings))
input_manager = FixedInputManager(size=self.program_settings['n'])
objective = ThresholdAccuracyMinimizeTime(self.program_settings['accuracy'])
# pass many settings to parent constructor
super(PetaBricksInterface, self).__init__(
args, program_name=args.program,
program_version=self.file_hash(args.program),
input_manager=input_manager, objective=objective)
def input_manager(self):
"""
called once to create the measurement.inputmanager.InputManager
"""
if self._objective is None:
from .inputmanager import FixedInputManager
return FixedInputManager()
return self._input_manager
def __init__(self,
input_class_name='fixed',
size=-1,
path=None,
extra=None):
self.input_class_name = input_class_name
self.size = size
self.path = path
self.extra = extra
self.the_input = None
super(FixedInputManager, self).__init__()
def main(args, cfg, ss):
logging.basicConfig(level=logging.INFO)
manipulator = ConfigurationManipulator()
params = cfg.getAllParameters()
print "\nFeature variables...."
for key in params.keys():
print "\t", key
manipulator.add_parameter(cfg.getParameter(key))
mi = StreamJitMI(args, ss, manipulator, FixedInputManager(),
MinimizeTime())
m = TuningRunMain(mi, args)
m.main()