mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-12-15 08:16:43 +00:00
update
This commit is contained in:
@@ -185,6 +185,8 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task) NodeStatus {
|
|||||||
|
|
||||||
locks := map[int]sync.Mutex{}
|
locks := map[int]sync.Mutex{}
|
||||||
|
|
||||||
|
allocationType := 1
|
||||||
|
|
||||||
var candidates []NodeStatus
|
var candidates []NodeStatus
|
||||||
/* first round, find vacant gpu */
|
/* first round, find vacant gpu */
|
||||||
for i := 0; i < pool.poolsCount; i++ {
|
for i := 0; i < pool.poolsCount; i++ {
|
||||||
@@ -193,7 +195,7 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task) NodeStatus {
|
|||||||
for _, node := range pool.pools[(i+poolID)%pool.poolsCount] {
|
for _, node := range pool.pools[(i+poolID)%pool.poolsCount] {
|
||||||
var available []GPUStatus
|
var available []GPUStatus
|
||||||
for _, status := range node.Status {
|
for _, status := range node.Status {
|
||||||
if status.MemoryTotal >= task.MemoryGPU && status.MemoryUsed < 10 {
|
if status.MemoryAllocated == 0 && status.MemoryUsed < 10 {
|
||||||
available = append(available, status)
|
available = append(available, status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,6 +215,7 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task) NodeStatus {
|
|||||||
/* second round, find sharable gpu */
|
/* second round, find sharable gpu */
|
||||||
if len(candidates) == 0 {
|
if len(candidates) == 0 {
|
||||||
// check sharable
|
// check sharable
|
||||||
|
allocationType = 2
|
||||||
log.Info("dasdsa")
|
log.Info("dasdsa")
|
||||||
if util, valid := InstanceOfOptimizer().predictUtilGPU(job.Name); valid {
|
if util, valid := InstanceOfOptimizer().predictUtilGPU(job.Name); valid {
|
||||||
|
|
||||||
@@ -255,11 +258,12 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task) NodeStatus {
|
|||||||
log.Info(candidates)
|
log.Info(candidates)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Info(allocationType)
|
||||||
/*assign*/
|
/*assign*/
|
||||||
if len(candidates) > 0 {
|
if len(candidates) > 0 {
|
||||||
var available []GPUStatus
|
var available []GPUStatus
|
||||||
for _, status := range candidates[0].Status {
|
for _, status := range candidates[0].Status {
|
||||||
if status.MemoryTotal >= task.MemoryGPU && status.MemoryUsed < 10 {
|
if status.MemoryAllocated == 0 && status.MemoryUsed < 10 {
|
||||||
available = append(available, status)
|
available = append(available, status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user