Ejemplo n.º 1
0
    def manipulator(self):
        """
    Returns an object that represents the parameters that can be tuned.
    """

        manipulator = ConfigurationManipulator()
        if 'ExhaustiveSearch' in self.args.technique:
            #      manipulator.add_parameter(EnumParameter("CLOCK", ['0', '1', '2', '3']))
            #      manipulator.add_parameter(EnumParameter("KERNEL_CLOCK", ['0', '1', '2', '3']))
            manipulator.add_parameter(LogIntegerParameter("CONVOLVERS", 1, 16))
            manipulator.add_parameter(
                IntegerParameter("BIN_DENSE_PIPELINE", 1, 16))
#      manipulator.add_parameter(IntegerParameter("FP_CONV_UNROLL", 1, 16))
        else:
            manipulator.add_parameter(
                EnumParameter("KERNEL_CLOCK", ['0', '1', '2', '3']))
            manipulator.add_parameter(
                FloatParameter("CLOCK_UNCERTAINTY", 0, 100))
            manipulator.add_parameter(
                EnumParameter("DATA_MOVER_CLOCK", ['0', '1', '2', '3']))
            manipulator.add_parameter(
                EnumParameter("DATA_MOVER_SHARING", ['0', '1', '2', '3']))
            manipulator.add_parameter(IntegerParameter("IMPL_STRATEGY", 0, 27))
            manipulator.add_parameter(
                LogIntegerParameter("CONVOLVERS", 1, 16, prior="inc"))
            manipulator.add_parameter(
                IntegerParameter("BIN_DENSE_PIPELINE", 1, 16, prior="dec"))
            manipulator.add_parameter(
                IntegerParameter("FP_CONV_UNROLL", 1, 16, prior="inc"))
        return manipulator
Ejemplo n.º 2
0
    def manipulator(self):
        """
    Define the search space by creating a
    ConfigurationManipulator
    """
        manipulator = ConfigurationManipulator()

        num_options = len(self.passes) - 1

        # choose for a sequence of at most `max_passes` passes
        for i in range(self.max_passes):
            passNum = 'pass_' + str(i)
            # some pass
            manipulator.add_parameter(IntegerParameter(passNum, 0,
                                                       num_options))
            # and whether to turn it on or off
            manipulator.add_parameter(
                EnumParameter('enable_' + passNum, [True, False]))

        # choose from a set of knobs
        for knob, minInt, maxInt in self.knobs:
            manipulator.add_parameter(IntegerParameter(knob, minInt, maxInt))
            manipulator.add_parameter(
                EnumParameter('enable_' + knob, [True, False]))

        return manipulator
