mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 19:36:33 +00:00
fix: recheck memory capacity when eviction candidates are unchanged (#2183)
This commit is contained in:
1 parent
b15c8aac39
commit
a77d362318
1 file changed
+5
-5
@@ -1916,12 +1916,12 @@ bool ModelManager::ensure_compute_backend_capacity(
|
|||||||
};
|
};
|
||||||
size_t last_eviction_count = 0;
|
size_t last_eviction_count = 0;
|
||||||
auto release_eviction_states = [&]() {
|
auto release_eviction_states = [&]() {
|
||||||
if (eviction_states.size() == last_eviction_count) {
|
if (eviction_states.size() != last_eviction_count) {
|
||||||
return false;
|
last_eviction_count = eviction_states.size();
|
||||||
|
release_compute_staging_blocks(false, &eviction_states);
|
||||||
|
release_params_storage_blocks(false, &eviction_states);
|
||||||
}
|
}
|
||||||
last_eviction_count = eviction_states.size();
|
// Device memory reports can lag behind releases even when no new candidates are added.
|
||||||
release_compute_staging_blocks(false, &eviction_states);
|
|
||||||
release_params_storage_blocks(false, &eviction_states);
|
|
||||||
return fits();
|
return fits();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user