From 41f3708999a762964df01c4ce531f6397dd7104f Mon Sep 17 00:00:00 2001 From: Lizonghang <870644199@qq.com> Date: Tue, 25 Feb 2025 21:31:55 +0400 Subject: [PATCH] fix condition for gpu overload --- common/common.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index 878f8656..4af4f98a 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -1371,13 +1371,11 @@ static bool assign_layers_to_device( if (!dev_gpu[m]) continue; uint32_t w_m = best_solution[m], n_m = best_solution[m + n_world]; - // if there is still free GPU memory if (n_m < static_cast(std::round(W * vec_z_gpu[m]))) { + // if there is still free GPU memory has_free_gpu_memory = true; - } - - // if there is GPU device overloaded - if (w_m > n_m) { + } else if (w_m > n_m) { + // if the GPU is overloaded has_gpu_overload = true; } }