Ejemplo n.º 3
0
    def manipulator(self):
        """
    Returns an object that represents the parameters that can be tuned.
    """

        manipulator = ConfigurationManipulator()
        manipulator.add_parameter(BooleanParameter("PIPELINE_SUB"))
        manipulator.add_parameter(BooleanParameter("PIPELINE_ADDKEY"))
        manipulator.add_parameter(BooleanParameter("PIPELINE_CPKEY"))
        manipulator.add_parameter(BooleanParameter("PIPELINE_MIX"))
        manipulator.add_parameter(BooleanParameter("PIPELINE_EXP1"))
        manipulator.add_parameter(BooleanParameter("PIPELINE_EXP2"))
        manipulator.add_parameter(BooleanParameter("PIPELINE_ECB1"))
        manipulator.add_parameter(BooleanParameter("PIPELINE_ECB2"))
        manipulator.add_parameter(BooleanParameter("PIPELINE_ECB3"))
        manipulator.add_parameter(
            IntegerParameter("UNROLL_FACTOR_SUB", 1, 16, prior="inc"))
        manipulator.add_parameter(
            IntegerParameter("UNROLL_FACTOR_ADDKEY", 1, 16, prior="inc"))
        manipulator.add_parameter(
            IntegerParameter("UNROLL_FACTOR_CPKEY", 1, 16, prior="inc"))
        manipulator.add_parameter(
            IntegerParameter("UNROLL_FACTOR_MIX", 1, 4, prior="inc"))
        manipulator.add_parameter(
            IntegerParameter("UNROLL_FACTOR_EXP1", 1, 3, prior="inc"))
        manipulator.add_parameter(
            IntegerParameter("UNROLL_FACTOR_EXP2", 1, 3, prior="inc"))
        manipulator.add_parameter(
            IntegerParameter("UNROLL_FACTOR_ECB1", 1, 32, prior="inc"))
        manipulator.add_parameter(
            IntegerParameter("UNROLL_FACTOR_ECB2", 1, 8, prior="inc"))
        manipulator.add_parameter(
            IntegerParameter("UNROLL_FACTOR_ECB3", 1, 13, prior="inc"))
        manipulator.add_parameter(
            IntegerParameter("PIPELINE_II_SUB", 1, 16, prior="dec"))
        manipulator.add_parameter(
            IntegerParameter("PIPELINE_II_ADDKEY", 1, 16, prior="dec"))
        manipulator.add_parameter(
            IntegerParameter("PIPELINE_II_CPKEY", 1, 16, prior="dec"))
        manipulator.add_parameter(
            IntegerParameter("PIPELINE_II_MIX", 1, 4, prior="dec"))
        manipulator.add_parameter(
            IntegerParameter("PIPELINE_II_EXP1", 1, 3, prior="dec"))
        manipulator.add_parameter(
            IntegerParameter("PIPELINE_II_EXP2", 1, 3, prior="dec"))
        manipulator.add_parameter(
            IntegerParameter("PIPELINE_II_ECB1", 1, 32, prior="dec"))
        manipulator.add_parameter(
            IntegerParameter("PIPELINE_II_ECB2", 1, 8, prior="dec"))
        manipulator.add_parameter(
            IntegerParameter("PIPELINE_II_ECB3", 1, 13, prior="dec"))
        manipulator.add_parameter(
            EnumParameter("KERNEL_CLOCK", ['0', '1', '2', '3']))
        manipulator.add_parameter(
            EnumParameter("DATA_MOVER_CLOCK", ['0', '1', '2', '3']))
        return manipulator
Ejemplo n.º 4
0
 def manipulator(self):
     """
     Define the search space by creating a
     ConfigurationManipulator
     """
     manipulator = ConfigurationManipulator()
     manipulator.add_parameter(
         LogFloatParameter('learning_rate', 1e-5, 1e-1))
     manipulator.add_parameter(EnumParameter('gamma', [0.9, 0.99, 0.9999]))
     manipulator.add_parameter(EnumParameter('batch_size', [32, 64, 256]))
     manipulator.add_parameter(EnumParameter('n_steps', [128]))
     return manipulator
Ejemplo n.º 5
0
    def manipulator(self):

        """
        Define the search space by creating a
        ConfigurationManipulator
        """

        self.transformation(gl.spark_parameter)

        manipulator = ConfigurationManipulator()

        manipulator.add_parameter(
            IntegerParameter('BLOCK_SIZE', 1, 1))

        # print 'in manipulator'
        for flag in self.enum_param:
            # print flag[0], flag[1]
            manipulator.add_parameter(
                EnumParameter(flag[0],
                              flag[1]))
        for i in self.int_param:
            manipulator.add_parameter(
                IntegerParameter(i[0], int(i[1]), int(i[2])))

        return manipulator
