示例#1
0
    def test_ps_cpu_geo(self):
        self.init()
        self.config['ps_mode_config'] = "../ps/cpu_geo_ps_config.yaml"
        self.config['run_the_one_ps'] = '1'

        self.config['debug_the_one_ps'] = '0'
        self.config['log_dir'] = ps_log_root_dir + "geo_cpu_log_old_the_one_ps"
        remove_path_if_exists(self.config['log_dir'])
        self.ps_launch()

        self.config['debug_the_one_ps'] = '1'
        self.config['log_dir'] = ps_log_root_dir + "geo_cpu_log_new_the_one_ps"
        remove_path_if_exists(self.config['log_dir'])
        self.ps_launch()

        desc1 = '/ps_desc_baseline/geo_worker_ps_desc'
        desc2 = '/ps_log/geo_new_worker_ps_desc'
        desc3 = '/ps_desc_baseline/geo_server_ps_desc'
        desc4 = '/ps_log/geo_new_server_ps_desc'
        if self.check(desc1, desc2):
            logger.info('test_ps_cpu_geo ps_desc: worker passed!')
        else:
            logger.info('test_ps_cpu_geo ps_desc: worker failed!')
        if self.check(desc3, desc4):
            logger.info('test_ps_cpu_geo ps_desc: server passed!')
        else:
            logger.info('test_ps_cpu_geo ps_desc: server failed!')
示例#2
0
    def test_ps_optimizer_minimize_cpu_geo(self):
        self.init()
        self.config['ps_mode_config'] = "../ps/cpu_geo_ps_config.yaml"
        self.config['run_minimize'] = '1'

        self.config['debug_new_minimize'] = '0'
        self.config['log_dir'] = ps_log_root_dir + "geo_cpu_log_old_minimize"
        remove_path_if_exists(self.config['log_dir'])
        self.ps_launch()

        self.config['debug_new_minimize'] = '1'
        self.config['log_dir'] = ps_log_root_dir + "geo_cpu_log_new_minimize"
        remove_path_if_exists(self.config['log_dir'])
        self.ps_launch()

        file1 = './ps_log/geo_run_minimize_debug:_0_worker_main.prototxt'
        file2 = './ps_log/geo_run_minimize_debug:_1_worker_main.prototxt'
        if self.check(file1, file2):
            logger.info('test_ps_optimizer_minimize_cpu_geo passed!')
        else:
            logger.error('test_ps_optimizer_minimize_cpu_geo failed!')
示例#3
0
    def test_append_send_ops_pass(self):
        self.init()
        self.config['run_single_pass'] = '******'
        self.config['ps_mode_config'] = "../ps/cpu_async_ps_config.yaml"
        self.config['applied_pass_name'] = "append_send_ops_pass"

        self.config['debug_new_pass'] = '******'
        self.config['log_dir'] = ps_log_root_dir + "log_old_" + self.config[
            'applied_pass_name']
        remove_path_if_exists(self.config['log_dir'])
        self.ps_launch("cpu-ps")

        self.config['debug_new_pass'] = '******'
        self.config['log_dir'] = ps_log_root_dir + "log_new_" + self.config[
            'applied_pass_name']
        remove_path_if_exists(self.config['log_dir'])
        self.ps_launch("cpu-ps")

        file1 = './ps_log/async_append_send_ops_pass_debug:_0_worker_main.prototxt'
        file2 = './ps_log/async_append_send_ops_pass_debug:_1_worker_main.prototxt'
        if self.check(file1, file2):
            logger.info('test_append_send_ops_pass passed!')
        else:
            logger.info('test_append_send_ops_pass failed!')