session files: RESTORE makes room in the elastic K/V (--kv-grow) before the device copy (review finding)

This commit is contained in:
Niko1221 committed 2026-10-05 19:57:36 +02:00
1 parent 2467bb6899
commit f07f060ae7
1 file changed
+5
+5
View File
@@ -7756,6 +7756,11 @@ int main(int argc, char** argv) {
refuse(err);
continue;
}
// the elastic K/V (--kv-grow) maps only the cells it has grown to: make room for the file's cells
if (!kvg_ensure((int64_t) image.live.ids.size() + 256, [&] { cudaDeviceSynchronize(); apply_pending(true); })) {
refuse("the K/V cannot grow to the saved conversation: no VRAM is left", strata::core::SessionError::memory);
continue;
}
conversations.take_reuse(); // retained K/V described the outgoing session
live_ok = false;
// host -> device in synchronous copies of the whole state: one bounded allowance