merge v2.0.3 from upstream
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
import errno
|
||||
import argparse
|
||||
import errno
|
||||
import glob
|
||||
import os
|
||||
import platform
|
||||
@@ -19,13 +19,12 @@ CONFIG = {
|
||||
"USE_HDFS": "OFF",
|
||||
"USE_AZURE": "OFF",
|
||||
"USE_S3": "OFF",
|
||||
|
||||
"USE_CUDA": "OFF",
|
||||
"USE_NCCL": "OFF",
|
||||
"USE_HIP": "OFF",
|
||||
"USE_RCCL": "OFF",
|
||||
"JVM_BINDINGS": "ON",
|
||||
"LOG_CAPI_INVOCATION": "OFF"
|
||||
"LOG_CAPI_INVOCATION": "OFF",
|
||||
}
|
||||
|
||||
|
||||
@@ -72,27 +71,22 @@ def normpath(path):
|
||||
return normalized
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--log-capi-invocation', type=str, choices=['ON', 'OFF'], default='OFF')
|
||||
parser.add_argument('--use-cuda', type=str, choices=['ON', 'OFF'], default='OFF')
|
||||
parser.add_argument('--use-hip', type=str, choices=['ON', 'OFF'], default='OFF')
|
||||
cli_args = parser.parse_args()
|
||||
|
||||
def native_build(args):
|
||||
if sys.platform == "darwin":
|
||||
# Enable of your compiler supports OpenMP.
|
||||
CONFIG["USE_OPENMP"] = "OFF"
|
||||
os.environ["JAVA_HOME"] = subprocess.check_output(
|
||||
"/usr/libexec/java_home").strip().decode()
|
||||
os.environ["JAVA_HOME"] = (
|
||||
subprocess.check_output("/usr/libexec/java_home").strip().decode()
|
||||
)
|
||||
|
||||
print("building Java wrapper")
|
||||
with cd(".."):
|
||||
build_dir = 'build-gpu' if cli_args.use_cuda == 'ON' or cli_args.use_hip == 'ON' else 'build'
|
||||
build_dir = "build-gpu" if cli_args.use_cuda == "ON" or cli_args.use_hip == "ON" else "build"
|
||||
maybe_makedirs(build_dir)
|
||||
with cd(build_dir):
|
||||
if sys.platform == "win32":
|
||||
# Force x64 build on Windows.
|
||||
maybe_generator = ' -A x64'
|
||||
maybe_generator = " -A x64"
|
||||
else:
|
||||
maybe_generator = ""
|
||||
if sys.platform == "linux":
|
||||
@@ -100,15 +94,15 @@ if __name__ == "__main__":
|
||||
else:
|
||||
maybe_parallel_build = ""
|
||||
|
||||
if cli_args.log_capi_invocation == 'ON':
|
||||
CONFIG['LOG_CAPI_INVOCATION'] = 'ON'
|
||||
if cli_args.log_capi_invocation == "ON":
|
||||
CONFIG["LOG_CAPI_INVOCATION"] = "ON"
|
||||
|
||||
if cli_args.use_cuda == 'ON':
|
||||
CONFIG['USE_CUDA'] = 'ON'
|
||||
CONFIG['USE_NCCL'] = 'ON'
|
||||
elif cli_args.use_hip== 'ON':
|
||||
CONFIG['USE_HIP'] = 'ON'
|
||||
CONFIG['USE_RCCL'] = 'ON'
|
||||
if cli_args.use_cuda == "ON":
|
||||
CONFIG["USE_CUDA"] = "ON"
|
||||
CONFIG["USE_NCCL"] = "ON"
|
||||
elif cli_args.use_hip == "ON":
|
||||
CONFIG["USE_HIP"] = "ON"
|
||||
CONFIG["USE_RCCL"] = "ON"
|
||||
|
||||
args = ["-D{0}:BOOL={1}".format(k, v) for k, v in CONFIG.items()]
|
||||
|
||||
@@ -121,7 +115,7 @@ if __name__ == "__main__":
|
||||
if gpu_arch_flag is not None:
|
||||
args.append("%s" % gpu_arch_flag)
|
||||
|
||||
lib_dir = os.path.join(os.pardir, 'lib')
|
||||
lib_dir = os.path.join(os.pardir, "lib")
|
||||
if os.path.exists(lib_dir):
|
||||
shutil.rmtree(lib_dir)
|
||||
run("cmake .. " + " ".join(args) + maybe_generator)
|
||||
@@ -131,8 +125,10 @@ if __name__ == "__main__":
|
||||
run(f'"{sys.executable}" mapfeat.py')
|
||||
run(f'"{sys.executable}" mknfold.py machine.txt 1')
|
||||
|
||||
xgboost4j = 'xgboost4j-gpu' if cli_args.use_cuda == 'ON' or cli_args.use_hip== 'ON' else 'xgboost4j'
|
||||
xgboost4j_spark = 'xgboost4j-spark-gpu' if cli_args.use_cuda == 'ON' or cli_args.use_hip == 'ON' else 'xgboost4j-spark'
|
||||
xgboost4j = "xgboost4j-gpu" if cli_args.use_cuda == "ON" or cli_args.use_hip == "ON" else "xgboost4j"
|
||||
xgboost4j_spark = (
|
||||
"xgboost4j-spark-gpu" if cli_args.use_cuda == "ON" or cli_args.use_hip == "ON" else "xgboost4j-spark"
|
||||
)
|
||||
|
||||
print("copying native library")
|
||||
library_name, os_folder = {
|
||||
@@ -147,14 +143,19 @@ if __name__ == "__main__":
|
||||
"i86pc": "x86_64", # on Solaris x86_64
|
||||
"sun4v": "sparc", # on Solaris sparc
|
||||
"arm64": "aarch64", # on macOS & Windows ARM 64-bit
|
||||
"aarch64": "aarch64"
|
||||
"aarch64": "aarch64",
|
||||
}[platform.machine().lower()]
|
||||
output_folder = "{}/src/main/resources/lib/{}/{}".format(xgboost4j, os_folder, arch_folder)
|
||||
output_folder = "{}/src/main/resources/lib/{}/{}".format(
|
||||
xgboost4j, os_folder, arch_folder
|
||||
)
|
||||
maybe_makedirs(output_folder)
|
||||
cp("../lib/" + library_name, output_folder)
|
||||
|
||||
print("copying pure-Python tracker")
|
||||
cp("../python-package/xgboost/tracker.py", "{}/src/main/resources".format(xgboost4j))
|
||||
cp(
|
||||
"../python-package/xgboost/tracker.py",
|
||||
"{}/src/main/resources".format(xgboost4j),
|
||||
)
|
||||
|
||||
print("copying train/test files")
|
||||
maybe_makedirs("{}/src/test/resources".format(xgboost4j_spark))
|
||||
@@ -170,3 +171,18 @@ if __name__ == "__main__":
|
||||
maybe_makedirs("{}/src/test/resources".format(xgboost4j))
|
||||
for file in glob.glob("../demo/data/agaricus.*"):
|
||||
cp(file, "{}/src/test/resources".format(xgboost4j))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if "MAVEN_SKIP_NATIVE_BUILD" in os.environ:
|
||||
print("MAVEN_SKIP_NATIVE_BUILD is set. Skipping native build...")
|
||||
else:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"--log-capi-invocation", type=str, choices=["ON", "OFF"], default="OFF"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--use-cuda", type=str, choices=["ON", "OFF"], default="OFF"
|
||||
)
|
||||
cli_args = parser.parse_args()
|
||||
native_build(cli_args)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost-jvm</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<artifactId>xgboost-jvm_2.12</artifactId>
|
||||
<version>2.0.3</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>XGBoost JVM Package</name>
|
||||
<description>JVM Package for XGBoost</description>
|
||||
@@ -190,6 +190,93 @@
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>release-cpu-only</id>
|
||||
<modules>
|
||||
<module>xgboost4j</module>
|
||||
<module>xgboost4j-example</module>
|
||||
<module>xgboost4j-spark</module>
|
||||
<module>xgboost4j-flink</module>
|
||||
</modules>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>empty-javadoc-jar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<classifier>javadoc</classifier>
|
||||
<classesDirectory>${basedir}/javadoc</classesDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<configuration>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<useReleaseProfile>false</useReleaseProfile>
|
||||
<releaseProfiles>release</releaseProfiles>
|
||||
<goals>deploy</goals>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<version>1.6.13</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<serverId>ossrh</serverId>
|
||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
||||
<autoReleaseAfterClose>false</autoReleaseAfterClose>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>assembly</id>
|
||||
<build>
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost-jvm</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<artifactId>xgboost-jvm_2.12</artifactId>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<name>xgboost4j-example</name>
|
||||
<artifactId>xgboost4j-example_${scala.binary.version}</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<artifactId>xgboost4j-example_2.12</artifactId>
|
||||
<version>2.0.3</version>
|
||||
<packaging>jar</packaging>
|
||||
<build>
|
||||
<plugins>
|
||||
@@ -26,7 +26,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost4j-spark_${scala.binary.version}</artifactId>
|
||||
<artifactId>xgboost4j-spark_2.12</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -37,7 +37,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost4j-flink_${scala.binary.version}</artifactId>
|
||||
<artifactId>xgboost4j-flink_2.12</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost-jvm</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<artifactId>xgboost-jvm_2.12</artifactId>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
|
||||
<name>xgboost4j-flink</name>
|
||||
<artifactId>xgboost4j-flink_${scala.binary.version}</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<artifactId>xgboost4j-flink_2.12</artifactId>
|
||||
<version>2.0.3</version>
|
||||
<properties>
|
||||
<flink-ml.version>2.2.0</flink-ml.version>
|
||||
</properties>
|
||||
@@ -30,7 +30,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost4j_${scala.binary.version}</artifactId>
|
||||
<artifactId>xgboost4j_2.12</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost-jvm</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<artifactId>xgboost-jvm_2.12</artifactId>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<artifactId>xgboost4j-gpu_${scala.binary.version}</artifactId>
|
||||
<artifactId>xgboost4j-gpu_2.12</artifactId>
|
||||
<name>xgboost4j-gpu</name>
|
||||
<version>2.0.1</version>
|
||||
<version>2.0.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost-jvm</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<artifactId>xgboost-jvm_2.12</artifactId>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<name>xgboost4j-spark-gpu</name>
|
||||
<artifactId>xgboost4j-spark-gpu_${scala.binary.version}</artifactId>
|
||||
<artifactId>xgboost4j-spark-gpu_2.12</artifactId>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -24,7 +24,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost4j-gpu_${scala.binary.version}</artifactId>
|
||||
<artifactId>xgboost4j-gpu_2.12</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost-jvm</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<artifactId>xgboost-jvm_2.12</artifactId>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<name>xgboost4j-spark</name>
|
||||
<artifactId>xgboost4j-spark_${scala.binary.version}</artifactId>
|
||||
<artifactId>xgboost4j-spark_2.12</artifactId>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -24,7 +24,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost4j_${scala.binary.version}</artifactId>
|
||||
<artifactId>xgboost4j_2.12</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ml.dmlc</groupId>
|
||||
<artifactId>xgboost-jvm</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<artifactId>xgboost-jvm_2.12</artifactId>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<name>xgboost4j</name>
|
||||
<artifactId>xgboost4j_${scala.binary.version}</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<artifactId>xgboost4j_2.12</artifactId>
|
||||
<version>2.0.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
|
||||
Reference in New Issue
Block a user