Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

kv-grow: kvg_trim uploads the residency table with res_put, which waits for the copy

sergiywithd0336684e50c
diff --git a/src/program/generate.cpp b/src/program/generate.cpp
index e76e582b8..bb12ff6fa 100644
--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -6299,8 +6299,8 @@ int main(int argc, char** argv) {
}
for (const auto& [i, s] : filled) host_res[i] = s;
kvg.refilled += (int64_t) filled.size();
- if (cudaMemcpy(d_res, host_res.data(), host_res.size() * sizeof(int32_t), cudaMemcpyHostToDevice) != cudaSuccess)
- return false;
+ // res_put waits for its copy: the next reader can be a verify window (a non-blocking stream) right away
+ if (res_put(d_res) != cudaSuccess) return false;
for (const strata::core::VmmChunk h : kvg.spare) strata::core::vmm_chunk_free(h); // new ones, if any
kvg.spare.clear();
++kvg.trims;