marin-ma commented on code in PR #12588:
URL: https://github.com/apache/gluten/pull/12588#discussion_r3760526423
##########
gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenAutoAdjustStageResourceProfile.scala:
##########
@@ -67,6 +67,28 @@ case class GlutenAutoAdjustStageResourceProfile(glutenConf:
GlutenConfig, spark:
GlutenResourceProfile.updateResourceSetting(
ResourceProfile.getOrCreateDefaultProfile(sparkConf),
sparkConf)
+
+ val rpManager = spark.sparkContext.resourceProfileManager
+ val defaultRP = rpManager.defaultResourceProfile
+
+ // initial resource profile config as default resource profile
+ val taskResource = mutable.Map.empty[String, TaskResourceRequest] ++=
defaultRP.taskResources
+ val executorResource =
+ mutable.Map.empty[String, ExecutorResourceRequest] ++=
defaultRP.executorResources
+
+ if (glutenConf.enableColumnarCudf && glutenConf.enableHybridExecution) {
+ val transformers = plan.collect { case t: WholeStageTransformer => t }
+ if (transformers.nonEmpty && transformers.forall(_.isCudf)) {
+ return GlutenResourceProfile.setResourceProfileForGpu(
+ plan,
+ executorResource,
+ taskResource,
+ rpManager,
+ sparkConf,
+ glutenConf)
+ }
+ }
Review Comment:
The rule can apply to node other than `Exchange`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]