Repository navigation
Conversation
This was referenced Oct 18, 2026
Owner
|
Thanks for the pull request. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to review properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes:
The rules are in CONTRIBUTING.md. |
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This the rebased version of #1581 for the VRAM loaning part of the PR.
Summary
This PR adds a manually enabled, request-scoped VRAM loan for prompt prefill.
It temporarily lends decode-only allocations to the prompt path, then restores
the verifier, native output head, MTP experts and draft head before generation.
The repeat-prefill option applies the same transaction to later long messages.
The default path is unchanged when the flags are absent.
What changed
Enable the feature with:
{ "STRATA_PREFILL_ELASTIC_LOAN": "1", "STRATA_PREFILL_MTP_LOAN": "1", "STRATA_PREFILL_HEAD_LOAN": "1", "STRATA_PREFILL_RETAIN_STARTUP_CHUNK": "1", "STRATA_PREFILL_REPEAT_LOAN": "1", "STRATA_PREFILL_REPEAT_MIN_TOKENS": "50000" }All six
STRATA_PREFILL_*variables above are introduced by this PR, but theyare not six independent requirements:
STRATA_PREFILL_ELASTIC_LOANis themaster switch; MTP/head loans are staged sub-options; and the retain/repeat
flags apply only when later prompts should repeat the transaction. A minimal
startup experiment needs only the master switch. The existing upstream
--vram-elasticcommand-line option is required as the segmented-cachebackend; it is not part of this PR.
STRATA_PREFILL_ELASTIC_LOANSTRATA_PREFILL_MTP_LOANSTRATA_PREFILL_HEAD_LOANSTRATA_PREFILL_RETAIN_STARTUP_CHUNKSTRATA_PREFILL_REPEAT_LOANSTRATA_PREFILL_REPEAT_MIN_TOKENS--vram-elastic,--serve,--mtp,--specSTRATA_PREFILL_REPEAT_MIN_TOKENSapplies only to subsequent prompts. It isclamped to a minimum of 256 tokens and defaults to 1,024. Startup loans are
controlled by the startup flags because the first request length is not known
when the engine initializes.
The implementation is in the serve/prefill lifecycle (
src/program/generate.cpp)and the verifier, native-head and MTP resource transactions
(
src/core/verify.cpp,src/core/native_head.cppandsrc/core/mtp.cpp).As mentioned in the original PR: benefit depends on prompt length and whether the released VRAM
crosses a useful planner threshold.
Extra Notes
Test system and method
7.5.
12.2 GB/s.
477ac13c) plus this PR.enabled with
--spec 4, and the experimental speed projection held constant.cap. Runs were serialized with a fresh engine; PP/TG are the engine-reported
timing-line rates.
Guarding and supported configurations
The feature is restricted at startup to the serialized, one-GPU NVIDIA CUDA
server path. It requires
--serve,--vram-elastic, CUDA virtual-memorysegments of at least 64 MiB, and rejects batch slots, pipeline windows, layer
split, helper/remote/peer caches, HIP and
--prefill-head-alias. MTP/headloans require
--mtpwith--spec >= 2; the head loan additionally requiresa native output head.
Invalid combinations fail before any decode resource is deferred.
CPU worker count does not change the ownership model. Multiple conversations
can use one server sequentially, but concurrent batch sessions are rejected.
Separate Strata processes sharing one GPU are not coordinated and must not run
concurrently with loans enabled.
Measurements
The fixed-planner A/B isolates the transaction when geometry is held constant:
This is effectively neutral (+0.1% PP, within run noise). The feature is not a
same-kernel speedup; its purpose is to make a larger prompt geometry fit.
With automatic planning (
--prefill auto), the loan-only run selected a larger geometry:The combined configuration is 11.5% faster in PP than loans alone in this
screen. The planner also changes the chunk/ring geometry, so this is reported
as an end-to-end combined benefit rather than a loan-only percentage.
A repeat-prefill test released and reloaded the verifier, native head, MTP
experts and draft head without a CUDA/runtime error. The loan-only follow-up
completed at 742.9 PP / 30.4 TG.
This PR is intentionally incompatible with
--prefill-head-alias; startupfails before a loan is taken. Use head-alias mode by itself, or remove it when
using the loan transaction.
Cross-GPU VRAM-loan qualification
The loan is not SM75-specific. A separate test used an RTX 4070 Ti
(12 GiB, SM89), INT8 KV, a 196,608-token context, a 512-slot staging ring - but an older v0.1.41 source revision. Loan-off and loan-on runs were interleaved,
serialized, and started from a fresh engine. The 36k result is a three-run
median and the 72k result is a five-run median; both used a 512-token
completion cap.
The larger loan-backed chunk reduced median GPU prompt work by 6.0% at 36k
tokens and 5.5% at 72k. Loading the deferred output-head and MTP resources is
a fixed boundary cost, so the 36k request was 0.9% slower by the engine's
end-to-end PP rate while the 72k request was 2.4% faster. The five-run 72k PP
ranges were 2,604.3--2,633.7 off and 2,501.1--2,696.3 on; four of five loan-on
runs were 2,673.5 PP or higher, with one retained slow outlier. This is evidence
that the general CUDA loan works beyond Turing, but also that it should remain a
manual opt-in: benefit depends on prompt length and whether the released VRAM
crosses a useful planner threshold.