def start_process(settings, args): for key, value in settings.items(): os.environ[key] = str(value) if os.environ['DMLC_ROLE'] == "server": ad.server_init() ad.server_finish() elif os.environ['DMLC_ROLE'] == "worker": train_hetu(args) elif os.environ['DMLC_ROLE'] == "scheduler": ad.scheduler_init() ad.scheduler_finish() else: raise ValueError("Unknown role", os.environ['DMLC_ROLE'])
def main(setting): for key, value in setting.items(): os.environ[key] = str(value) if os.environ['DMLC_ROLE'] == "server": ad.server_init() ad.server_finish() elif os.environ['DMLC_ROLE'] == "worker": ad.worker_init() worker() ad.worker_finish() elif os.environ['DMLC_ROLE'] == "scheduler": ad.scheduler_init() ad.scheduler_finish() else: raise ValueError("Unknown role", os.environ['DMLC_ROLE'])
def start_process(settings, args): for key, value in settings.items(): os.environ[key] = str(value) if os.environ['DMLC_ROLE'] == "server": ad.server_init() ad.server_finish() elif os.environ['DMLC_ROLE'] == "worker": ad.worker_init() test(args.func) # test_dense_n_draw(range(100000, 1000000, 100000), 'pushpull') # test_sparse_n_draw(range(100, 600, 100), range(1000, 6000, 1000), 'sparsepush') ad.worker_finish() elif os.environ['DMLC_ROLE'] == "scheduler": ad.scheduler_init() ad.scheduler_finish() else: raise ValueError("Unknown role", os.environ['DMLC_ROLE'])
def start_process(settings, args, arr=None, push_arr=None, pull_arr=None): for key, value in settings.items(): os.environ[key] = str(value) if os.environ['DMLC_ROLE'] == "server": ad.server_init() ad.server_finish() elif os.environ['DMLC_ROLE'] == "worker": ad.worker_init() test_api(arr, push_arr, pull_arr) test_init_ps(arr, 'constant', 1234.567) test_init_ps(arr, 'uniform', -0.5, 0.4) test_init_ps(arr, 'normal', 5.6, 2.0) test_init_ps(arr, 'truncated_normal', -2.3, 1.4) test_api(arr, push_arr, pull_arr, True) test_init_ps(arr, 'constant', 1234.567, True) test_init_ps(arr, 'uniform', -0.5, 0.4, True) test_init_ps(arr, 'normal', 5.6, 2.0, True) test_init_ps(arr, 'truncated_normal', -2.3, 1.4, True) ad.worker_finish() elif os.environ['DMLC_ROLE'] == "scheduler": ad.scheduler_init() ad.scheduler_finish() else: raise ValueError("Unknown role", os.environ['DMLC_ROLE'])