Skip to content

Commit

Permalink
Add fill in value for shuffle manager and auto broadcast join threshold
Browse files Browse the repository at this point in the history
Signed-off-by: Partho Sarthi <psarthi@nvidia.com>
  • Loading branch information
parthosa committed Jan 28, 2025
1 parent 53e9739 commit 052ab06
Showing 1 changed file with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ class AutoTuner(
// set the Spark config spark.shuffle.sort.bypassMergeThreshold
getShuffleManagerClassName match {
case Right(smClassName) => appendRecommendation("spark.shuffle.manager", smClassName)
case Left(comment) => appendComment(comment)
case Left(comment) => appendComment("spark.shuffle.manager", comment)
}
appendComment(autoTunerConfigsProvider.classPathComments("rapids.shuffle.jars"))
recommendFileCache()
Expand Down Expand Up @@ -789,13 +789,14 @@ class AutoTuner(
}

// TODO - can we set spark.sql.autoBroadcastJoinThreshold ???
val autoBroadcastJoinKey = "spark.sql.adaptive.autoBroadcastJoinThreshold"
val autoBroadcastJoinThresholdProperty =
getPropertyValue("spark.sql.adaptive.autoBroadcastJoinThreshold").map(StringUtils.convertToMB)
getPropertyValue(autoBroadcastJoinKey).map(StringUtils.convertToMB)
if (autoBroadcastJoinThresholdProperty.isEmpty) {
appendComment("'spark.sql.adaptive.autoBroadcastJoinThreshold' was not set.")
appendComment(autoBroadcastJoinKey, s"'$autoBroadcastJoinKey' was not set.")
} else if (autoBroadcastJoinThresholdProperty.get >
StringUtils.convertToMB(autoTunerConfigsProvider.AQE_AUTOBROADCAST_JOIN_THRESHOLD)) {
appendComment("Setting 'spark.sql.adaptive.autoBroadcastJoinThreshold' > " +
appendComment(s"Setting '$autoBroadcastJoinKey' > " +
s"${autoTunerConfigsProvider.AQE_AUTOBROADCAST_JOIN_THRESHOLD} could " +
s"lead to performance\n" +
" regression. Should be set to a lower number.")
Expand Down Expand Up @@ -1014,6 +1015,22 @@ class AutoTuner(
comments += comment
}

/**
* Adds a comment for a configuration key when AutoTuner cannot provide a recommended value,
* but the configuration is necessary.
*/
private def appendComment(
key: String,
comment: String,
fillInValue: Option[String] = None): Unit = {
if (!skippedRecommendations.contains(key)) {
val recomRecord = recommendations.getOrElseUpdate(key,
TuningEntry.build(key, getPropertyValue(key), None))
recomRecord.markAsUnresolved(fillInValue)
comments += comment
}
}

def convertClusterPropsToString(): String = {
clusterProps.toString
}
Expand Down

0 comments on commit 052ab06

Please sign in to comment.