Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/device/ascend/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,11 @@ func (npu *Devices) Fit(devices []*device.DeviceUsage, request device.ContainerD
dev := v
klog.V(4).InfoS("scoring pod", "pod", klog.KObj(pod), "device", dev.ID, "Memreq", k.Memreq, "MemPercentagereq", k.MemPercentagereq, "Coresreq", k.Coresreq, "Nums", k.Nums, "device index", i)

if !dev.Health {
Comment thread
archlitchi marked this conversation as resolved.
Resolved
reason[common.CardNotHealth]++
klog.V(5).InfoS(common.CardNotHealth, "pod", klog.KObj(pod), "device", dev.ID, "health", dev.Health)
continue
}
_, found, numa := npu.checkType(pod.GetAnnotations(), *dev, k)
if !found {
reason[common.CardTypeMismatch]++
Expand Down
26 changes: 26 additions & 0 deletions pkg/device/ascend/device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,32 @@ func TestDevices_Fit(t *testing.T) {
wantDevIDs: []string{},
wantReason: "1/1 ExclusiveDeviceAllocateConflict",
},
{
name: "fit fail: CardNotHealth",
devices: []*device.DeviceUsage{{
ID: "dev-0",
Index: 0,
Used: 0,
Count: 100,
Usedmem: 0,
Totalmem: 1280,
Totalcore: 100,
Usedcores: 0,
Numa: 0,
Health: false,
}},
request: device.ContainerDeviceRequest{
Nums: 1,
Memreq: 512,
MemPercentagereq: 0,
Coresreq: 50,
},
annos: map[string]string{},
wantFit: false,
wantLen: 0,
wantDevIDs: []string{},
wantReason: "1/1 CardNotHealth",
},
}

for _, dev := range devs {
Expand Down
Loading