mirror of
https://github.com/Lizonghang/prima.cpp.git
synced 2025-09-06 20:19:02 +00:00
add gpu check in set calibration
This commit is contained in:
parent
f5e874f75f
commit
e3a0d0007a
1 changed files with 6 additions and 5 deletions
|
@ -1362,8 +1362,9 @@ static bool assign_layers_to_device(
|
|||
}
|
||||
|
||||
// check the solution
|
||||
bool has_free_gpu_memory = false, has_overload = false;
|
||||
bool has_free_gpu_memory = false, has_gpu_overload = false;
|
||||
for (uint32_t m = 0; m < n_world; ++m) {
|
||||
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
|
||||
|
@ -1371,13 +1372,13 @@ static bool assign_layers_to_device(
|
|||
has_free_gpu_memory = true;
|
||||
}
|
||||
|
||||
// if there is device overloaded
|
||||
// if there is GPU device overloaded
|
||||
if (w_m > n_m) {
|
||||
has_overload = true;
|
||||
has_gpu_overload = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (has_free_gpu_memory && has_overload) {
|
||||
if (has_free_gpu_memory && has_gpu_overload) {
|
||||
int worst_device = -1;
|
||||
float worst_speed = std::numeric_limits<float>::max();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue