[jvm-package] Clean up the legacy gpu support tests (#7523)

This commit is contained in:
Bobby Wang 2021-12-21 09:15:51 +08:00 committed by GitHub
parent 59bd1ab17e
commit e8c1eb99e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 101 deletions

4
Jenkinsfile vendored
View File

@ -62,8 +62,8 @@ pipeline {
// using CentOS 7 image // using CentOS 7 image
'build-gpu-cuda11.0': { BuildCUDA(cuda_version: '11.0', build_rmm: true) }, 'build-gpu-cuda11.0': { BuildCUDA(cuda_version: '11.0', build_rmm: true) },
'build-gpu-rpkg': { BuildRPackageWithCUDA(cuda_version: '11.0') }, 'build-gpu-rpkg': { BuildRPackageWithCUDA(cuda_version: '11.0') },
'build-jvm-packages-gpu-cuda11.0': { BuildJVMPackagesWithCUDA(spark_version: '3.0.0', cuda_version: '11.0') }, 'build-jvm-packages-gpu-cuda11.0': { BuildJVMPackagesWithCUDA(spark_version: '3.0.1', cuda_version: '11.0') },
'build-jvm-packages': { BuildJVMPackages(spark_version: '3.0.0') }, 'build-jvm-packages': { BuildJVMPackages(spark_version: '3.0.1') },
'build-jvm-doc': { BuildJVMDoc() } 'build-jvm-doc': { BuildJVMDoc() }
]) ])
} }

View File

@ -68,17 +68,6 @@
<module>xgboost4j-spark</module> <module>xgboost4j-spark</module>
<module>xgboost4j-flink</module> <module>xgboost4j-flink</module>
</modules> </modules>
<build>
<plugins>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<configuration>
<tagsToExclude>ml.dmlc.xgboost4j.java.GpuTestSuite</tagsToExclude>
</configuration>
</plugin>
</plugins>
</build>
</profile> </profile>
<!-- gpu profile with both cpu and gpu test suites --> <!-- gpu profile with both cpu and gpu test suites -->
@ -94,37 +83,6 @@
<module>xgboost4j-gpu</module> <module>xgboost4j-gpu</module>
<module>xgboost4j-spark-gpu</module> <module>xgboost4j-spark-gpu</module>
</modules> </modules>
<build>
<plugins>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<!-- gpu-with-gpu-tests profile with only gpu test suites -->
<profile>
<id>gpu-with-gpu-tests</id>
<properties>
<use.cuda>ON</use.cuda>
</properties>
<modules>
<module>xgboost4j-gpu</module>
<module>xgboost4j-spark-gpu</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<configuration>
<tagsToInclude>ml.dmlc.xgboost4j.java.GpuTestSuite</tagsToInclude>
</configuration>
</plugin>
</plugins>
</build>
</profile> </profile>
<profile> <profile>

View File

