fix n_m bound error

This commit is contained in:
Lizonghang 2025-02-27 21:59:04 +04:00
parent 550fdcbc4f
commit c8e615d69c

View file

@ -1376,7 +1376,7 @@ static bool assign_layers_to_device(
uint32_t w_m = best_solution[m], n_m = best_solution[m + n_world];
if (dev_gpu[m]) {
if (n_m < static_cast<uint32_t>(std::round(W * vec_z_gpu[m]))) {
if (n_m < static_cast<uint32_t>(std::floor(W * vec_z_gpu[m]))) {
// if there is still free GPU memory
has_free_gpu_memory = true;
} else if (w_m > n_m) {