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

Qualification tool: update SQL Df value used and look at jobs in SQL #5612

Merged
merged 141 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
55c8384
QualificationTool. Add speedup information to AppSummaryInfo
amahussein May 10, 2022
82a5a9b
address review comments
amahussein May 11, 2022
9d0cbc3
debug
tgravescs May 11, 2022
af060fb
check for dataset
tgravescs May 11, 2022
ed74657
change dataset check for all
tgravescs May 11, 2022
17b39c7
test unsupported time
tgravescs May 11, 2022
6b2d419
more changes
tgravescs May 12, 2022
c14e2e3
fix to string
tgravescs May 13, 2022
da9665d
fix including wholestage codegen
tgravescs May 13, 2022
a68deae
put unsupported Dur
tgravescs May 13, 2022
c965c1c
calculate duration of non sql stages
tgravescs May 13, 2022
53668a4
change to get stage task time
tgravescs May 13, 2022
480ddee
combine
tgravescs May 13, 2022
c7aa64b
hooking up final output
tgravescs May 13, 2022
9b09b23
initial scores changes
tgravescs May 13, 2022
5ad9ec4
logging
tgravescs May 13, 2022
5af6d70
logging
tgravescs May 13, 2022
3abed14
update factor
tgravescs May 13, 2022
c0f3bb5
gturn off some logging:
tgravescs May 13, 2022
b8b0ad9
debug
tgravescs May 13, 2022
e941ca4
Merge remote-tracking branch 'origin/branch-22.06' into qualStageMetrics
tgravescs May 13, 2022
718a32a
track execs without stages
tgravescs May 13, 2022
14419e8
Add in exec info output
tgravescs May 13, 2022
1a1b5d1
fix output
tgravescs May 13, 2022
f715975
add sorting
tgravescs May 13, 2022
5fbe980
fix output
tgravescs May 13, 2022
aaf3873
fix output sizes
tgravescs May 13, 2022
ad365cd
use plan infos without execs removed
tgravescs May 13, 2022
e5c3551
output children node ids
tgravescs May 13, 2022
851b712
output stages info
tgravescs May 13, 2022
16d88c3
cleanup
tgravescs May 16, 2022
f391f28
fix running app
tgravescs May 16, 2022
66c02aa
fix stage header
tgravescs May 16, 2022
1fdd4ff
Start removing unneeded fields
tgravescs May 16, 2022
7b07645
Update summary table
tgravescs May 17, 2022
7f9ce84
cleanup
tgravescs May 17, 2022
f3747df
fix sorting
tgravescs May 17, 2022
0d12a73
update running app
tgravescs May 17, 2022
0da6523
update test
tgravescs May 17, 2022
e17f99b
fix missing
tgravescs May 17, 2022
6ff627e
fix more reporting to be based on supported execs
tgravescs May 18, 2022
d576e05
fixes
tgravescs May 18, 2022
0ed07c7
fix test
tgravescs May 18, 2022
d4b30a0
fix event processor calling base
tgravescs May 18, 2022
cec6671
fix df duration
tgravescs May 18, 2022
b86debd
debug
tgravescs May 18, 2022
cc1c7ca
debug
tgravescs May 18, 2022
beecfe1
fix double and int
tgravescs May 18, 2022
9ee8245
fix double
tgravescs May 18, 2022
ce1fe51
Merge remote-tracking branch 'origin/branch-22.06' into qualStageMetrics
tgravescs May 18, 2022
2fa41d7
fxi merge
tgravescs May 18, 2022
ab7a490
fix double
tgravescs May 18, 2022
f9e9869
fix divide 0
tgravescs May 18, 2022
2d5ac8a
fix double to 2 precision
tgravescs May 18, 2022
cc9cdc1
fix formatting output
tgravescs May 18, 2022
6935f83
fix sorting
tgravescs May 18, 2022
6ef010f
fix Running
tgravescs May 18, 2022
30bf186
move around sorting
tgravescs May 18, 2022
cc1686e
remove logWarnings
tgravescs May 18, 2022
dad9610
update sorting
tgravescs May 18, 2022
4c25dc5
Add appId to execs report
tgravescs May 18, 2022
56c0f72
update sxtages output
tgravescs May 18, 2022
4539f1e
remove unused imports
tgravescs May 18, 2022
56a5527
fix running app
tgravescs May 18, 2022
43d4a4e
update tests
tgravescs May 18, 2022
8e61126
fix sorting
tgravescs May 18, 2022
cae9209
add estimated into to summary info
tgravescs May 18, 2022
7da0719
fix running
tgravescs May 18, 2022
56bb07b
try using enum
tgravescs May 18, 2022
493a5af
fix recommendation to string
tgravescs May 18, 2022
4d55c27
update to use recommended/strongly recommended
tgravescs May 18, 2022
a8776e1
fix ecommendation
tgravescs May 18, 2022
9d4765b
fix divide 0
tgravescs May 18, 2022
5afce2c
fix opportunity
tgravescs May 18, 2022
25d4c0b
fix up df task duration
tgravescs May 18, 2022
e9cc761
debug
tgravescs May 18, 2022
ae3be31
fix bug with estimated in csv
tgravescs May 18, 2022
b25f88a
rearrange codce
tgravescs May 18, 2022
a832316
cleanup
tgravescs May 18, 2022
32f0545
cleanup and start handling failures
tgravescs May 18, 2022
152a01c
handle failures and cleanup
tgravescs May 19, 2022
13f42ba
fix output
tgravescs May 19, 2022
36a3e0f
change sorting
tgravescs May 19, 2022
89d70fa
fixies
tgravescs May 19, 2022
2d5303c
handle test having udf
tgravescs May 19, 2022
b8ab8cd
change speedup of the *InPandas and arrow eval
tgravescs May 19, 2022
ef25228
fix test
tgravescs May 19, 2022
96032d3
fix ui after changing field names
amahussein May 19, 2022
9c9f825
make ExecInfo regular class
tgravescs May 19, 2022
cf9aad2
Merge pull request #5 from amahussein/qualStageMetrics-ui-check
tgravescs May 19, 2022
1554564
fix commented out
tgravescs May 19, 2022
0268e34
fix more execinfo
tgravescs May 19, 2022
7c8e6a7
update test schema
tgravescs May 19, 2022
40dc9a7
change what goes to DF
tgravescs May 19, 2022
fc980a1
move to outer class
tgravescs May 19, 2022
727eae5
fix schema
tgravescs May 19, 2022
99f7115
fix limit option
tgravescs May 19, 2022
fdf2af0
remove extra header csv
tgravescs May 19, 2022
b2540aa
match up test with csv
tgravescs May 19, 2022
6b4f7b8
Fix not supported read formats
tgravescs May 19, 2022
8f8a54f
update results
tgravescs May 19, 2022
8c19833
2 places for average speedup
tgravescs May 19, 2022
4c1a267
Merge branch 'qualStageMetrics' of github.com:tgravescs/spark-rapids …
tgravescs May 19, 2022
5e88b53
update results
tgravescs May 19, 2022
9c741ae
update results
tgravescs May 19, 2022
273754e
comment out tests
tgravescs May 19, 2022
826aca1
update test
tgravescs May 19, 2022
8ecf8b8
update operator scores
tgravescs May 19, 2022
992296c
cleanup
tgravescs May 19, 2022
503b42f
test sql df times
tgravescs May 20, 2022
c1b777f
Update more to use spark reported df duration
tgravescs May 20, 2022
4afa4db
fix patch longest sql duration
tgravescs May 20, 2022
0c0d3e5
fix task duration
tgravescs May 20, 2022
0e32b56
try to calculate sql overhead
tgravescs May 20, 2022
adb26c8
only use stages used in sql
tgravescs May 20, 2022
9d85268
remove some decimal checks
tgravescs May 20, 2022
bf135e9
cleanup utils
tgravescs May 20, 2022
67d8e15
calculate task time for stages in jobs in sql but not in execs
tgravescs May 20, 2022
f78c3f2
look at texecs without stages
tgravescs May 20, 2022
0f0af93
change to account for sql ids without stage mapping
tgravescs May 23, 2022
fe44c45
dedup
tgravescs May 23, 2022
6903cb4
fix compil
tgravescs May 23, 2022
bd99446
fix set
tgravescs May 23, 2022
f93d289
Merge remote-tracking branch 'origin/branch-22.06' into qualDFTime
tgravescs May 23, 2022
8281314
update test results
tgravescs May 23, 2022
3931e80
Merge branch 'qualDFTime' of github.com:tgravescs/spark-rapids into q…
tgravescs May 23, 2022
705b2c5
fix merge
tgravescs May 23, 2022
bf25347
Merge branch 'qualDFTime' of github.com:tgravescs/spark-rapids into q…
tgravescs May 23, 2022
a9de996
fix extra code
tgravescs May 23, 2022
addaa94
update csv exepcted results
tgravescs May 23, 2022
17e26d3
move logging
tgravescs May 23, 2022
6d13c56
aggreaget Wholestagecodegen and children stages
tgravescs May 23, 2022
47522da
commonize code
tgravescs May 24, 2022
ef473e4
change type to not be seq of set
tgravescs May 24, 2022
61d8466
update latest test results
tgravescs May 24, 2022
85ebdf7
Merge remote-tracking branch 'origin/branch-22.06' into qualDFTime
tgravescs May 24, 2022
8e22606
update dsv2 results
tgravescs May 24, 2022
cd035c0
remove logging
tgravescs May 24, 2022
69241e3
typo
tgravescs May 24, 2022
5c9785e
Handle case sql duration > app duration
tgravescs May 24, 2022
b1bc983
remove unused variable
tgravescs May 24, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,20 @@ case class WholeStageExecParser(
val maxDuration = SQLPlanParser.getTotalDuration(accumId, app)
val stagesInNode = SQLPlanParser.getStagesInSQLNode(node, app)

val childNodeRes = node.nodes.flatMap { c =>
val childNodes = node.nodes.flatMap { c =>
SQLPlanParser.parsePlanNode(c, sqlID, checker, app)
}
// if any of the execs in WholeStageCodegen supported mark this entire thing
// as supported
val anySupported = childNodeRes.exists(_.isSupported == true)
val anySupported = childNodes.exists(_.isSupported == true)
// average speedup across the execs in the WholeStageCodegen for now
val supportedChildren = childNodeRes.filterNot(_.shouldRemove)
val supportedChildren = childNodes.filterNot(_.shouldRemove)
val avSpeedupFactor = SQLPlanParser.averageSpeedup(supportedChildren.map(_.speedupFactor))
// can't rely on the wholeStagecodeGen having a stage if children do so aggregate them together
// for now
val allStagesIncludingChildren = childNodes.flatMap(_.stages).toSet ++ stagesInNode.toSet
val execInfo = new ExecInfo(sqlID, node.name, node.name, avSpeedupFactor, maxDuration,
node.id, anySupported, Some(childNodeRes), stagesInNode)
node.id, anySupported, Some(childNodes), allStagesIncludingChildren.toSeq)
Seq(execInfo)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,7 @@ class PluginTypeChecker extends Logging {
// check if any of the not supported types are in the schema
val nsFiltered = dtSupMap(NS).filter(t => schemaLower.contains(t.toLowerCase()))
if (nsFiltered.nonEmpty) {
val deDuped = if (nsFiltered.contains("dec") && nsFiltered.contains("decimal")) {
nsFiltered.filterNot(_.equals("dec"))
} else {
nsFiltered
}
(0.0, deDuped.toSet)
(0.0, nsFiltered.toSet)
} else {
// Started out giving different weights based on partial support and so forth
// but decided to be optimistic and not penalize if we don't know, perhaps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class QualOutputWriter(outputDir: String, reportReadSchema: Boolean, printStdout
val plans = sums.flatMap(_.planInfo)
val allExecs = QualOutputWriter.getAllExecsFromPlan(plans)
val headersAndSizes = QualOutputWriter
.getDetailedExecsHeaderStringsAndSizes(sums, allExecs)
.getDetailedExecsHeaderStringsAndSizes(sums, allExecs.toSeq)
csvFileWriter.write(QualOutputWriter.constructDetailedHeader(headersAndSizes, ",", false))
sums.foreach { sumInfo =>
val rows = QualOutputWriter.constructExecsInfo(sumInfo, headersAndSizes, ",", false)
Expand Down Expand Up @@ -165,6 +165,7 @@ object QualOutputWriter {
val ESTIMATED_GPU_DURATION = "Estimated GPU Duration"
val ESTIMATED_GPU_SPEEDUP = "Estimated GPU Speedup"
val ESTIMATED_GPU_TIMESAVED = "Estimated GPU Time Saved"
val STAGE_ESTIMATED_STR = "Stage Estimated"

val APP_DUR_STR_SIZE: Int = APP_DUR_STR.size
val SQL_DUR_STR_SIZE: Int = SQL_DUR_STR.size
Expand Down Expand Up @@ -360,7 +361,8 @@ object QualOutputWriter {
STAGE_ID_STR -> STAGE_ID_STR.size,
AVERAGE_SPEEDUP_STR -> AVERAGE_SPEEDUP_STR.size,
STAGE_DUR_STR -> STAGE_DUR_STR.size,
UNSUPPORTED_TASK_DURATION_STR -> UNSUPPORTED_TASK_DURATION_STR.size
UNSUPPORTED_TASK_DURATION_STR -> UNSUPPORTED_TASK_DURATION_STR.size,
STAGE_ESTIMATED_STR -> STAGE_ESTIMATED_STR.size
)
detailedHeadersAndFields
}
Expand All @@ -377,23 +379,24 @@ object QualOutputWriter {
info.stageId.toString -> headersAndSizes(STAGE_ID_STR),
f"${info.averageSpeedup}%1.2f" -> headersAndSizes(AVERAGE_SPEEDUP_STR),
info.stageTaskTime.toString -> headersAndSizes(STAGE_DUR_STR),
info.unsupportedTaskDur.toString -> headersAndSizes(UNSUPPORTED_TASK_DURATION_STR))
info.unsupportedTaskDur.toString -> headersAndSizes(UNSUPPORTED_TASK_DURATION_STR),
info.estimated.toString -> headersAndSizes(STAGE_ESTIMATED_STR))
constructOutputRow(data, delimiter, prettyPrint)
}
}

def getAllExecsFromPlan(plans: Seq[PlanInfo]): Seq[ExecInfo] = {
def getAllExecsFromPlan(plans: Seq[PlanInfo]): Set[ExecInfo] = {
val topExecInfo = plans.flatMap(_.execInfo)
topExecInfo.flatMap { e =>
e.children.getOrElse(Seq.empty) :+ e
}
}.toSet
}

def constructExecsInfo(
sumInfo: QualificationSummaryInfo,
headersAndSizes: LinkedHashMap[String, Int],
delimiter: String = "|",
prettyPrint: Boolean): Seq[String] = {
prettyPrint: Boolean): Set[String] = {
val allExecs = getAllExecsFromPlan(sumInfo.planInfo)
val appId = sumInfo.appId
allExecs.flatMap { info =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ abstract class AppBase(

// jobId to job info
val jobIdToInfo = new HashMap[Int, JobInfoClass]()
val jobIdToSqlID: HashMap[Int, Long] = HashMap.empty[Int, Long]

// SQL containing any Dataset operation or RDD to DataSet/DataFrame operation
val sqlIDToDataSetOrRDDCase: HashSet[Long] = HashSet[Long]()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ abstract class EventProcessorBase[T <: AppBase](app: T) extends SparkListener wi
ProfileUtils.isPluginEnabled(event.properties.asScala) || app.gpuMode
)
app.jobIdToInfo.put(event.jobId, thisJob)
sqlID.foreach(app.jobIdToSqlID(event.jobId) = _)
}

override def onJobStart(jobStart: SparkListenerJobStart): Unit = {
Expand Down
Loading