Elastic K/V: VMM access failures roll back, failed growth stops the engine, the trim maps one run

From an audit of this PR, each finding checked against the code:
- VmmRange: a run whose cuMemSetAccess failed stayed counted as mapped (a later map_range skipped it, so the chunks
  were never made accessible); it is unmapped and freed again (commit_run).
- a failed growth or trim could leave host_res, d_res and the slot range half-changed while serve went on to the
  next request; such a failure now stops the engine, as other CUDA failures do. The residency uploads are checked.
- the trim maps the chunks it takes back as one run (one cuMemSetAccess instead of one per 2 MiB chunk) and refills
  the slots with async copies and one sync instead of a blocking cudaMemcpy per expert.

IQ2_XS: the served scenario (grow at a request and mid-decode, trim and refill, regrow, a parked conversation's
restore) runs as before; vmm_test passes.
This commit is contained in:
sergiywith authored and Niko1221 committed 2026-10-05 19:57:35 +02:00
1 parent 9e3dbfe74a
commit 025bf3b2ef
3 files changed
+54 -21

No files matched your search

+7
View File
@@ -128,6 +128,12 @@ bool VmmRange::set_access(int64_t lo, int64_t hi) {
CUDA_SUCCESS;
}
bool VmmRange::commit_run(int64_t lo, int64_t hi) {
if (set_access(lo, hi)) return true;
for (int64_t c = lo; c < hi; ++c) vmm_chunk_free(unmap(c));
return false;
}
VmmChunk VmmRange::unmap(int64_t i) {
if (!mapped(i)) return 0;
const Api& a = api();
@@ -151,6 +157,7 @@ void VmmRange::release() {}
int64_t VmmRange::mapped_count() const { return 0; }
bool VmmRange::map_one(int64_t, VmmChunk) { return false; }
bool VmmRange::set_access(int64_t, int64_t) { return false; }
bool VmmRange::commit_run(int64_t, int64_t) { return false; }
VmmChunk VmmRange::unmap(int64_t) { return 0; }
} // namespace strata::core