mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
What the box showed (p2006, Radeon 780M gfx1103, 11-15): with the arena unregistered, every short prompt took 1.1-1.4 s more (512 tokens 3,517 against 2,620 ms; 84-256 tokens about 2,850-3,050 against 1,500-1,920 ms). That time is the copy-back of the 1,967 cache slots (2.53 GiB) the prompt path borrows, from pageable memory, after every prompt. Without a loan there is no copy-back. This extends the Strix Halo rule of 0.2.8 (Windows gfx1151: no loan) to this class, with two differences. The decision is made after the expert cache is sized as with a loan, so the cache gets the same slots it gets today (--expert-cache N, or the auto size). And the chunk stays the one the loan would have used: no drop to the 2,048 that --no-prefill-borrow alone gives an auto chunk. The prompt path's own buffers must fit in what the driver reports free beside the cache and the reserve, with 3 GiB to spare (the arithmetic of AUTO NO-BORROW); otherwise the loan stays. The chunk check at the prompt path's start then runs as for any path with its own buffers. One GPU only, chunks up to 16,384. Scope: HIP builds under Linux, the kfd_quiet class (every visible card an integrated gfx1103 / gfx1150 / gfx1151), one block after the cache sizing in generate.cpp under STRATA_USE_HIP && __linux__; it reads class_flag(), so nothing changes elsewhere. Default OFF: kNoLendDefaultOn in kfd_quiet.hpp is the one constant to flip once the box test decides. STRATA_KFD_QUIET_LEND=1 turns it on for a test on the same binary; STRATA_KFD_QUIET_LEND=0, STRATA_KFD_QUIET=0 or STRATA_PREFILL_BORROW=1 keep the loan. No new user setting and no new user-visible line (one STRATA_TRACE line). Unit tests: the switch rule and the pick, with the chunk kept.