From b9157887080963cc92f03202087df6a121a45f57 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Sat, 21 Dec 2019 11:00:21 +0800 Subject: [PATCH] Remove benchmark code in GPU test. (#5141) * Update Jenkins script. --- tests/ci_build/test_python.sh | 4 +- tests/python-gpu/test_gpu_prediction.py | 2 - tests/python-gpu/test_large_sizes.py | 86 ------------------------- 3 files changed, 2 insertions(+), 90 deletions(-) delete mode 100644 tests/python-gpu/test_large_sizes.py diff --git a/tests/ci_build/test_python.sh b/tests/ci_build/test_python.sh index db99db9d2..8cf74a096 100755 --- a/tests/ci_build/test_python.sh +++ b/tests/ci_build/test_python.sh @@ -26,11 +26,11 @@ fi # Run specified test suite case "$suite" in gpu) - pytest -v -s --fulltrace -m "(not slow) and (not mgpu)" tests/python-gpu + pytest -v -s --fulltrace -m "not mgpu" tests/python-gpu ;; mgpu) - pytest -v -s --fulltrace -m "(not slow) and mgpu" tests/python-gpu + pytest -v -s --fulltrace -m "mgpu" tests/python-gpu cd tests/distributed ./runtests-gpu.sh cd - diff --git a/tests/python-gpu/test_gpu_prediction.py b/tests/python-gpu/test_gpu_prediction.py index 017802a62..1bdc56d3b 100644 --- a/tests/python-gpu/test_gpu_prediction.py +++ b/tests/python-gpu/test_gpu_prediction.py @@ -3,12 +3,10 @@ from __future__ import print_function import numpy as np import unittest import xgboost as xgb -import pytest rng = np.random.RandomState(1994) -@pytest.mark.gpu class TestGPUPredict(unittest.TestCase): def test_predict(self): iterations = 10 diff --git a/tests/python-gpu/test_large_sizes.py b/tests/python-gpu/test_large_sizes.py deleted file mode 100644 index 739b21d6a..000000000 --- a/tests/python-gpu/test_large_sizes.py +++ /dev/null @@ -1,86 +0,0 @@ -from __future__ import print_function - -import sys -import time -import pytest - -sys.path.append("../../tests/python") -import xgboost as xgb -import numpy as np -import unittest - - -def eprint(*args, **kwargs): - print(*args, file=sys.stderr, **kwargs) - sys.stderr.flush() - print(*args, file=sys.stdout, **kwargs) - sys.stdout.flush() - - -rng = np.random.RandomState(1994) - -# "realistic" size based upon http://stat-computing.org/dataexpo/2009/ -# , which has been processed to one-hot encode categoricalsxsy -cols = 31 -# reduced to fit onto 1 gpu but still be large -rows3 = 5000 # small -rows2 = 4360032 # medium -rows1 = 32360032 # large -# rows1 = 152360032 # can do this for multi-gpu test (very large) -rowslist = [rows1, rows2, rows3] - - -@pytest.mark.slow -class TestGPU(unittest.TestCase): - def test_large(self): - for rows in rowslist: - eprint("Creating train data rows=%d cols=%d" % (rows, cols)) - tmp = time.time() - np.random.seed(7) - X = np.random.rand(rows, cols) - y = np.random.rand(rows) - print("Time to Create Data: %r" % (time.time() - tmp)) - - eprint("Starting DMatrix(X,y)") - tmp = time.time() - ag_dtrain = xgb.DMatrix(X, y, nthread=40) - print("Time to DMatrix: %r" % (time.time() - tmp)) - - max_depth = 6 - max_bin = 1024 - - # regression test --- hist must be same as exact on - # all-categorial data - ag_paramb = {'max_depth': max_depth, - 'tree_method': 'hist', - 'nthread': 0, - 'eta': 1, - 'verbosity': 3, - 'objective': 'binary:logistic', - 'eval_metric': 'auc'} - ag_param2 = {'max_depth': max_depth, - 'tree_method': 'gpu_hist', - 'nthread': 0, - 'eta': 1, - 'verbosity': 3, - 'gpu_id': 0, - 'objective': 'binary:logistic', - 'max_bin': max_bin, - 'eval_metric': 'auc'} - ag_res = {} - ag_resb = {} - ag_res2 = {} - ag_res3 = {} - - num_rounds = 1 - tmp = time.time() - # eprint("hist updater") - # xgb.train(ag_paramb, ag_dtrain, num_rounds, [(ag_dtrain, 'train')], - # evals_result=ag_resb) - # print("Time to Train: %s seconds" % (str(time.time() - tmp))) - - tmp = time.time() - eprint("gpu_hist updater 1 gpu") - 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)))