Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
504ef43
update: choose GPU jar
xuwq1993 May 31, 2021
dd8305c
add deviceType param
xuwq1993 Jun 2, 2021
80daf31
Feat: Add GPU version
xuwq1993 Jun 7, 2021
45d264c
feat: add GPU support
xuwq1993 Jun 7, 2021
1869506
Merge branch 'master' into wenqx/lgbmGPUSupport
xuwq1993 Jun 7, 2021
56d1433
feat: add GPU support
xuwq1993 Jun 7, 2021
7e0b489
Merge branch 'master' into wenqx/lgbmGPUSupport
xuwq1993 Jun 9, 2021
61430aa
update: update lgbm jar version
xuwq1993 Jun 9, 2021
72dd1d4
update: update lgbm jar version
xuwq1993 Jun 9, 2021
1583fab
update: update lightgbm jar package version
xuwq1993 Jun 10, 2021
ebb3992
update: update lightgbm jar package version
xuwq1993 Jun 10, 2021
2db9f16
update: merge master
xuwq1993 Jun 29, 2021
287bb92
update: changed LightGBM version
xuwq1993 Jun 29, 2021
be64c21
update: update LightGBM Jar version
xuwq1993 Jun 29, 2021
ff7d199
update: add MMLSpark resolver
xuwq1993 Jun 29, 2021
c0d3d6d
update: remove mmlspark resolver
xuwq1993 Jun 30, 2021
6e7e94c
feat: merge master
xuwq1993 Aug 20, 2021
db9e926
fix: fix build.sbt
xuwq1993 Aug 20, 2021
fefa18d
fix: format fix
xuwq1993 Aug 20, 2021
35c8d9c
fix: format fix
xuwq1993 Aug 20, 2021
6c2f530
Merge branch 'master' into wenqx/lgbmGPUSupport
xuwq1993 Sep 13, 2021
d57905c
Merge branch 'master' into wenqx/lgbmGPUSupport
xuwq1993 Oct 14, 2021
542fa65
fix: use synapse default ubuntu version
xuwq1993 Oct 14, 2021
7d245d1
feat: merge master
xuwq1993 Oct 19, 2021
8edd528
merge master
xuwq1993 Nov 29, 2021
202537a
feat: add GPU support
xuwq1993 Nov 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,9 @@ lazy val lightgbm = (project in file("lightgbm"))
.enablePlugins(SbtPlugin)
.dependsOn(core % "test->test;compile->compile")
.settings(settings ++ Seq(
libraryDependencies += ("com.microsoft.ml.lightgbm" % "lightgbmlib" % "3.2.110"),
name := "synapseml-lightgbm"
libraryDependencies += ("com.microsoft.ml.lightgbm" % "lightgbmlib" % "3.2.114"),
resolvers += speechResolver,
name := "mmlspark-lightgbm"
): _*)

lazy val vw = (project in file("vw"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class LightGBMClassifier(override val uid: String)
getIsUnbalance, getVerbosity, categoricalIndexes, actualNumClasses, getBoostFromAverage,
getBoostingType, get(lambdaL1), get(lambdaL2), get(isProvideTrainingMetric),
get(metric), get(minGainToSplit), get(maxDeltaStep), getMaxBinByFeature, get(minDataInLeaf), getSlotNames,
getDelegate, getDartParams, getExecutionParams, getObjectiveParams)
getDelegate, getDartParams, getExecutionParams, getObjectiveParams, getDeviceType)
}

def getModel(trainParams: TrainParams, lightGBMBooster: LightGBMBooster): LightGBMClassificationModel = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class LightGBMRanker(override val uid: String)
getVerbosity, categoricalIndexes, getBoostingType, get(lambdaL1), get(lambdaL2), getMaxPosition, getLabelGain,
get(isProvideTrainingMetric), get(metric), getEvalAt, get(minGainToSplit), get(maxDeltaStep),
getMaxBinByFeature, get(minDataInLeaf), getSlotNames, getDelegate, getDartParams,
getExecutionParams, getObjectiveParams)
getExecutionParams, getObjectiveParams, getDeviceType)
}

