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

Expose row count statistics in GpuShuffleExchangeExec #1855

Merged
merged 8 commits into from
Mar 5, 2021

Conversation

andygrove
Copy link
Contributor

Expose row count statistics in GpuShuffleExchangeExec so that we can later use them as an input to the cost model

andygrove and others added 2 commits March 3, 2021 10:22
…ark301/Spark301Shims.scala

Co-authored-by: Jason Lowe <jlowe@nvidia.com>
…Exec instead of SparkPlan

Signed-off-by: Andy Grove <andygrove@nvidia.com>
gerashegalov
gerashegalov previously approved these changes Mar 3, 2021
Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

val shuffleExchanges = ShimLoader.getSparkShims
.findOperators(innerAdaptivePlan, _.isInstanceOf[ShuffleQueryStageExec])
.map(_.asInstanceOf[ShuffleQueryStageExec])
assert(shuffleExchanges.nonEmpty)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe add a message to the assert for a more descriptive exception

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't generally been using assertion messages. I have updated the assertion to make it more specific though.

@@ -134,6 +135,10 @@ class Spark300Shims extends SparkShims {
override def isShuffleExchangeLike(plan: SparkPlan): Boolean =
plan.isInstanceOf[ShuffleExchangeExec]

override def getQueryStageRuntimeStatistics(plan: QueryStageExec): Statistics = {
Statistics(0, None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Statistics(0) since None is the default for rowcount

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@sameerz sameerz added the task Work required that improves the product but is not user facing label Mar 3, 2021
@sameerz sameerz added this to the Mar 1 - Mar 12 milestone Mar 3, 2021
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove
Copy link
Contributor Author

build

abellina
abellina previously approved these changes Mar 4, 2021
jlowe
jlowe previously approved these changes Mar 4, 2021
@andygrove
Copy link
Contributor Author

The new unit test failed against 3.1.x. I am investigating this.

Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove andygrove dismissed stale reviews from jlowe and abellina via aa040f1 March 4, 2021 18:28
@andygrove
Copy link
Contributor Author

build

@andygrove
Copy link
Contributor Author

Sorry, @abellina @gerashegalov @jlowe I had to push yet another change. CI is green now. Thanks.

val shuffleExchanges = ShimLoader.getSparkShims
.findOperators(innerAdaptivePlan, _.isInstanceOf[ShuffleQueryStageExec])
.map(_.asInstanceOf[ShuffleQueryStageExec])
assert(shuffleExchanges.length == 2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: triple equals produces better diagnostics:

scala> assert(1 == 0)
org.scalatest.exceptions.TestFailedException
  at org.scalatest.Assertions.newAssertionFailedException(Assertions.scala:528)
  at org.scalatest.Assertions.newAssertionFailedException$(Assertions.scala:527)
  at org.scalatest.Assertions$.newAssertionFailedException(Assertions.scala:1387)
  at org.scalatest.Assertions$AssertionsHelper.macroAssert(Assertions.scala:501)
  ... 59 elided

scala> assert(1 === 0)
org.scalatest.exceptions.TestFailedException: 1 did not equal 0
  at org.scalatest.Assertions.newAssertionFailedException(Assertions.scala:528)
  at org.scalatest.Assertions.newAssertionFailedException$(Assertions.scala:527)
  at org.scalatest.Assertions$.newAssertionFailedException(Assertions.scala:1387)
  at org.scalatest.Assertions$AssertionsHelper.macroAssert(Assertions.scala:501)
  ... 59 elided

Signed-off-by: Andy Grove <andygrove@nvidia.com>
jlowe
jlowe previously approved these changes Mar 4, 2021
@andygrove
Copy link
Contributor Author

build

gerashegalov
gerashegalov previously approved these changes Mar 4, 2021
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove andygrove dismissed stale reviews from gerashegalov and jlowe via 71a62b1 March 5, 2021 00:04
@andygrove
Copy link
Contributor Author

build

@andygrove andygrove merged commit f66c3ef into NVIDIA:branch-0.5 Mar 5, 2021
@andygrove andygrove deleted the row-count-stats branch March 5, 2021 16:24
nartal1 pushed a commit to nartal1/spark-rapids that referenced this pull request Jun 9, 2021
nartal1 pushed a commit to nartal1/spark-rapids that referenced this pull request Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Work required that improves the product but is not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants