jiangxb1987 commented on a change in pull request #24374: [SPARK-27366][CORE]
Support GPU Resources in Spark job scheduling
URL: https://github.com/apache/spark/pull/24374#discussion_r287173033
##########
File path:
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala
##########
@@ -335,9 +339,10 @@ private[spark] class TaskSchedulerImpl(
for (i <- 0 until shuffledOffers.size) {
val execId = shuffledOffers(i).executorId
val host = shuffledOffers(i).host
- if (availableCpus(i) >= CPUS_PER_TASK) {
+ if (availableCpus(i) >= CPUS_PER_TASK &&
+ resourceMeetTaskRequirements(availableResources(i))) {
try {
- for (task <- taskSet.resourceOffer(execId, host, maxLocality)) {
+ for (task <- taskSet.resourceOffer(execId, host, maxLocality,
availableResources(i))) {
tasks(i) += task
val tid = task.taskId
taskIdToTaskSetManager.put(tid, taskSet)
Review comment:
I just feel if we only bookkeep by count here and actually allocate the
addresses in SchedulerBackend then we need to pay slightly more attention to
ensure these two places are synchronized. After all I'm neutral here and would
be happy to go another way if someone feels strongly about this.
----------------------------------------------------------------
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]