mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #805] [CLOSED] Lazy vision encoder: per-GPU elastic expert caches #2841
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2841
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/805
Author: @jmnargi
Created: 10/4/2026
Status: ❌ Closed
Base:
main← Head:feat/lazy-vision📝 Commits (10+)
3292ceaAdd Tesla V100 support and deployment benchmarks3c6e0d4Fix Volta prefill GEMM corruptioncb708c7Prefill fast path for Volta: FP16 tensor-core GEMMs, io_uring PLE reads, NVMe storage648713fEnable Q2_0 MMQ prefill pathecccc8cLimit prefill QSA scoring to live blocksc665c39Merge pull request #1 from jmnargi/prefill-speed-v100cb96f13Re-benchmark the V100 fast path on merged main; add the benchmark tool4686c0fMerge upstream multi-GPU support with V100 compatibility695a1c2Remove local identifiers and add benchmark indexc05eb32decode: batch the verify window's per-token kernels (bit-identical)📊 Changes
274 files changed (+147813 additions, -2103 deletions)
View changed files
📝
.gitignore(+1 -0)➖
AGENTS.md(+0 -23)📝
CMakeLists.txt(+62 -20)📝
README.md(+124 -162)➕
bench/results/2026-09-28-v100-fastpath/README.md(+46 -0)➕
bench/results/2026-09-28-v100-fastpath/matrix.json(+80 -0)➕
bench/results/2026-09-29-baseline-long/matrix.json(+30 -0)➕
bench/results/2026-09-29-baseline-short/matrix.json(+58 -0)➕
bench/results/2026-09-29-cool-short/matrix.json(+58 -0)➕
bench/results/2026-09-29-final-long/matrix.json(+30 -0)➕
bench/results/2026-09-29-final-s8-128k/matrix.json(+16 -0)➕
bench/results/2026-09-29-new-long/matrix.json(+30 -0)➕
bench/results/2026-09-29-new-short/matrix.json(+58 -0)➕
bench/results/2026-09-29-pr139-triage/baseline-pass1.json(+30 -0)➕
bench/results/2026-09-29-pr139-triage/baseline-pass2.json(+30 -0)➕
bench/results/2026-09-29-pr139-triage/ctrl-final-pass1.json(+30 -0)➕
bench/results/2026-09-29-pr139-triage/ctrl-final-pass2.json(+30 -0)➕
bench/results/2026-09-29-pr139-triage/ctrl-new-pass1.json(+30 -0)➕
bench/results/2026-09-29-pr139-triage/ctrl-new-pass2.json(+30 -0)➕
bench/results/2026-09-29-pr139-triage/notes.md(+68 -0)...and 80 more files
📄 Description
What
The image encoder (strata-vision, ~1.74 GiB across the GPUs) no longer has to sit in VRAM 24/7. With
"lazy": truein the config's"vision"section (plus"vram_elastic": true), it starts on the first image request and unloads after"idle_s"seconds without one — its VRAM stays with the expert caches the rest of the time.Verified on the 2xV100 service
Image request answered cold in 5.9 s (zero-warm "Red square shape"): per-GPU hand-back → spawn → encode → reply.
/metricsexpert_slots/expert_cache_mibaggregate across GPUs at every stage.Engine changes (src/program/generate.cpp, src/core/expert_cache.*)
--vram-elasticnow segments every layer-split stage cache (it was disabled with a split: "a layer split has a cache per GPU"). Also themed: per-GPU reserves, so the caches can return VRAM to the image encoder (or any other program) and take it back.VRAMcommand takes one reserve per GPU:VRAM <r0> [<r1> ...](CUDA0's, then each stage's; missing values keep the startup reserve). Reply fields are comma lists, one value per cache.host_resis one global table whose slot values index whichever cache owns the layer, so an eviction loop over all rows would hit stage-owned slots with the wrong cache'slivecount.ExpertCache::keep_bytes_for_free: shrink keeps whole segments, so a release request smaller than the tail segment used to round up past the arena and free nothing (GPU1's 412 MiB tail); now the command releases the right segment.VRAMreverts the caches to their full start-up size (the reserve is only the sizing target), so the vision idle-unload path regrows completely — including a short tail segment the conservative grow would otherwise leave unmapped forever.relend()reshapes the prompt-path loan of every part against its own cache (was: the drive's part only).Server changes (serve/server.py)
"vision": {"lazy": true}skips the boot spawn;prepare()starts the encoder inside the request FIFO after the per-GPUVRAMhand-back (the engine is idle; text requests never touch the vision path)."idle_s"s without image requests and issues a bareVRAM, regrowing both caches to full. Defaults:"vram_mib"[1700, 600]for a layer split,[1800]for one GPU (measured with the shipped BF16 mmproj).POST /v1/vramand the servedvram()accept a per-GPU list./metricsaggregation fix: after a VRAM reply the engine info now sumsexpert_slots/expert_cache_mibacross GPUs (the engine's own INFO line reports the total; a per-GPU reply had reduced it to CUDA0's value).Docs
docs/DETAILS.md: #533 (per-GPU reserves, bare = full start-up size), new "Lazy vision" section;--vram-elastichelp.Notes/limits: the lazy vision hand-back requires one-request-at-a-time (no
"parallel") — documented;VRAMstill refuses with--peer-device, the helper caches or the resident low-RAM mode.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.