mirror of
https://github.com/Lizonghang/prima.cpp.git
synced 2025-09-07 22:29:03 +00:00
fix condition for gpu overload
This commit is contained in:
parent
224d14eb4c
commit
41f3708999
1 changed files with 3 additions and 5 deletions
|
@ -1371,13 +1371,11 @@ static bool assign_layers_to_device(
|
||||||
if (!dev_gpu[m]) continue;
|
if (!dev_gpu[m]) continue;
|
||||||
uint32_t w_m = best_solution[m], n_m = best_solution[m + n_world];
|
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<uint32_t>(std::round(W * vec_z_gpu[m]))) {
|
if (n_m < static_cast<uint32_t>(std::round(W * vec_z_gpu[m]))) {
|
||||||
|
// if there is still free GPU memory
|
||||||
has_free_gpu_memory = true;
|
has_free_gpu_memory = true;
|
||||||
}
|
} else if (w_m > n_m) {
|
||||||
|
// if the GPU is overloaded
|
||||||
// if there is GPU device overloaded
|
|
||||||
if (w_m > n_m) {
|
|
||||||
has_gpu_overload = true;
|
has_gpu_overload = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue