mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3392] [CLOSED] [Engine] add opt-in advisory VRAM plan #4611
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#4611
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/3392
Author: @j-luwierski
Created: 10/20/2026
Status: ❌ Closed
Base:
main← Head:codex/advisory-vram-planner📝 Commits (1)
39f98ea[Engine] add opt-in advisory VRAM plan📊 Changes
8 files changed (+1655 additions, -33 deletions)
View changed files
📝
CMakeLists.txt(+12 -1)📝
docs/DETAILS.md(+16 -0)📝
include/strata/prefill/prefill.hpp(+20 -1)➕
include/strata/prefill/vram_plan.hpp(+251 -0)📝
src/prefill/prefill.cpp(+39 -17)➕
src/prefill/vram_plan.cpp(+469 -0)📝
src/program/generate.cpp(+249 -14)➕
tests/core/vram_plan_test.cpp(+599 -0)📄 Description
Problem and result
Before the expert cache takes the remaining VRAM, users have no diagnostic estimate of the prompt buffers or cache size the current sizing rules will choose. This adds a warnings-only advisory plan, enabled with
STRATA_ADVISORY_PLAN=1. The unset default retains the existing startup output and runtime path. The existing sizing, loan scan, and error paths remain authoritative; the planner does not allocate, resize, or refuse startup.Related discussion
Continuation of the closed #1133, closed during the 0.2.0-beta tracker reset rather than declined. It implements part C of #796, with scope previously agreed in that discussion: no startup refusal, runtime contract, or second allocator. Related foundational discussion: #765.
Approach
The planner estimates owned-prefill buffers and the auto-loan/cache plan from the same pricing and sizing inputs. It then re-derives the estimate after cache open and reports runtime differences as warnings. It is opt-in to preserve the default path.
Validation
Tested submitted tree
39f98ea1based on currentmain90767252, on Linux, CUDA 13.4.92, CUDA arch 89, NVIDIA RTX 4070 Ti SUPER (16 GiB), IQ3_XXS.Passed:
cmake -S . -B build-advisory -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=ON -DSTRATA_NATIVE_EXPERTS=ON -DSTRATA_BUILD_TESTS=ON -DCMAKE_CUDA_ARCHITECTURES=89— configured successfully.cmake --build build-advisory --target strata vram_plan_test -j 12— engine and planner test built successfully.ctest --test-dir build-advisory -R '^vram_plan_test$' --output-on-failure— 1/1 passed.git diff --check— passed.STRATA_ADVISORY_PLANunset and once withSTRATA_ADVISORY_PLAN=1: both exited 0, processed 12,287 prompt tokens in two chunks, chose an 8,192-token chunk and 2,489 loan slots, opened a 5,537-slot (8.98 GiB) cache, and generated token 198. The enabled run predicted those chunk, loan, and cache values exactly and emitted no mismatch warning. The unset run emitted no advisory diagnostics. One run per mode is not a performance comparison.Runtime command (with
DATApointing to the local model data directory and/tmp/strata-pr1133-prompt.txtcontaining198repeated 12,288 times):Failed: none observed.
Not run: HIP and SYCL builds (their compilers are unavailable in this environment); multi-GPU and Windows/WDDM runtime checks; full CTest suite.
Limits
Hardware execution covers one single-GPU CUDA configuration. The advisory is diagnostic and does not guarantee that a configuration will avoid allocation failure. No performance claim is made.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.