Prechádzať zdrojové kódy

Override numParallel only if unset.

Richard Lyons 8 mesiacov pred
rodič
commit
0ad0e738cd
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  1. 3 1
      server/sched.go

+ 3 - 1
server/sched.go

@@ -734,7 +734,9 @@ func pickBestFullFitByLibrary(req *LlmRequest, ggml *llm.GGML, gpus gpu.GpuInfoL
 
 
 // If multiple Libraries are detected, pick the Library which loads the most layers for the model
 // If multiple Libraries are detected, pick the Library which loads the most layers for the model
 func pickBestPartialFitByLibrary(req *LlmRequest, ggml *llm.GGML, gpus gpu.GpuInfoList, numParallel *int) gpu.GpuInfoList {
 func pickBestPartialFitByLibrary(req *LlmRequest, ggml *llm.GGML, gpus gpu.GpuInfoList, numParallel *int) gpu.GpuInfoList {
-	*numParallel = 1
+	if *numParallel <= 0 {
+		*numParallel = 1
+        }
 	byLibrary := gpus.ByLibrary()
 	byLibrary := gpus.ByLibrary()
 	if len(byLibrary) <= 1 {
 	if len(byLibrary) <= 1 {
 		return gpus
 		return gpus