Skip to content

Commit 31d6a8a

Browse files
hcho3trivialfis
andcommitted
Upgrade to CUDA 10.0 (dmlc#5649)
Co-authored-by: fis <[email protected]>
1 parent fcf5782 commit 31d6a8a

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

Jenkinsfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ pipeline {
6464
'build-cpu': { BuildCPU() },
6565
'build-cpu-rabit-mock': { BuildCPUMock() },
6666
'build-cpu-non-omp': { BuildCPUNonOmp() },
67-
'build-gpu-cuda9.0': { BuildCUDA(cuda_version: '9.0') },
6867
'build-gpu-cuda10.0': { BuildCUDA(cuda_version: '10.0') },
6968
'build-gpu-cuda10.1': { BuildCUDA(cuda_version: '10.1') },
7069
'build-jvm-packages': { BuildJVMPackages(spark_version: '2.4.3') },
@@ -251,10 +250,10 @@ def BuildCUDA(args) {
251250
${dockerRun} ${container_type} ${docker_binary} ${docker_args} bash -c "cd python-package && rm -rf dist/* && python setup.py bdist_wheel --universal"
252251
${dockerRun} ${container_type} ${docker_binary} ${docker_args} python3 tests/ci_build/rename_whl.py python-package/dist/*.whl ${commit_id} manylinux2010_x86_64
253252
"""
254-
// Stash wheel for CUDA 9.0 target
255-
if (args.cuda_version == '9.0') {
253+
// Stash wheel for CUDA 10.0 target
254+
if (args.cuda_version == '10.0') {
256255
echo 'Stashing Python wheel...'
257-
stash name: 'xgboost_whl_cuda9', includes: 'python-package/dist/*.whl'
256+
stash name: 'xgboost_whl_cuda10', includes: 'python-package/dist/*.whl'
258257
path = ("${BRANCH_NAME}" == 'master') ? '' : "${BRANCH_NAME}/"
259258
s3Upload bucket: 'xgboost-nightly-builds', path: path, acl: 'PublicRead', workingDir: 'python-package/dist', includePathPattern:'**/*.whl'
260259
echo 'Stashing C++ test executable (testxgboost)...'
@@ -298,7 +297,7 @@ def BuildJVMDoc() {
298297

299298
def TestPythonCPU() {
300299
node('linux && cpu') {
301-
unstash name: 'xgboost_whl_cuda9'
300+
unstash name: 'xgboost_whl_cuda10'
302301
unstash name: 'srcs'
303302
unstash name: 'xgboost_cli'
304303
echo "Test Python CPU"
@@ -315,7 +314,7 @@ def TestPythonCPU() {
315314
def TestPythonGPU(args) {
316315
nodeReq = (args.multi_gpu) ? 'linux && mgpu' : 'linux && gpu'
317316
node(nodeReq) {
318-
unstash name: 'xgboost_whl_cuda9'
317+
unstash name: 'xgboost_whl_cuda10'
319318
unstash name: 'srcs'
320319
echo "Test Python GPU: CUDA ${args.cuda_version}"
321320
def container_type = "gpu"

tests/python-gpu/test_gpu_basic_models.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,15 @@
1212
class TestGPUBasicModels(unittest.TestCase):
1313
cputest = test_bm.TestModels()
1414

15-
def test_eta_decay_gpu_hist(self):
16-
self.cputest.run_eta_decay('gpu_hist')
17-
18-
def test_deterministic_gpu_hist(self):
19-
kRows = 1000
20-
kCols = 64
21-
kClasses = 4
22-
# Create large values to force rounding.
23-
X = np.random.randn(kRows, kCols) * 1e4
24-
y = np.random.randint(0, kClasses, size=kRows)
25-
15+
def run_cls(self, X, y, deterministic):
2616
cls = xgb.XGBClassifier(tree_method='gpu_hist',
27-
deterministic_histogram=True,
17+
deterministic_histogram=deterministic,
2818
single_precision_histogram=True)
2919
cls.fit(X, y)
3020
cls.get_booster().save_model('test_deterministic_gpu_hist-0.json')
3121

3222
cls = xgb.XGBClassifier(tree_method='gpu_hist',
33-
deterministic_histogram=True,
23+
deterministic_histogram=deterministic,
3424
single_precision_histogram=True)
3525
cls.fit(X, y)
3626
cls.get_booster().save_model('test_deterministic_gpu_hist-1.json')
@@ -40,7 +30,24 @@ def test_deterministic_gpu_hist(self):
4030
with open('test_deterministic_gpu_hist-1.json', 'r') as fd:
4131
model_1 = fd.read()
4232

43-
assert hash(model_0) == hash(model_1)
44-
4533
os.remove('test_deterministic_gpu_hist-0.json')
4634
os.remove('test_deterministic_gpu_hist-1.json')
35+
36+
return hash(model_0), hash(model_1)
37+
38+
def test_eta_decay_gpu_hist(self):
39+
self.cputest.run_eta_decay('gpu_hist')
40+
41+
def test_deterministic_gpu_hist(self):
42+
kRows = 1000
43+
kCols = 64
44+
kClasses = 4
45+
# Create large values to force rounding.
46+
X = np.random.randn(kRows, kCols) * 1e4
47+
y = np.random.randint(0, kClasses, size=kRows) * 1e4
48+
49+
model_0, model_1 = self.run_cls(X, y, True)
50+
assert model_0 == model_1
51+
52+
model_0, model_1 = self.run_cls(X, y, False)
53+
assert model_0 != model_1

0 commit comments

Comments
 (0)