Ejemplo n.º 6
0
    def manipulator(self):
        """                                                                          
        Define the search space by creating a                                        
        ConfigurationManipulator                                                     
        """

        # set the global flags needed for printing schedules
        if self.args.enable_NUMA_tuning == 0:
            self.enable_NUMA_tuning = False
        if self.args.enable_parallel_tuning == 0:
            self.enable_parallel_tuning = False
        if self.args.enable_denseVertexSet_tuning == 0:
            self.enable_denseVertexSet_tuning = False

        manipulator = ConfigurationManipulator()
        manipulator.add_parameter(
            EnumParameter('direction', [
                'SparsePush', 'DensePull', 'SparsePush-DensePull',
                'DensePush-SparsePush'
            ]))

        if self.enable_parallel_tuning:
            manipulator.add_parameter(
                EnumParameter('parallelization', [
                    'dynamic-vertex-parallel',
                    'edge-aware-dynamic-vertex-parallel'
                ]))
        else:
            manipulator.add_parameter(
                EnumParameter('parallelization', ['serial']))

        manipulator.add_parameter(
            IntegerParameter('numSSG', 1, self.args.max_num_segments))

        if self.enable_NUMA_tuning:
            manipulator.add_parameter(
                EnumParameter('NUMA', ['serial', 'static-parallel']))

        if self.enable_denseVertexSet_tuning:
            manipulator.add_parameter(
                EnumParameter('DenseVertexSet',
                              ['boolean-array', 'bitvector']))

        return manipulator
Ejemplo n.º 7
0
 def manipulator(self):
     """
     Define the search space by creating a
     ConfigurationManipulator
     """
     manipulator = ConfigurationManipulator()
     for flag in OPT_FLAGS:
         manipulator.add_parameter(
             EnumParameter(flag, ['on', 'off', 'default']))
     return manipulator
Ejemplo n.º 8
0
 def manipulator(self):
   manipulator = ConfigurationManipulator()
   for item in self.param:
     param_type, param_name, param_range = item
     if param_type == 'EnumParameter':
       manipulator.add_parameter(EnumParameter(param_name, param_range))
     elif param_type == 'IntegerParameter' :
       manipulator.add_parameter(IntegerParameter(param_name, param_range[0], param_range[1]))
     elif param_type == 'FloatParameter' :
       manipulator.add_parameter(FloatParameter(param_name, param_range[0], param_range[1]))
   return manipulator
Ejemplo n.º 9
0
 def manipulator(self):
     """
 Define the search space by creating a
 ConfigurationManipulator
 """
     manipulator = ConfigurationManipulator()
     # manipulator.add_parameter(
     #   IntegerParameter('blockSize', 8,16))
     manipulator.add_parameter(IntegerParameter('opt_level', 0, 3))
     manipulator.add_parameter(
         EnumParameter('blockSize', ['8', '16', '32', '64', '128']))
     return manipulator
Ejemplo n.º 10
0
 def manipulator(self):
     """
 Define the search space by creating a
 ConfigurationManipulator
 """
     manipulator = ConfigurationManipulator()
     manipulator.add_parameter(IntegerParameter('opt_level', 0, 3))
     for flag in GCC_FLAGS:
         manipulator.add_parameter(
             EnumParameter(flag, ['on', 'off', 'default']))
     for param, min, max in GCC_PARAMS:
         manipulator.add_parameter(IntegerParameter(param, min, max))
     return manipulator
