[BREAKING] prevent multi-gpu usage (#4749)

* prevent multi-gpu usage

* fix distributed test

* combine gpu predictor tests

* set upper bound on n_gpus
This commit is contained in:
Rong Ou
2019-08-12 14:11:35 -07:00
committed by Rory Mitchell
parent 198f3a6c4a
commit c5b229632d
14 changed files with 59 additions and 298 deletions

View File

@@ -29,15 +29,3 @@ class TestGPULinear(unittest.TestCase):
param, 150, self.datasets, scale_features=True)
test_linear.assert_regression_result(results, 1e-2)
test_linear.assert_classification_result(results)
@pytest.mark.mgpu
@pytest.mark.skipif(**tm.no_sklearn())
def test_gpu_coordinate_mgpu(self):
parameters = self.common_param.copy()
parameters['n_gpus'] = [-1]
parameters['gpu_id'] = [1]
for param in test_linear.parameter_combinations(parameters):
results = test_linear.run_suite(
param, 150, self.datasets, scale_features=True)
test_linear.assert_regression_result(results, 1e-2)
test_linear.assert_classification_result(results)

View File

@@ -36,17 +36,6 @@ class TestGPU(unittest.TestCase):
cpu_results = run_suite(param, select_datasets=datasets)
assert_gpu_results(cpu_results, gpu_results)
@pytest.mark.mgpu
def test_gpu_hist_mgpu(self):
variable_param = {'n_gpus': [-1], 'max_depth': [2, 10],
'max_leaves': [255, 4],
'max_bin': [2, 256],
'grow_policy': ['lossguide'], 'debug_synchronize': [True]}
for param in parameter_combinations(variable_param):
param['tree_method'] = 'gpu_hist'
gpu_results = run_suite(param, select_datasets=datasets)
assert_results_non_increasing(gpu_results, 1e-2)
@pytest.mark.mgpu
def test_specified_gpu_id_gpu_update(self):
variable_param = {'n_gpus': [1],

View File

@@ -25,7 +25,7 @@ cols = 31
# reduced to fit onto 1 gpu but still be large
rows3 = 5000 # small
rows2 = 4360032 # medium
rows1 = 42360032 # large
rows1 = 32360032 # large
# rows1 = 152360032 # can do this for multi-gpu test (very large)
rowslist = [rows1, rows2, rows3]
@@ -67,15 +67,6 @@ class TestGPU(unittest.TestCase):
'objective': 'binary:logistic',
'max_bin': max_bin,
'eval_metric': 'auc'}
ag_param3 = {'max_depth': max_depth,
'tree_method': 'gpu_hist',
'nthread': 0,
'eta': 1,
'verbosity': 3,
'n_gpus': -1,
'objective': 'binary:logistic',
'max_bin': max_bin,
'eval_metric': 'auc'}
ag_res = {}
ag_resb = {}
ag_res2 = {}
@@ -93,9 +84,3 @@ class TestGPU(unittest.TestCase):
xgb.train(ag_param2, ag_dtrain, num_rounds, [(ag_dtrain, 'train')],
evals_result=ag_res2)
print("Time to Train: %s seconds" % (str(time.time() - tmp)))
tmp = time.time()
eprint("gpu_hist updater all gpus")
xgb.train(ag_param3, ag_dtrain, num_rounds, [(ag_dtrain, 'train')],
evals_result=ag_res3)
print("Time to Train: %s seconds" % (str(time.time() - tmp)))

View File

@@ -35,8 +35,6 @@ class TestPickling(unittest.TestCase):
x, y = build_dataset()
train_x = xgb.DMatrix(x, label=y)
param = {'tree_method': 'gpu_hist',
'gpu_id': 0,
'n_gpus': -1,
'verbosity': 1}
bst = xgb.train(param, train_x)