mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 22:31:55 +00:00
update fair
This commit is contained in:
parent
b920868197
commit
38d77f072e
@ -107,7 +107,6 @@ func (scheduler *SchedulerFair) Start() {
|
|||||||
|
|
||||||
/* phase 2: borrow */
|
/* phase 2: borrow */
|
||||||
if bestQueue == "" && scheduler.enableBorrow {
|
if bestQueue == "" && scheduler.enableBorrow {
|
||||||
log.Info("start borrow phase")
|
|
||||||
/* firstly, check if quota sum can run a job */
|
/* firstly, check if quota sum can run a job */
|
||||||
totalGPU := 0
|
totalGPU := 0
|
||||||
for _, quota := range scheduler.queuesQuota {
|
for _, quota := range scheduler.queuesQuota {
|
||||||
@ -135,7 +134,8 @@ func (scheduler *SchedulerFair) Start() {
|
|||||||
}
|
}
|
||||||
/* if totalGPU can satisfy that job, start borrowing */
|
/* if totalGPU can satisfy that job, start borrowing */
|
||||||
if bestQueue != "" && totalGPU >= minRequestGPU {
|
if bestQueue != "" && totalGPU >= minRequestGPU {
|
||||||
log.Info(totalGPU, minRequestGPU)
|
log.Info("start borrow phase")
|
||||||
|
log.Info(totalGPU, " still need ", minRequestGPU)
|
||||||
for {
|
for {
|
||||||
/* if all satisfied, break */
|
/* if all satisfied, break */
|
||||||
if minRequestGPU == 0 {
|
if minRequestGPU == 0 {
|
||||||
@ -156,7 +156,7 @@ func (scheduler *SchedulerFair) Start() {
|
|||||||
/* start borrow */
|
/* start borrow */
|
||||||
for queue, quota := range scheduler.queuesQuota {
|
for queue, quota := range scheduler.queuesQuota {
|
||||||
/* do not self borrow */
|
/* do not self borrow */
|
||||||
if queue == bestQueue || quota.NumberGPU < least {
|
if queue == bestQueue || quota.NumberGPU < least || least == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
quota.NumberGPU -= least
|
quota.NumberGPU -= least
|
||||||
@ -191,8 +191,8 @@ func (scheduler *SchedulerFair) Start() {
|
|||||||
}
|
}
|
||||||
IOU.NumberGPU += minRequestGPU
|
IOU.NumberGPU += minRequestGPU
|
||||||
scheduler.queuesQuota[bestQueue].NumberGPU += minRequestGPU
|
scheduler.queuesQuota[bestQueue].NumberGPU += minRequestGPU
|
||||||
minRequestGPU = 0
|
|
||||||
log.Info(bestQueue, " borrow ", minRequestGPU, " from ", queue, " now ", scheduler.queuesQuota[bestQueue].NumberGPU)
|
log.Info(bestQueue, " borrow ", minRequestGPU, " from ", queue, " now ", scheduler.queuesQuota[bestQueue].NumberGPU)
|
||||||
|
minRequestGPU = 0
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user