mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 15:58:53 +00:00
In the resident RAM mode (--resident-experts, --resident-budget-gib, which
setup writes for Unsloth's UD-Q4_K_XL below about 71 GB of RAM and for the
low-RAM mode, or the start's own fallback when RAM is short for the arena)
the expert cache refuses the server's VRAM command ("VRAM: not with the
resident low-RAM mode"). With the on-demand reader and only setup's 700 MiB
reserve, the reader then found about 425 MiB free and every picture went to
the processor reader: 7.67 / 6.15 / 1.49 / 1.43 s against 2.06 / 0.93 /
0.41 / 0.37 s with the room held back (l620, IQ3_S, card held to 32 GB,
--resident-budget-gib 40).
The engine knows that mode before it sizes the cache, so there it keeps the
reader's 2,048 MiB in the reserve (strata/core/reader_room.hpp, applied
once after the arena / file pass loop, before the cache is sized; the mode
is not entered later). Only an engine with --vision, --vram-elastic,
--serve and the resident RAM mode changes; a larger reserve is never
lowered. One engine log line says it; no setting, nothing for the user.
Gate on l620 (same setup, 3 starts each, alternating):
- new default with the rule: the reader on the card in 3 of 3 starts
(1,509 MiB), 12,068 slots, pictures 2.06-2.45 / 0.91-1.08 / 0.39-0.59 /
0.37-0.55 s, text 1,714-1,722 / 3,867-3,882 tok/s at 2K / 8K;
- old default: the reader on the card in 3 of 3, 12,068 slots, pictures
2.07-2.37 / 0.91-1.09 / 0.39-0.59 / 0.37-0.55 s, text 1,719-1,740 /
3,873-3,889 tok/s.
Without the resident mode nothing changes: the same 12,719 slots, the same
answers to the same prompts and pictures, the shrink path as before, the
rule's line absent (one start each, engine before and after).
Test: reader_room_test (ctest; the rule's eight input combinations and the
larger-reserve case).
34 lines
1.5 KiB
C++
34 lines
1.5 KiB
C++
// The picture reader's room in the resident RAM mode (strata/core/reader_room.hpp): only an engine that serves pictures, was asked for
|
|
// the shrinking cache and runs the resident RAM mode keeps the reader's 2,048 MiB in its reserve; every other start keeps its reserve.
|
|
#include "strata/core/reader_room.hpp"
|
|
|
|
#include <cstdio>
|
|
|
|
using namespace strata::core;
|
|
|
|
namespace {
|
|
int failed = 0;
|
|
#define CHECK(x) do { if (!(x)) { std::fprintf(stderr, "FAIL %s:%d: %s\n", __FILE__, __LINE__, #x); ++failed; } } while (0)
|
|
} // namespace
|
|
|
|
int main() {
|
|
CHECK(kReaderRoomMib == 2048);
|
|
// the case: setup's 700 MiB, pictures on, the shrinking cache asked for, the resident RAM mode -> the reader's room is kept
|
|
CHECK(reader_room_reserve_mib(700, true, true, true) == 2048);
|
|
CHECK(reader_room_reserve_mib(0, true, true, true) == 2048);
|
|
// a larger reserve (the person's, the app's, Windows' own) is never lowered
|
|
CHECK(reader_room_reserve_mib(2048, true, true, true) == 2048);
|
|
CHECK(reader_room_reserve_mib(3000, true, true, true) == 3000);
|
|
// any one of the three missing: the reserve as asked (the arena mode shrinks; no pictures; no on-demand reader)
|
|
for (int v = 0; v < 2; ++v)
|
|
for (int e = 0; e < 2; ++e)
|
|
for (int r = 0; r < 2; ++r)
|
|
if (!(v && e && r)) CHECK(reader_room_reserve_mib(700, v, e, r) == 700);
|
|
if (failed) {
|
|
std::fprintf(stderr, "reader_room_test: %d failed\n", failed);
|
|
return 1;
|
|
}
|
|
std::printf("reader_room_test: ok\n");
|
|
return 0;
|
|
}
|