Skip to content

Commit

Permalink
Merge pull request #4323 from dhiltgen/sort_by_free
Browse files Browse the repository at this point in the history
Always use the sorted list of GPUs
  • Loading branch information
dhiltgen committed May 10, 2024
2 parents 6602e79 + 4142c3e commit 86f9b58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/sched.go
Expand Up @@ -567,9 +567,9 @@ func pickBestFitGPUs(req *LlmRequest, ggml *llm.GGML, gpus gpu.GpuInfoList) gpu.
// - try subsets of GPUs instead of just falling back to 1 or all in a family

// Now try all the GPUs
if ok, estimatedVRAM = llm.PredictServerFit(gl, ggml, req.model.AdapterPaths, req.model.ProjectorPaths, req.opts); ok {
slog.Debug("new model will fit in available VRAM, loading", "model", req.model.ModelPath, "library", gl[0].Library, "required", format.HumanBytes2(estimatedVRAM))
return gl
if ok, estimatedVRAM = llm.PredictServerFit(sgl, ggml, req.model.AdapterPaths, req.model.ProjectorPaths, req.opts); ok {
slog.Debug("new model will fit in available VRAM, loading", "model", req.model.ModelPath, "library", sgl[0].Library, "required", format.HumanBytes2(estimatedVRAM))
return sgl
}
}
return nil
Expand Down

0 comments on commit 86f9b58

Please sign in to comment.