[jvm-packages] Fix up build for xgboost4j-gpu, xgboost4j-spark-gpu (#6216)
* [CI] Clean up build for JVM packages * Use correct path for saving native lib * Fix groupId of maven-surefire-plugin * Fix stashing of xgboost4j_jar_gpu * [CI] Don't run xgboost4j-tester with GPU, since it doesn't use gpu_hist
This commit is contained in:
committed by
GitHub
parent
70ce5216b5
commit
c991eb612d
@@ -10,7 +10,7 @@ gpu_arch=$3
|
||||
gpu_options=""
|
||||
if [ "x$use_cuda" == "x-Duse.cuda=ON" ]; then
|
||||
# Since building jvm for CPU will do unit tests, choose gpu-with-gpu-tests profile to build
|
||||
gpu_options=" -Pgpu-with-gpu-tests "
|
||||
gpu_options="$use_cuda -Pgpu-with-gpu-tests "
|
||||
fi
|
||||
|
||||
# Initialize local Maven repository
|
||||
|
||||
@@ -3,13 +3,12 @@
|
||||
set -e
|
||||
set -x
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Usage: $0 [spark version] [build_gpu? 0 or 1]"
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 [spark version]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
spark_version=$1
|
||||
build_gpu=$2
|
||||
|
||||
# Initialize local Maven repository
|
||||
./tests/ci_build/initialize_maven.sh
|
||||
@@ -20,15 +19,7 @@ rm -rf ../build/
|
||||
|
||||
# Re-build package without Mock Rabit
|
||||
# Deploy to S3 bucket xgboost-maven-repo
|
||||
if [[ "$build_gpu" == "0" ]]
|
||||
then
|
||||
# Build CPU artifact
|
||||
mvn --no-transfer-progress package deploy -P release-to-s3 -Dspark.version=${spark_version} -DskipTests
|
||||
else
|
||||
# Build GPU artifact
|
||||
sed -i -e 's/<artifactId>xgboost\(.*\)_\(.*\)<\/artifactId>/<artifactId>xgboost\1-gpu_\2<\/artifactId>/' $(find . -name pom.xml)
|
||||
mvn --no-transfer-progress package deploy -Duse.cuda=ON -P release-to-s3 -Dspark.version=${spark_version} -DskipTests
|
||||
fi
|
||||
mvn --no-transfer-progress package deploy -Duse.cuda=ON -P release-to-s3 -Dspark.version=${spark_version} -DskipTests
|
||||
|
||||
set +x
|
||||
set +e
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
|
||||
nvidia-smi
|
||||
|
||||
ls /usr/local/
|
||||
|
||||
# Initialize local Maven repository
|
||||
./tests/ci_build/initialize_maven.sh
|
||||
|
||||
# Get version number of XGBoost4J and other auxiliary information
|
||||
cd jvm-packages
|
||||
xgboost4j_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
|
||||
scala_binary_version=$(mvn help:evaluate -Dexpression=scala.binary.version -q -DforceStdout)
|
||||
|
||||
python3 xgboost4j-tester/get_iris.py
|
||||
xgb_jars="./xgboost4j/target/xgboost4j_${scala_binary_version}-${xgboost4j_version}.jar,./xgboost4j-spark/target/xgboost4j-spark_${scala_binary_version}-${xgboost4j_version}.jar"
|
||||
example_jar="./xgboost4j-example/target/xgboost4j-example_${scala_binary_version}-${xgboost4j_version}.jar"
|
||||
|
||||
echo "Run SparkTraining locally ... "
|
||||
spark-submit \
|
||||
--master 'local[1]' \
|
||||
--class ml.dmlc.xgboost4j.scala.example.spark.SparkTraining \
|
||||
--jars $xgb_jars \
|
||||
$example_jar \
|
||||
${PWD}/iris.csv gpu \
|
||||
|
||||
echo "Run SparkMLlibPipeline locally ... "
|
||||
spark-submit \
|
||||
--master 'local[1]' \
|
||||
--class ml.dmlc.xgboost4j.scala.example.spark.SparkMLlibPipeline \
|
||||
--jars $xgb_jars \
|
||||
$example_jar \
|
||||
${PWD}/iris.csv ${PWD}/native_model ${PWD}/pipeline_model gpu \
|
||||
|
||||
set +x
|
||||
set +e
|
||||
Reference in New Issue
Block a user