Ejemplo n.º 11
0
    def manipulator(self):

        manipulator = ConfigurationManipulator()
        manipulator.add_parameter(
            LogIntegerParameter("INIT_INTERVAL_HOR", 1, 16))
        manipulator.add_parameter(
            LogIntegerParameter("INIT_INTERVAL_VER", 1, 16))
        manipulator.add_parameter(IntegerParameter("UNROLL_FACTOR_HOR", 1, 2))
        manipulator.add_parameter(IntegerParameter("UNROLL_FACTOR_VER", 1, 2))
        manipulator.add_parameter(
            LogIntegerParameter("ARRAY_PARTITION_FACTOR", 1, 15))
        manipulator.add_parameter(
            EnumParameter("ACCELERATOR_1_CLOCK", ['0', '1', '2', '3']))
        manipulator.add_parameter(
            EnumParameter("ACCELERATOR_2_CLOCK", ['0', '1', '2', '3']))
        manipulator.add_parameter(
            FloatParameter("ACCELERATOR_1_UNCERTAINTY", 0, 100))
        manipulator.add_parameter(
            FloatParameter("ACCELERATOR_2_UNCERTAINTY", 0, 100))
        manipulator.add_parameter(
            EnumParameter("DATA_MOVER_CLOCK", ['0', '1', '2', '3']))
        return manipulator
    def manipulator(self):
        """Define the search space by creating a
		ConfigurationManipulator
		"""
        list_configs = []
        list_configs = read_file_configs()
        manipulator = ConfigurationManipulator()
        print "Executing manipulator"
        for param, mini, maxi in BLOCO_PARAMETROS:
            #print "param: ", param, " mini: ", mini, " maxi: ", maxi
            manipulator.add_parameter(IntegerParameter(param, mini, maxi))

        # E preciso gerar as configuracoes validas com o run.c.
        # manipulator.add_parameter(EnumParameter(param, [ 'gx:1024, gy:1, gz:1, bx:1, by:1, bz:1, ', 'gx:32, gy:32, gz:1, bx:1, by:1, bz:1, ' ]))
        for param in BLOCO_PARAMETROS_CONFIGS:
            manipulator.add_parameter(EnumParameter(param, list_configs))
        return manipulator
Ejemplo n.º 13
0
 def parse_line(self, line, manipulator):
     """
     Parse one line from configuration file
     """
     line = line.split()
     if (line[0] == 'parameter'):
         if (line[1] == 'int'):
             manipulator.add_parameter(IntegerParameter(line[2], line[3], line[4]))
         elif (line[1] == 'float'):
             manipulator.add_parameter(FloatParameter(line[2], line[3], line[4]))
         elif (line[1] == 'enum'):
             manipulator.add_parameter(EnumParameter(line[2], line[3:]))
         else:
             raise NameError('Incorrect Configuration file')
     elif (line[0] == 'compile'):
         self.gcc_cmd = ' '.join(line[1:])
     elif (line[0] == 'run'):
         self.run_cmd = ' '.join(line[1:])
     else:
         raise NameError('Incorrect Configuration file')
Ejemplo n.º 14
0
    def manipulator(self):
        """                                                                          
        Define the search space by creating a                                        
        ConfigurationManipulator                                                     
        """

        # set the global flags needed for printing schedules
        if self.args.enable_NUMA_tuning == 0:
            self.enable_NUMA_tuning = False
        if self.args.enable_parallel_tuning == 0:
            self.enable_parallel_tuning = False
        if self.args.enable_denseVertexSet_tuning == 0:
            self.enable_denseVertexSet_tuning = False


        manipulator = ConfigurationManipulator()
        manipulator.add_parameter(
            EnumParameter('direction', 
                          ['SparsePush','DensePull', 'SparsePush-DensePull', 'DensePush-SparsePush']))

        #'edge-aware-dynamic-vertex-parallel' not supported with the latest g++ cilk implementation
        if self.enable_parallel_tuning:
            manipulator.add_parameter(EnumParameter('parallelization',['dynamic-vertex-parallel'])) 
        else:
            manipulator.add_parameter(EnumParameter('parallelization', ['serial']))

        manipulator.add_parameter(IntegerParameter('numSSG', 1, self.args.max_num_segments))
        
        if self.enable_NUMA_tuning:
            manipulator.add_parameter(EnumParameter('NUMA',['serial','static-parallel']))

        if self.enable_denseVertexSet_tuning:
            manipulator.add_parameter(EnumParameter('DenseVertexSet', ['boolean-array', 'bitvector']))

        # adding new parameters for PriorityGraph (Ordered GraphIt) 
        manipulator.add_parameter(IntegerParameter('delta', 1, self.args.max_delta))

        manipulator.add_parameter(
            EnumParameter('bucket_update_strategy', 
                          ['eager_priority_update','eager_priority_update_with_merge', 'lazy_priority_update']))

        return manipulator
