Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable features via config that are off by default in the profiler AutoTuner #668

Merged
merged 5 commits into from
Dec 5, 2023
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Fix missing methods due to merging
Signed-off-by: Partho Sarthi <[email protected]>
  • Loading branch information
parthosa committed Dec 4, 2023
commit 69fdd297b06082a9ae8830f21bdcfb79358a715e
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class Profiler(hadoopConf: Configuration, appArgs: ProfileArgs, enablePB: Boolea

private val useAutoTuner: Boolean = appArgs.autoTuner()
private var progressBar: Option[ConsoleProgressBar] = None
private var unsupportedDriverOperators: Seq[DriverLogUnsupportedOperators] = Seq.empty

logInfo(s"Threadpool size is $nThreads")

Expand Down Expand Up @@ -130,9 +129,16 @@ class Profiler(hadoopConf: Configuration, appArgs: ProfileArgs, enablePB: Boolea
Profiler.DRIVER_LOG_NAME, numOutputRows, true)
try {
val driverLogProcessor = new DriverLogProcessor(driverLogInfos)
val unsupportedDrivers = driverLogProcessor.processDriverLog()
val unsupportedDriverOperators = driverLogProcessor.processDriverLog()
profileOutputWriter.write(s"Unsupported operators in driver log",
unsupportedDrivers)
unsupportedDriverOperators)
if (eventLogsEmpty && useAutoTuner) {
// Since event logs are empty, AutoTuner will not run while processing event logs.
// We need to run it here explicitly.
val (properties, comments) = runAutoTuner(None, unsupportedDriverOperators)
profileOutputWriter.writeText("\n### A. Recommended Configuration ###\n")
profileOutputWriter.writeText(Profiler.getAutoTunerResultsAsString(properties, comments))
}
} finally {
profileOutputWriter.close()
}
Expand Down Expand Up @@ -403,6 +409,26 @@ class Profiler(hadoopConf: Configuration, appArgs: ProfileArgs, enablePB: Boolea
appLogPath, ioAnalysisMetrics), compareRes)
}

/**
* A wrapper method to run the AutoTuner.
* @param appInfo Summary of the application for tuning.
* @param unsupportedDriverOperators List of unsupported operators from driver log
*/
private def runAutoTuner(appInfo: Option[ApplicationSummaryInfo],
unsupportedDriverOperators: Seq[DriverLogUnsupportedOperators])
: (Seq[RecommendedPropertyResult], Seq[RecommendedCommentResult]) = {
val appInfoProvider = appInfo.map(new SingleAppSummaryInfoProvider(_)).orNull
val workerInfoPath = appArgs.workerInfo.getOrElse(AutoTuner.DEFAULT_WORKER_INFO_PATH)
val platform = appArgs.platform()
val autoTuner: AutoTuner = AutoTuner.buildAutoTuner(workerInfoPath, appInfoProvider,
PlatformFactory.createInstance(platform), unsupportedDriverOperators)

// The autotuner allows skipping some properties,
// e.g., getRecommendedProperties(Some(Seq("spark.executor.instances"))) skips the
// recommendation related to executor instances.
autoTuner.getRecommendedProperties()
}

def writeOutput(profileOutputWriter: ProfileOutputWriter,
appsSum: Seq[ApplicationSummaryInfo], outputCombined: Boolean,
comparedRes: Option[CompareSummaryInfo] = None): Unit = {
Expand Down Expand Up @@ -510,15 +536,7 @@ class Profiler(hadoopConf: Configuration, appArgs: ProfileArgs, enablePB: Boolea
Some("Unsupported SQL Ops"))

if (useAutoTuner) {
val workerInfoPath = appArgs.workerInfo.getOrElse(AutoTuner.DEFAULT_WORKER_INFO_PATH)
val platform = appArgs.platform()
val autoTuner: AutoTuner = AutoTuner.buildAutoTuner(workerInfoPath,
new SingleAppSummaryInfoProvider(app),
PlatformFactory.createInstance(platform))
// the autotuner allows skipping some properties
// e.g. getRecommendedProperties(Some(Seq("spark.executor.instances"))) skips the
// recommendation related to executor instances.
val (properties, comments) = autoTuner.getRecommendedProperties()
val (properties, comments) = runAutoTuner(Some(app), Seq.empty)
profileOutputWriter.writeText("\n### D. Recommended Configuration ###\n")
profileOutputWriter.writeText(Profiler.getAutoTunerResultsAsString(properties, comments))
}
Expand Down
Loading