Copilot commented on code in PR #13518:
URL: https://github.com/apache/gluten/pull/13518#discussion_r4439371377


##########
gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenAutoAdjustStageResourceProfile.scala:
##########
@@ -241,11 +241,18 @@ object GlutenAutoAdjustStageResourceProfile extends 
Logging {
       SparkResourceUtil.getTaskSlots(sparkConf)
     } else {
       val coresPerExecutor = 
rp.getExecutorCores.getOrElse(sparkConf.get(EXECUTOR_CORES))
-      val coresPerTask = rp.getTaskCpus.getOrElse(sparkConf.get(CPUS_PER_TASK))
+      // Spark 4.3 allows fractional task cpus, so the profile and the config 
report them as
+      // BigDecimal there and as Int before. Go through the string form so 
both compile and the
+      // value stays exact.
+      val coresPerTask = BigDecimal(
+        rp.getTaskCpus.getOrElse(sparkConf.get(CPUS_PER_TASK)).toString)

Review Comment:
   With `spark.task.cpus=0.5` on Spark 4.3, driver initialization still fails 
because `GlutenDriverPlugin.setPredefinedConfigs` calls 
`SparkResourceUtil.getTaskSlots`, which parses the setting with `conf.getInt` 
(`SparkResourceUtil.scala:85`). The local-master branch here also uses that 
integer-only helper. Update the shared helper to parse decimal CPU amounts and 
share the exact floor-division logic with this resource-profile calculation so 
fractional settings work through initialization and execution.



-- 
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]

Reply via email to