@ -16,14 +16,13 @@
package ml.dmlc.xgboost4j.scala.spark package ml.dmlc.xgboost4j.scala.spark
import ml.dmlc.xgboost4j.java.GpuTestSuite
import ml.dmlc.xgboost4j.scala.{DMatrix, XGBoost => ScalaXGBoost} import ml.dmlc.xgboost4j.scala.{DMatrix, XGBoost => ScalaXGBoost}
import org.apache.spark.ml.linalg._ import org.apache.spark.ml.linalg._
import org.apache.spark.sql._ import org.apache.spark.sql._
import org.scalatest.FunSuite import org.scalatest.FunSuite
import org.apache.spark.Partitioner import org.apache.spark.Partitioner
abstract class XGBoostClassifierSuiteBase extends FunSuite with PerTest { class XGBoostClassifierSuite extends FunSuite with PerTest {
protected val treeMethod: String = "auto" protected val treeMethod: String = "auto"
@ -200,9 +199,6 @@ abstract class XGBoostClassifierSuiteBase extends FunSuite with PerTest {
assert(resultDF.columns.contains("predictContrib")) assert(resultDF.columns.contains("predictContrib"))
} }
}
class XGBoostCpuClassifierSuite extends XGBoostClassifierSuiteBase {
test("XGBoost-Spark XGBoostClassifier output should match XGBoost4j") { test("XGBoost-Spark XGBoostClassifier output should match XGBoost4j") {
val trainingDM = new DMatrix(Classification.train.iterator) val trainingDM = new DMatrix(Classification.train.iterator)
val testDM = new DMatrix(Classification.test.iterator) val testDM = new DMatrix(Classification.test.iterator)
@ -220,11 +216,11 @@ class XGBoostCpuClassifierSuite extends XGBoostClassifierSuiteBase {
} }
private def checkResultsWithXGBoost4j( private def checkResultsWithXGBoost4j(
trainingDM: DMatrix, trainingDM: DMatrix,
testDM: DMatrix, testDM: DMatrix,
trainingDF: DataFrame, trainingDF: DataFrame,
testDF: DataFrame, testDF: DataFrame,
round: Int = 5): Unit = { round: Int = 5): Unit = {
val paramMap = Map( val paramMap = Map(
"eta" -> "1", "eta" -> "1",
"max_depth" -> "6", "max_depth" -> "6",
@ -315,10 +311,5 @@ class XGBoostCpuClassifierSuite extends XGBoostClassifierSuiteBase {
val xgb = new XGBoostClassifier(paramMap) val xgb = new XGBoostClassifier(paramMap)
xgb.fit(repartitioned) xgb.fit(repartitioned)
} }
}
@GpuTestSuite
class XGBoostGpuClassifierSuite extends XGBoostClassifierSuiteBase {
override protected val treeMethod: String = "gpu_hist"
override protected val numWorkers: Int = 1
} }

View File

@ -16,7 +16,6 @@
package ml.dmlc.xgboost4j.scala.spark package ml.dmlc.xgboost4j.scala.spark
import ml.dmlc.xgboost4j.java.GpuTestSuite
import ml.dmlc.xgboost4j.scala.{DMatrix, XGBoost => ScalaXGBoost} import ml.dmlc.xgboost4j.scala.{DMatrix, XGBoost => ScalaXGBoost}
import org.apache.spark.ml.linalg.Vector import org.apache.spark.ml.linalg.Vector
import org.apache.spark.sql.functions._ import org.apache.spark.sql.functions._
@ -24,7 +23,7 @@ import org.apache.spark.sql.{DataFrame, Row}
import org.apache.spark.sql.types._ import org.apache.spark.sql.types._
import org.scalatest.FunSuite import org.scalatest.FunSuite
abstract class XGBoostRegressorSuiteBase extends FunSuite with PerTest { class XGBoostRegressorSuite extends FunSuite with PerTest {
protected val treeMethod: String = "auto" protected val treeMethod: String = "auto"
test("XGBoost-Spark XGBoostRegressor output should match XGBoost4j") { test("XGBoost-Spark XGBoostRegressor output should match XGBoost4j") {
@ -218,13 +217,3 @@ abstract class XGBoostRegressorSuiteBase extends FunSuite with PerTest {
assert(resultDF.columns.contains("predictContrib")) assert(resultDF.columns.contains("predictContrib"))
} }
} }
class XGBoostCpuRegressorSuite extends XGBoostRegressorSuiteBase {
}
@GpuTestSuite
class XGBoostGpuRegressorSuite extends XGBoostRegressorSuiteBase {
override protected val treeMethod: String = "gpu_hist"
override protected val numWorkers: Int = 1
}

View File

@ -1,28 +0,0 @@
/*
Copyright (c) 2020 by Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ml.dmlc.xgboost4j.java;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.scalatest.TagAnnotation;
@TagAnnotation
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface GpuTestSuite {}

View File

@ -9,8 +9,7 @@ gpu_arch=$3
gpu_options="" gpu_options=""
if [ "x$use_cuda" == "x-Duse.cuda=ON" ]; then 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="$use_cuda -Pgpu"
gpu_options="$use_cuda -Pgpu-with-gpu-tests "
fi fi
# Initialize local Maven repository # Initialize local Maven repository