Unverified Commit 81d55d3e authored by Daniel Hiltgen's avatar Daniel Hiltgen Committed by GitHub
Browse files

fix index out of range on zero layer metal load (#7696)

If the model doesn't fit any layers on metal, and we load zero layers
we would panic trying to look up the GPU size during scheduling ops
parent a14f7649
...@@ -1092,9 +1092,11 @@ func (s *llmServer) EstimatedTotal() uint64 { ...@@ -1092,9 +1092,11 @@ func (s *llmServer) EstimatedTotal() uint64 {
func (s *llmServer) EstimatedVRAMByGPU(gpuID string) uint64 { func (s *llmServer) EstimatedVRAMByGPU(gpuID string) uint64 {
for i, gpu := range s.gpus { for i, gpu := range s.gpus {
if gpu.ID == gpuID { if gpu.ID == gpuID {
if i < len(s.estimate.GPUSizes) {
return s.estimate.GPUSizes[i] return s.estimate.GPUSizes[i]
} }
} }
}
return 0 return 0
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment