tgravescs 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_r287148845
##########
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 think its a bit out of place that we are decrementing the addresses
available in the resourceOffer function since everything else does its
bookkeeping right here. I don't think that is a blocker for this though and
the way
----------------------------------------------------------------
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]