prompt buffers (#1454): keep counting the bytes bo shares with emb unless STRATA_EMB_REUSE_ACCOUNT=1
The VRAM reuse stays, but bytes_needed_impl counts bo again by default, so the auto chunk and the borrowed cache slots are those of 0.1.40.3 and the prompt residuals stay byte-identical (on the RTX 3060 the planner otherwise picked a 6656-token chunk instead of 6400). STRATA_EMB_REUSE_ACCOUNT=1 lets the planner use the saved bytes (+3.9% prompt there); documented in docs/DETAILS.md.
This commit is contained in:
1 parent
41a5a5488d
commit
55dee8ed84
2 files changed
+13
No files matched your search
@@ -1584,3 +1584,7 @@ with **262,144 characters per input/output/reasoning/response field** and visibl
|
||||
responses are unaffected. Headers are not recorded, and the monitor key is kept in this tab's session storage.
|
||||
Treat request history as sensitive input/output when exposing Strata on a network: set an API key as above.
|
||||
The page uses relative URLs and works through the existing host binding or a reverse proxy.
|
||||
|
||||
### Prompt buffers: `bo` shares `emb` (#1454)
|
||||
|
||||
The prompt path's half-output buffer `bo` reuses the embedding buffer `emb`, which is dead after the first hyper-connection broadcast: T x 2560 floats less VRAM per chunk (320 MiB at 32768 rows). The planner still counts those bytes by default, so the auto chunk and the cache slots the prompt path borrows are exactly those of 0.1.40.3 and the output bits are unchanged. `STRATA_EMB_REUSE_ACCOUNT=1` lets the planner use the saved bytes: where VRAM limits the chunk it grows (RTX 3060, IQ3_XXS: 6400 to 6656 tokens, 1652 to 1670 borrowed slots, prompt about +3.9%). A different chunk changes the prompt path's rounding, so prompt residuals are not byte-identical to the default; greedy output matched in our runs. Opt-in until it has a KL measurement.
|
||||
@@ -218,6 +218,14 @@ inline uint64_t ring_bytes() {
|
||||
// prompt path's loan on a native pack (fewer ring slots, the rest kept as cache slots, a larger auto chunk), so a long
|
||||
// prompt's experts are read through a different mix of resident and streamed groups and its bits differ from 0.1.39's
|
||||
// (RTX 5070, IQ3_XXS, 32K prompt: +14% to +26%; teacher-forced against the FP16 prompt path in the same band).
|
||||
// #1454: `bo` shares `emb`'s storage (carve), which frees T * N floats per chunk. The planner keeps counting them by
|
||||
// default, so the auto chunk and the borrowed cache slots (and with them the prompt path's bits) are exactly 0.1.40.3's;
|
||||
// STRATA_EMB_REUSE_ACCOUNT=1 lets it use the saved bytes: a larger chunk or more borrowed slots where VRAM is the limit
|
||||
// (RTX 3060, IQ3_XXS: chunk 6400 -> 6656, prompt +3.9%), with other rounding in the prompt path.
|
||||
inline bool emb_reuse_account() {
|
||||
static const bool on = [] { const char* v = std::getenv("STRATA_EMB_REUSE_ACCOUNT"); return v != nullptr && v[0] == '1'; }();
|
||||
return on;
|
||||
}
|
||||
inline bool ring_bytes_on() {
|
||||
static const bool on = [] { const char* v = std::getenv("STRATA_RING_BYTES"); return v == nullptr || v[0] != '0'; }();
|
||||
return on;
|
||||
@@ -1586,6 +1594,7 @@ uint64_t Prefill::bytes_needed_impl(const core::ModelGeometry& g, const core::Se
|
||||
}
|
||||
o.take<uint16_t>(T * (D + (hc_pad() ? XN_PAD : 0)), ok); f(T * LR); o.take<uint16_t>(T * LR, ok);
|
||||
f(T * D); f(T * HC); f(T * N); o.take<uint16_t>(T * N, ok); o.take<uint16_t>(T * N, ok);
|
||||
if (!emb_reuse_account()) f(T * N); // bo: aliases emb in carve; still counted unless STRATA_EMB_REUSE_ACCOUNT=1
|
||||
const bool f16_io = prompt_f16(); // the current device's mode (the stage's), as Prefill::init will decide it
|
||||
if (bf16x2_hc(f16_io)) { o.take<uint16_t>(T * D, ok); o.take<uint16_t>(T * LR, ok); }
|
||||
if (bf16x2(f16_io)) o.take<uint16_t>(T * N, ok);
|
||||
|
||||
Reference in new issue
Block a user