mengxr commented on a change in pull request #24406: [SPARK-27024] Executor 
interface for cluster managers to support GPU and other resources
URL: https://github.com/apache/spark/pull/24406#discussion_r283617243
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
 ##########
 @@ -72,6 +83,97 @@ private[spark] class CoarseGrainedExecutorBackend(
     }(ThreadUtils.sameThread)
   }
 
+  // Check that the actual resources discovered will satisfy the user specified
+  // requirements and that they match the configs specified by the user to 
catch
+  // mismatches between what the user requested and what resource manager gave 
or
+  // what the discovery script found.
+  private def checkResourcesMeetRequirements(
 
 Review comment:
   Had an offline discussion with @WeichenXu123 . He suggested refactoring this 
check to make it easier to read. Now the arguments are:
   
   * `reqResourcesAndCounts`: request per task (not per executor)
   * `actualResources`: resources allocated per executor
   
   It is not easy to tell from the variable names and hence make the code 
harder to read. Basically we need the following:
   
   1. number allocated per executor cannot be smaller than requested count for 
each resource name
   2. requested count for executor cannot be smaller than requested count for 
task for each resource name. Note that this doesn't require resource discovery.
   3. the set of requested resource names for executors should match the set of 
requested resource names for tasks.
   
   It would be nice to refactor the method into those three. We can also do it 
in a follow-up PR.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to