-
Notifications
You must be signed in to change notification settings - Fork 444
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
[GLUTEN-8018][CORE] Introduce ApplyResourceProfileExec to apply resource profile for query stage #8195
Conversation
Run Gluten Clickhouse CI on x86 |
#8209 is a follow up PR and demonstrate how the rule work with PR, please help review it when your guys have time. 🙏🏻 |
gluten-substrait/src/main/scala/org/apache/gluten/execution/WholeStageTransformer.scala
Outdated
Show resolved
Hide resolved
...-substrait/src/main/scala/org/apache/spark/sql/execution/ColumnarBroadcastExchangeExec.scala
Outdated
Show resolved
Hide resolved
...-clickhouse/src/main/scala/org/apache/gluten/backendsapi/clickhouse/CHSparkPlanExecApi.scala
Outdated
Show resolved
Hide resolved
gluten-substrait/src/main/scala/org/apache/gluten/execution/WholeStageTransformer.scala
Outdated
Show resolved
Hide resolved
...en-substrait/src/main/scala/org/apache/spark/sql/execution/ColumnarShuffleExchangeExec.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhztheplayer Thanks for your detailed review. I will address your comments soon.
...-clickhouse/src/main/scala/org/apache/gluten/backendsapi/clickhouse/CHSparkPlanExecApi.scala
Outdated
Show resolved
Hide resolved
...-clickhouse/src/main/scala/org/apache/gluten/backendsapi/clickhouse/CHSparkPlanExecApi.scala
Outdated
Show resolved
Hide resolved
...-clickhouse/src/main/scala/org/apache/gluten/backendsapi/clickhouse/CHSparkPlanExecApi.scala
Outdated
Show resolved
Hide resolved
gluten-substrait/src/main/scala/org/apache/gluten/execution/WholeStageTransformer.scala
Outdated
Show resolved
Hide resolved
...en-substrait/src/main/scala/org/apache/spark/sql/execution/ColumnarShuffleExchangeExec.scala
Outdated
Show resolved
Hide resolved
@zjuwangg Aside of the comments, I am thinking of another possible solution. Do you think we can use a rule to add a dummy unary query plan node on the input side of exchanges, to change the input RDD's query profile? Which means, a plan
Can become
When the rule applies. Once I feel this way is more intuitive to user and could make less code impact to other operators' code. What do you think? |
@zhztheplayer It's truely possible. Since I now do in this way for the whole stage fallback vanilla spark node in Lines 184 to 205 in 8073c47
And the plan will be like following
Good insights! |
Run Gluten Clickhouse CI on x86 |
@zhztheplayer I just revert previous commit and introduce a new ApplyResourceProfileExec node. Plz have a look when you have time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you also please fix CI error? Thanks!
gluten-substrait/src/main/scala/org/apache/gluten/execution/ApplyResourceProfileExec.scala
Outdated
Show resolved
Hide resolved
gluten-substrait/src/main/scala/org/apache/gluten/execution/ApplyResourceProfileExec.scala
Outdated
Show resolved
Hide resolved
...-clickhouse/src/main/scala/org/apache/gluten/backendsapi/clickhouse/CHSparkPlanExecApi.scala
Outdated
Show resolved
Hide resolved
* @param child | ||
* @param resourceProfile | ||
*/ | ||
case class ApplyResourceProfileExec(child: SparkPlan, resourceProfile: ResourceProfile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a suite case to show how this works?
The title of this pr should be changed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a suite case to show how this works? The title of this pr should be changed now.
Right. Will change the title and address these comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackylee-ch Thanks for your detailed review, I'll add a test suite in a following MR after this get merged and just change the tile to match commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zjuwangg Would you add @Experimental
to ApplyResourceProfileExec
if it will be tested in the next PR? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
6bfa7e6
to
25a2d4d
Compare
Run Gluten Clickhouse CI on x86 |
25a2d4d
to
c792d03
Compare
Run Gluten Clickhouse CI on x86 |
Thank you, can you put a chart of query plan again? |
if (child.logicalLink.isDefined) { | ||
setLogicalLink(ApplyResourceProfileExecAdaptor(child.logicalLink.get)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed a question here. Is there specific reason of setting the logical link with an ApplyResourceProfileExecAdaptor
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no. Just keep consistent with FakeRowLogicAdaptor
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no. Just keep consistent with FakeRowLogicAdaptor.
I see. that one may have specific reason, I am not sure.
So can we remove ApplyResourceProfileExecAdaptor
? I feel ApplyResourceProfileExecAdaptor
's logical link should be the same with its child's logical link. Since it and its child seem to be logically equivalent (share the same schema, output, statistics, etc.). Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed.
@FelixYBW |
Run Gluten Clickhouse CI on x86 |
@zhztheplayer @PHILO-HE do you know how to trigger the falling test again? The failure seems all related Network problem. |
@zjuwangg I know there is a way to retrigger CI by amending an empty commit and push it:
|
Run Gluten Clickhouse CI on x86 |
3c9aa29
to
1376cfb
Compare
Run Gluten Clickhouse CI on x86 |
Run Gluten Clickhouse CI on x86 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the code feels independent enough to merge with an @Experimental
flag added. +1 from my side. We can move to #8209 then.
CC @jackylee-ch If any further comments.
Also +1 for me, thanks. |
What changes were proposed in this pull request?
This PR aims to add interface to GlutenPlan so that we can have the chance to set resource profile,
detailed design can be found #8018.
How was this patch tested?
To be added in the following commit.