Linux: read ahead of the head, embedding and vision encoder loads; time them

The native output head (437 MB) and the token embedding (260 MiB) were copied
out of the mapped GGUF one page fault at a time, and strata-vision's projector
(907 MB) went through llama.cpp's sequential reads, all before the server was
ready. Each now asks for its bytes ahead (the vision encoder honours
STRATA_READ_AHEAD=0 too), and the head, the embedding, the projector load, the
encoder warm-up and the pinned cache complement log their times.
This commit is contained in:
Jesus Gulfo authored and Niko1221 committed 2026-10-05 15:58:38 +02:00
1 parent cb33c0bac5
commit 760c775434
4 files changed
+37 -6

No files matched your search

+3 -1
View File
@@ -1380,6 +1380,7 @@ bool FileExpertSource::pin_cache_complement(
const std::vector<std::pair<int32_t, int32_t>>& additional_gpu_pairs, int64_t lend_from_slot,
uint64_t headroom_bytes, uint64_t budget_bytes, const std::vector<std::pair<int32_t, int32_t>>* rank) {
err.clear();
const auto pin_t0 = std::chrono::steady_clock::now();
if (base_ == nullptr) { err = "FileExpertSource: open the mapped experts before pinning a complement"; return false; }
if (complement_ready_) { err = "FileExpertSource: the cache complement is already pinned"; return false; }
if (!cache.valid()) { err = "FileExpertSource: the GPU expert cache is not open"; return false; }
@@ -1780,9 +1781,10 @@ bool FileExpertSource::pin_cache_complement(
complement_lock_off_ = lock_off;
complement_lent_slots_ = lend ? n_slots - keep_from : 0;
complement_ready_ = true;
std::fprintf(stderr, "FileExpertSource: %s cache complement ready: resident %.2f GiB, pinned %.2f GiB%s%s\n",
std::fprintf(stderr, "FileExpertSource: %s cache complement ready: resident %.2f GiB, pinned %.2f GiB in %.0f s%s%s\n",
complement_pinned_ ? "mapped pinned" : pin ? "locked resident" : "pageable resident",
(double) resident_bytes() / 1073741824.0, (double) pinned_bytes() / 1073741824.0,
std::chrono::duration<double>(std::chrono::steady_clock::now() - pin_t0).count(),
note.empty() ? "" : "; ", note.c_str());
if (lend)
std::fprintf(stderr, "FileExpertSource: %lld of the prompt path's %lld lendable slots keep their experts in RAM "