コード例 #1
0
ファイル: opentuner_run.py プロジェクト: Detry322/dlmalloc
    def __init__(self, args):
        # Ensure either a file or directory is specified.
        assert args.trace_file != None or args.trace_dir != None

        # Maximize perfidx, and cache the fixed inputs.
        super(MdriverTuner, self).__init__(args,
                                           objective=MaximizeAccuracy(),
                                           input_manager=FixedInputManager())
コード例 #2
0
 def __init__(self, driver, *args, **kwargs):
     """
     Create a new measurement interface with knowledge of the
     queues to communicate with the ctree jit module.
     """
     kwargs['input_manager'] = FixedInputManager()
     super(CtreeMeasurementInterface, self).__init__(*args, **kwargs)
     self._ctree_driver = driver
コード例 #3
0
  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)
コード例 #4
0
ファイル: tuner2.py プロジェクト: yujincheng/streamjit
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()
コード例 #5
0
ファイル: tuner.py プロジェクト: yujincheng/streamjit
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()
コード例 #6
0
ファイル: AxProfTune.py プロジェクト: rod-lin/AxProf
 def __init__(self, args, stableParams, adjParams, accThresh, tuneRuns,
              verifyRuns, inputGen, inputGenParams, runner, spec,
              accMetric):
     self.stableParams = stableParams
     self.adjParams = adjParams
     self.accThresh = accThresh
     self.tuneRuns = tuneRuns
     self.verifyRuns = verifyRuns
     self.inputGen = inputGen
     self.inputGenParams = inputGenParams
     self.runner = runner
     self.spec = spec
     self.accMetric = accMetric
     igParams = inputGenParams(stableParams, 1)
     self.inputData = inputGen(*igParams)
     AxProfUtil.writeDataToFile(self.inputData, AxProf.defaultInputFileName)
     objective = ThresholdAccuracyMinimizeTime(accThresh)
     input_manager = FixedInputManager()
     super(AxProfTunerInterface, self).__init__(args,
                                                objective=objective,
                                                input_manager=input_manager)
コード例 #7
0
 def __init__(self, *args, **kwargs):
     kwargs["objective"] = MaximizeAccuracy()
     kwargs["input_manager"] = FixedInputManager()
     super(ModelTuner, self).__init__(*args, **kwargs)
     self.model = Model(self.run_id)
コード例 #8
0
	def __init__(self, args):
		super(Unicorn, self).__init__(args,
			input_manager=FixedInputManager(),
			objective=MaximizeAccuracy())
コード例 #9
0
            if isinstance(p, sjparameters.sjCompositionParameter):
                p.equal_division(seed_config)
            elif isinstance(p, sjparameters.sjPermutationParameter):
                pass  #p.set_value(config, p.seed_value())
            else:
                seed_config[p.name] = p.value
        seed_config['multiplier'] = m
        seed_configs.append(seed_config)

    # 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()
コード例 #10
0
ファイル: hls_tuner.py プロジェクト: HansGiesen/hls_tuner
    def main(self):
        """
    Main function
    """

        argparser = argparse.ArgumentParser(description='Standalone HLS tuner')
        argparser.add_argument('src_dir',
                               help='Directory with sources',
                               type=os.path.abspath)
        argparser.add_argument('pragma_file',
                               help='Pragma specification file',
                               type=os.path.abspath)
        argparser.add_argument('output_dir',
                               help='Output directory',
                               type=os.path.abspath)
        argparser.add_argument('--overwrite',
                               action='store_true',
                               help='Overwrite existing tuning runs')
        argparser.add_argument('--append',
                               action='store_true',
                               help='Append new tuning run to existing runs')
        argparser.add_argument('--technique',
                               action='store',
                               nargs='*',
                               help="Search technique",
                               default=['AUCBanditMetaTechniqueA'])
        argparser.add_argument('--parallelism',
                               type=int,
                               default=4,
                               help='Number of builds running in parallel')
        argparser.add_argument('--use_prebuilt',
                               action='store_true',
                               help='Use prebuilt kernel (for debugging)')
        argparser.add_argument('--max_luts', type=int, help='LUT constraint')
        argparser.add_argument('--max_regs',
                               type=int,
                               help='Register constraint')
        argparser.add_argument('--max_dsps', type=int, help='DSP constraint')
        argparser.add_argument('--max_brams', type=int, help='BRAM constraint')
        argparser.add_argument('--iters',
                               type=int,
                               help='Number of test iterations')
        argparser.add_argument(
            '--no_cleanup',
            action='store_true',
            help='Do not remove output of successful builds')
        args = argparser.parse_args()

        self.prepare_output_dir(args)

        self.init_logging(args.output_dir)

        new_argparser = argparse.ArgumentParser(parents=opentuner.argparsers())
        new_args = new_argparser.parse_args('', args)
        new_args.database = args.output_dir + '/HLS_tuner.db'
        if args.iters is not None:
            new_args.test_limit = args.iters

        log.info('Search algorithm: ' + str(new_args.technique))

        if args.max_luts or args.max_regs or args.max_dsps or args.max_brams:
            objective = ThresholdAreaMinimizeTime(args.max_luts, args.max_regs,
                                                  args.max_dsps,
                                                  args.max_brams)
        else:
            objective = MinimizeTime()
        input_manager = FixedInputManager()
        VivadoHLSInterface.main(new_args,
                                tuner_root=tuner_root,
                                objective=objective,
                                input_manager=input_manager)