Ejemplo n.º 15
0
 def manipulator(self):
     """
 Define the search space by creating a
 ConfigurationManipulator
 """
     manipulator = ConfigurationManipulator()
     manipulator.add_parameter(
         EnumParameter('hibench.yarn.executor.cores',
                       ['1', '4', '8', '16', '24', '48']))
     manipulator.add_parameter(
         EnumParameter('hibench.yarn.executor.num',
                       ['1', '2', '3', '6', '12', '48']))
     manipulator.add_parameter(IntegerParameter('spark.task.cpus', 1, 4))
     manipulator.add_parameter(
         EnumParameter('spark.shuffle.compress', ['1', '0']))
     manipulator.add_parameter(
         EnumParameter('spark.memory.fraction',
                       ['0.25', '0.4', '0.5', '0.6', '0.7', '0.8']))
     manipulator.add_parameter(EnumParameter('spark.serializer',
                                             ['0', '1']))
     manipulator.add_parameter(
         EnumParameter('spark.scheduler.maxRegisteredResourcesWaitingTime',
                       ['10', '15', '25', '30', '40', '60']))
     manipulator.add_parameter(
         EnumParameter(
             'spark.default.parallelism',
             ['8', '15', '25', '35', '50', '-1'
              ]))  #-1 represents default value of config and we need it
     manipulator.add_parameter(
         EnumParameter('spark.sql.shuffle.partitions',
                       ['75', '100', '150', '200', '250', '400']))
     manipulator.add_parameter(
         EnumParameter('spark.cleaner.periodicGC.interval',
                       ['5', '10', '15', '30', '35', '60']))
     manipulator.add_parameter(
         EnumParameter('spark.io.compression.lz4.blockSize',
                       ['8', '16', '32', '40', '64', '80']))
     manipulator.add_parameter(
         EnumParameter('spark.memory.storageFraction',
                       ['0.3', '0.35', '0.4', '0.5', '0.6', '0.7']))
     manipulator.add_parameter(
         EnumParameter('spark.yarn.am.memory',
                       ['256', '400', '512', '750', '1000', '1500']))
     manipulator.add_parameter(
         EnumParameter('spark.scheduler.revive.interval',
                       ['1000', '1500', '2000', '2500', '3000', '4000']))
     manipulator.add_parameter(
         EnumParameter('spark.locality.wait.process',
                       ['1500', '2000', '2500', '3000', '4000', '6000']))
     manipulator.add_parameter(
         EnumParameter('spark.shuffle.sort.bypassMergeThreshold',
                       ['75', '100', '150', '200', '250', '400']))
     manipulator.add_parameter(
         EnumParameter('spark.shuffle.io.preferDirectBufs', ['1', '0']))
     manipulator.add_parameter(
         EnumParameter('spark.task.maxFailures',
                       ['1', '2', '3', '4', '6', '8']))
     manipulator.add_parameter(
         EnumParameter('spark.files.openCostInBytes', [
             '1000000', '2000000', '3500000', '4194304', '7000000',
             '9000000'
         ]))
     manipulator.add_parameter(
         EnumParameter('spark.shuffle.file.buffer',
                       ['16', '28', '32', '45', '64', '80']))
     manipulator.add_parameter(
         EnumParameter('spark.cleaner.referenceTracking.blocking',
                       ['1', '0']))
     manipulator.add_parameter(
         EnumParameter('spark.kryoserializer.buffer.max',
                       ['24', '32', '50', '64', '90', '128']))
     manipulator.add_parameter(
         EnumParameter('spark.executor.memory', [
             '600', '1000', '2400', '4800', '9600', '19200', '54000',
             '108000'
         ]))
     return manipulator
Ejemplo n.º 16
0
 def manipulator(self):
     self._manipulator = PortfolioManipulator(self._max_sum)
     for i in range (self._solvers):
         self._manipulator.add_parameter(EnumParameter(self._names + str(i),
                                                       self._values))
     return self._manipulator