Skip to content

Commit

Permalink
Update comment to include an example config
Browse files Browse the repository at this point in the history
Signed-off-by: Partho Sarthi <[email protected]>
  • Loading branch information
parthosa committed Jan 6, 2025
1 parent 790c8b9 commit 4b57134
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ abstract class Platform(var gpuDevice: Option[GpuDevice],
val clusterProperties: Option[ClusterProperties]) extends Logging {
val platformName: String
val defaultGpuDevice: GpuDevice
val sparkVersionLabel: String = "Spark version"

// It's not deal to use vars here but to minimize changes and
// keep backwards compatibility we put them here for now and hopefully
Expand Down Expand Up @@ -172,6 +173,13 @@ abstract class Platform(var gpuDevice: Option[GpuDevice],
}
}

/**
* Identify the latest supported Spark and RapidsShuffleManager version for the platform.
*/
lazy val latestSupportedShuffleManagerInfo: (String, String) = {
supportedShuffleManagerVersionMap.maxBy(_._1)
}

/**
* Checks if the given runtime is supported by the platform.
*/
Expand Down Expand Up @@ -555,6 +563,7 @@ abstract class Platform(var gpuDevice: Option[GpuDevice],
abstract class DatabricksPlatform(gpuDevice: Option[GpuDevice],
clusterProperties: Option[ClusterProperties]) extends Platform(gpuDevice, clusterProperties) {
override val defaultGpuDevice: GpuDevice = T4Gpu
override val sparkVersionLabel: String = "Databricks runtime"
override def isPlatformCSP: Boolean = true

override val supportedRuntimes: Set[SparkRuntime.SparkRuntime] = Set(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,8 @@ class AutoTuner(
case Some(smVersion) =>
Right(autoTunerConfigsProvider.buildShuffleManagerClassName(smVersion))
case None =>
Left(autoTunerConfigsProvider.shuffleManagerCommentForUnsupportedVersion(sparkVersion))
Left(autoTunerConfigsProvider.shuffleManagerCommentForUnsupportedVersion(
sparkVersion, platform))
}
case None =>
Left(autoTunerConfigsProvider.shuffleManagerCommentForMissingVersion)
Expand Down Expand Up @@ -1467,11 +1468,17 @@ trait AutoTunerConfigsProvider extends Logging {
s"com.nvidia.spark.rapids.spark$smVersion.RapidsShuffleManager"
}

def shuffleManagerCommentForUnsupportedVersion(sparkVersion: String): String = {
s"Cannot recommend RAPIDS Shuffle Manager for unsupported '$sparkVersion' version.\n" +
" To enable RAPIDS Shuffle Manager, set 'spark.shuffle.manager' to a value\n" +
" from the supported versions. \n" +
s" See supported versions: $shuffleManagerDocUrl."
def shuffleManagerCommentForUnsupportedVersion(
sparkVersion: String, platform: Platform): String = {
val (latestSparkVersion, latestSmVersion) = platform.latestSupportedShuffleManagerInfo
// scalastyle:off line.size.limit
s"""
|Cannot recommend RAPIDS Shuffle Manager for unsupported ${platform.sparkVersionLabel}: '$sparkVersion'.
|To enable RAPIDS Shuffle Manager, use a supported ${platform.sparkVersionLabel} (e.g., '$latestSparkVersion')
|and set: '--conf spark.shuffle.manager=com.nvidia.spark.rapids.spark$latestSmVersion.RapidsShuffleManager'.
|See supported versions: $shuffleManagerDocUrl.
|""".stripMargin.trim.replaceAll("\n", "\n ")
// scalastyle:on line.size.limit
}

def shuffleManagerCommentForMissingVersion: String = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2255,7 +2255,7 @@ We recommend using nodes/workers with more memory. Need at least 7796MB memory."
fail(s"Expected error comment but got valid RapidsShuffleManager: $smClassName")
case Left(comment) =>
assert(comment == ProfilingAutoTunerConfigsProvider
.shuffleManagerCommentForUnsupportedVersion(sparkVersion))
.shuffleManagerCommentForUnsupportedVersion(sparkVersion, autoTuner.platform))
}
}

Expand Down

0 comments on commit 4b57134

Please sign in to comment.