[BLOCKING] [jvm-packages] add gpu_hist and enable gpu scheduling (#5171)
* [jvm-packages] add gpu_hist tree method * change updater hist to grow_quantile_histmaker * add gpu scheduling * pass correct parameters to xgboost library * remove debug info * add use.cuda for pom * add CI for gpu_hist for jvm * add gpu unit tests * use gpu node to build jvm * use nvidia-docker * Add CLI interface to create_jni.py using argparse Co-authored-by: Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
import errno
|
||||
import argparse
|
||||
import glob
|
||||
import os
|
||||
import shutil
|
||||
@@ -7,7 +8,6 @@ import subprocess
|
||||
import sys
|
||||
from contextlib import contextmanager
|
||||
|
||||
|
||||
# Monkey-patch the API inconsistency between Python2.X and 3.X.
|
||||
if sys.platform.startswith("linux"):
|
||||
sys.platform = "linux"
|
||||
@@ -20,6 +20,7 @@ CONFIG = {
|
||||
"USE_S3": "OFF",
|
||||
|
||||
"USE_CUDA": "OFF",
|
||||
"USE_NCCL": "OFF",
|
||||
"JVM_BINDINGS": "ON"
|
||||
}
|
||||
|
||||
@@ -68,6 +69,10 @@ def normpath(path):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--use-cuda', type=str, choices=['ON', 'OFF'], default='OFF')
|
||||
cli_args = parser.parse_args()
|
||||
|
||||
if sys.platform == "darwin":
|
||||
# Enable of your compiler supports OpenMP.
|
||||
CONFIG["USE_OPENMP"] = "OFF"
|
||||
@@ -88,12 +93,21 @@ if __name__ == "__main__":
|
||||
else:
|
||||
maybe_parallel_build = ""
|
||||
|
||||
if cli_args.use_cuda == 'ON':
|
||||
CONFIG['USE_CUDA'] = 'ON'
|
||||
CONFIG['USE_NCCL'] = 'ON'
|
||||
|
||||
args = ["-D{0}:BOOL={1}".format(k, v) for k, v in CONFIG.items()]
|
||||
|
||||
# if enviorment set rabit_mock
|
||||
if os.getenv("RABIT_MOCK", None) is not None:
|
||||
args.append("-DRABIT_MOCK:BOOL=ON")
|
||||
|
||||
# if enviorment set GPU_ARCH_FLAG
|
||||
gpu_arch_flag = os.getenv("GPU_ARCH_FLAG", None)
|
||||
if gpu_arch_flag is not None:
|
||||
args.append("%s" % gpu_arch_flag)
|
||||
|
||||
run("cmake .. " + " ".join(args) + maybe_generator)
|
||||
run("cmake --build . --config Release" + maybe_parallel_build)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user