def getModel(trainParams: TrainParams, lightGBMBooster: LightGBMBooster): LightGBMRankerModel = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class LightGBMRegressor(override val uid: String)
getBoostFromAverage, getBoostingType, get(lambdaL1), get(lambdaL2), get(isProvideTrainingMetric),
get(metric), get(minGainToSplit), get(maxDeltaStep),
getMaxBinByFeature, get(minDataInLeaf), getSlotNames, getDelegate,
getDartParams, getExecutionParams, getObjectiveParams)
getDartParams, getExecutionParams, getObjectiveParams, getDeviceType)
}

def getModel(trainParams: TrainParams, lightGBMBooster: LightGBMBooster): LightGBMRegressionModel = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ object LightGBMUtils {
*/
def initializeNativeLibrary(): Unit = {
val osPrefix = NativeLoader.getOSPrefix
new NativeLoader("/com/microsoft/ml/lightgbm").loadLibraryByName(osPrefix + "_lightgbm")
new NativeLoader("/com/microsoft/ml/lightgbm").loadLibraryByName(osPrefix + "_lightgbm_swig")
if (System.getProperty("os.version").toLowerCase.equals("4.15.0-1126-azure")) {
new NativeLoader("/com/microsoft/ml/lightgbm").loadLibraryByName(osPrefix + "_lightgbmcuda")
new NativeLoader("/com/microsoft/ml/lightgbm").loadLibraryByName(osPrefix + "_lightgbmcuda_swig")
}
else {
new NativeLoader("/com/microsoft/ml/lightgbm").loadLibraryByName(osPrefix + "_lightgbm")
new NativeLoader("/com/microsoft/ml/lightgbm").loadLibraryByName(osPrefix + "_lightgbm_swig")
}
}

def getFeaturizer(dataset: Dataset[_], labelColumn: String, featuresColumn: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,4 +474,11 @@ trait LightGBMParams extends Wrappable with DefaultParamsWritable with HasWeight
this.delegate = Option(delegate)
this
}

val deviceType = new Param[String](this, "deviceType",
"Device for the tree learning, you can use GPU to achieve the faster learning")
setDefault(deviceType -> "cpu")

def getDeviceType: String = $(deviceType)
def setDeviceType(value: String): this.type = set(deviceType, value)
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ abstract class TrainParams extends Serializable {
def dartModeParams: DartModeParams
def executionParams: ExecutionParams
def objectiveParams: ObjectiveParams
def deviceType: String

def paramToString[T](paramName: String, paramValueOpt: Option[T]): String = {
paramValueOpt match {
Expand Down Expand Up @@ -75,7 +76,8 @@ abstract class TrainParams extends Serializable {
(if (categoricalFeatures.isEmpty) "" else s"categorical_feature=${categoricalFeatures.mkString(",")} ") +
(if (maxBinByFeature.isEmpty) "" else s"max_bin_by_feature=${maxBinByFeature.mkString(",")} ") +
(if (boostingType == "dart") s"${dartModeParams.toString()} " else "") +
executionParams.toString()
executionParams.toString() +
s"device_type=$deviceType"
}
}

Expand Down Expand Up @@ -118,7 +120,8 @@ case class ClassifierTrainParams(parallelism: String,
delegate: Option[LightGBMDelegate],
dartModeParams: DartModeParams,
executionParams: ExecutionParams,
objectiveParams: ObjectiveParams)
objectiveParams: ObjectiveParams,
deviceType: String)
extends TrainParams {
override def toString: String = {
val extraStr =
Expand Down Expand Up @@ -167,7 +170,8 @@ case class RegressorTrainParams(parallelism: String,
delegate: Option[LightGBMDelegate],
dartModeParams: DartModeParams,
executionParams: ExecutionParams,
objectiveParams: ObjectiveParams)
objectiveParams: ObjectiveParams,
deviceType: String)
extends TrainParams {
override def toString: String = {
s"alpha=$alpha tweedie_variance_power=$tweedieVariancePower boost_from_average=${boostFromAverage.toString} " +
Expand Down Expand Up @@ -214,7 +218,8 @@ case class RankerTrainParams(parallelism: String,
delegate: Option[LightGBMDelegate],
dartModeParams: DartModeParams,
executionParams: ExecutionParams,
objectiveParams: ObjectiveParams)
objectiveParams: ObjectiveParams,
deviceType: String)
extends TrainParams {
override def toString: String = {
val labelGainStr =
Expand Down