harmonytask tests
This commit is contained in:
@@ -399,6 +399,9 @@ func (e *TaskEngine) resourcesInUse() resources.Resources {
|
||||
tmp.Cpu -= int(ct) * t.Cost.Cpu
|
||||
tmp.Gpu -= float64(ct) * t.Cost.Gpu
|
||||
tmp.Ram -= uint64(ct) * t.Cost.Ram
|
||||
if len(t.Cost.GpuRam) == 0 {
|
||||
continue
|
||||
}
|
||||
for i := int32(0); i < ct; i++ {
|
||||
for grIdx, j := range tmp.GpuRam {
|
||||
if j > t.Cost.GpuRam[0] {
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
"github.com/samber/lo"
|
||||
|
||||
"github.com/filecoin-project/lotus/lib/harmony/harmonydb"
|
||||
)
|
||||
@@ -219,7 +220,7 @@ func (h *taskTypeHandler) AssertMachineHasCapacity() error {
|
||||
return errors.New("Did not accept " + h.Name + " task: out of available GPU")
|
||||
}
|
||||
for _, u := range r.GpuRam {
|
||||
if u > h.Cost.GpuRam[0] {
|
||||
if u > lo.Sum(h.Cost.GpuRam) {
|
||||
goto enoughGpuRam
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user