From 86070e7845760f3d1a6d4957f2dffe34847eaae2 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Sat, 10 Oct 2026 18:30:35 +0200 Subject: [PATCH] STRATA_TRACE: VRAM marks after the context, the pack weights, the session and the head (the 0.1.43 VRAM audit) --- src/program/generate.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/program/generate.cpp b/src/program/generate.cpp index ff3f2e1a..cb61a639 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -2925,6 +2925,7 @@ int main(int argc, char** argv) { (unsigned long long) (total_b >> 20)); return 1; } + mem_mark("the CUDA context and the weight arena"); auto load_t0 = std::chrono::steady_clock::now(); auto load_s = [&] { const auto t = std::chrono::steady_clock::now(); @@ -2940,6 +2941,7 @@ int main(int argc, char** argv) { std::fprintf(stderr, "strata generate: %llu MiB of weights loaded from %s in %.1f s (%zu canonical tensors " "skipped: served natively)\n", (unsigned long long) (pool_bytes >> 20), o.pack.c_str(), load_s(), skip.size()); + mem_mark("the pack weights"); strata::core::NativeDense native_dense; if (!o.native_dense_gguf.empty()) { @@ -4162,6 +4164,7 @@ int main(int argc, char** argv) { (unsigned long long) ple_table.rows(), o.ple_gguf.c_str()); } } + mem_mark("the session (KV, GDN state, PLE history)"); for (size_t i = 0; i < stages.size(); ++i) { GpuStage& st = *stages[i]; const strata::core::OnDevice on(st.dev); @@ -4392,6 +4395,7 @@ int main(int argc, char** argv) { std::chrono::duration(std::chrono::steady_clock::now() - head_t0).count()); } std::vector logits((size_t) n_vocab); + mem_mark("the native head"); float* d_logits = nullptr; if (cudaMalloc(&d_logits, (size_t) n_vocab * 4) != cudaSuccess) { (void) cudaGetLastError();