Repository navigation
Conversation
cobanov
left a comment
There was a problem hiding this comment.
Thanks, the measurements are great: 22 s down to 2.3 s on a switched chat is a real win.
Because it changes what the server does for everyone with a tight model, I'd like it opt-in at first: please change the new disk_cache = "auto" default in ps5/app/settings.hpp to "off". If you'd rather keep Auto as the default, I'd need the long-chat test on a tight model in Auto (your 18B at about 0.14 GiB free), with the lowest pool free during saves.
It also needs a re-roll on b12600 once #103 lands. Clearing /data/PS5LM/cache/prompts when the setting is Off would be nice too.
e602a90 to
9df6910
Compare
|
@cobanov Updated
|
9df6910 to
7d1375a
Compare
|
@cobanov Follow-up from testing all 6 installed models (
|
7d1375a to
fe0a631
Compare
|
@cobanov Pushed the
|
…ftpsrv writer and settings UI # Conflicts: # scripts/build-app.sh
fe0a631 to
36fc8af
Compare
SSD prompt cache spillover (
--cache-disk) and Settings/Dashboard UI split out of #89.Patch Numbering
patches/0020-server-cache-disk-spillover.patch(verified100644file modes; zero100755git applywarnings).cobanov/PS5LM:main(fa0fc59) and ready for llama.cpp moves to d2bceda3d (after b12602) for Inkling 2 Mini, with every patch carried over #103: a ported0020targeting#103(llama.cpp@d2bceda3d, updated forserver-slot-sched.{h,cpp},shared_ptr<const common_prompt_checkpoint>,lora_new, and the27Bcheckpoint clear fix) is already compile-verified locally viascripts/apply-patches.sh+ hostllama-serverbuild.Changes
patches/0020-server-cache-disk-spillover.patch):--cache-disk DIR(LLAMA_ARG_CACHE_DISK) and--cache-disk-mib N(LLAMA_ARG_CACHE_DISK_MIB) tollama-server(common/arg.cpp,common/common.h), and adds streaming state callbacksllama_state_seq_save_stream/llama_state_seq_load_stream(include/llama.h,src/llama-context.*).PCK1blobs when--cache-ramis bounded, or streaming.seq+.chkcheckpoint files when-cram 0) via 8 MiB buffered writes and 4 MiB buffered reads (tools/server/server-task.cpp,tools/server/server-task.h,tools/server/server-context.cpp).prompt.checkpointson disk load before reading the incoming.chkfile (preventing a2xcheckpoint RAM peak on large recurrent models like27Bwhere one.chkis149.6 MiB), reportsout_oomdistinctly from integrity failures, and reports actual loaded checkpoint bytes..part+ rename, sweeps staleps5lm_ckpt_*files on startup, evicts the oldest disk entry when exceeding--cache-disk-mib, and falls back cleanly to prefill on corrupted/unwritable paths.ftpsrvWriter (ps5/app/prompt_cache_writer.cpp,scripts/build-app.sh):ps5lm_prompt_cache_writewith its ownFtpWriter+ mutex so prompt spillover avoids PS5's ~2.2 GB title POSIX write slowdown cliff (#41) without contending with model downloads or fleet parking, falling back to POSIX writes whenftpsrvis unavailable.OffDefault (ps5/app/settings.*,ps5/app/dashboard.cpp,ps5/app/main.cpp,ps5/app/model_plan.*):Off(default, opt-in) /Auto (when near full)/Always on, withOfflisted first in the picker) and Disk cache limit (2 GB–32 GB, default4096 MiB) under Settings -> Model, persisted insettings.json.ps5lm_ckpt_*files in/data/PS5LM/cache/promptsboth on startup (main.cppafterload_settings) and on idle settings save (models.running.empty()) whendisk_cache == "off".--cache-diskand--cache-disk-mibfromplan_modelwhendisk_cacheisonorautowith< 0.75 GiBheadroom.Verification
Opt-in
OffDefault &/data/PS5LM/cache/promptsCleanup (Live PS5)disk_cacheomitted -> defaults to"off"): Plantedps5lm_ckpt_99.seqandps5lm_ckpt_99.chk; startup loggedprompt-cache: cleared 2 cached files (disk cache off)and emptied/data/PS5LM/cache/prompts([]).Auto -> Off): Plantedps5lm_ckpt_88.seqwhileAutowas active, switched back toOffin the idle UI;app.logloggedprompt-cache: cleared 1 cached file (disk cache off)and emptied/data/PS5LM/cache/prompts([]).Multi-Model Live PS5 Switched-Chat SSD Restore Benchmark (
192.168.10.6,-ctxcp 1 -cram 0,8192 MiB)pool freeChat N -> Chat 1)MiB, Speed, Hash)Qwen3.5-9B Q6_KOn(64k q8_0)2.01 GiB247.6 ms(1,618.7tok)1,810.1 ms(1,702cached)78.9 + 50.3 MiB chkin0.28 s(487 MB/s, ok)Qwen3.6-12B IQ-Q5_K_MOn(64k q8_0)2.46 GiB202.8 ms(1,680.6tok)1,974.7 ms(1,727cached)77.7 + 56.1 MiB chkin0.29 s(486 MB/s, ok)qwen3.5-14b-a3b Q4_K_MOn(64k q8_0)2.05 GiB169.7 ms(1,676.3tok)1,959.7 ms(1,849cached)82.0 + 62.8 MiB chkin0.31 s(493 MB/s, ok)qwen3.5-18b-a3b Q4_K_MAuto(16k q8_0)0.10 GiB297.9 ms(2,216.1tok)2,163.1 ms(2,360cached)87.8 + 62.8 MiB chkin0.31 s(516 MB/s, ok)Qwen3.8-27B IQ2_MAuto(32k q8_0)0.12 GiB502.6 ms(1,676.1tok)4,901.8 ms(1,813cached) ->498.1 mspost-restore209.9 + 149.6 MiB chkin0.73 s(520 MB/s, ok)Qwen3.8-27B IQ2_MOn(64k q4_0)0.12 GiB513.7 ms(1,681.2tok)4,640.0 ms(1,710cached) ->487.5 mspost-restore179.7 + 149.6 MiB chkin0.62 s(556 MB/s, ok)Qwen3.5-2B-...-THINKING.Q8_0(On,64k q8_0,8.51 GiBfree): Saved/restored30.0 MiB (+ 19.3 MiB chk)cleanly (0.11 s@452 MB/s, hash ok); follow-up turns reportcached_tokens = 0identically inOff,Auto, andOnbecause its customTHINKINGJinja template alters earlier turns past-ctxcp 1.27Bdouble-allocation fix verified: Before clearingprompt.checkpointsprior to reading.chk, loading a149.6 MiB.chkwhile holding the previous chat's149.6 MiBcheckpoint hitstd::bad_alloc(read_checkpo) on27B; afterprompt.checkpoints.clear(), both32k q8_0and64k q4_0restored(+ 149.6 MiB chk)with zero warnings and487.5–498.1 mspost-restore follow-up TTFT.Console Long-Chat Benchmark (
14B MoE,-c 65536 -ctk q8_0, alternating ~7k-token chatsA1 -> B1 -> A2)A2TTFTcached_tokenspool free(app.log)flexiblefree--cache-disk(Off)22,013.7 ms(22.01 s)01.85 GiB303 / 448 MiB--cache-disk(On,8192 MiB)2,296.5 ms(2.30 s,9.58xfaster)6,8681.85 GiB303 / 448 MiB2,773.9 MiBover 12 switches at103–115 MB/sHardened 5-Point Deep Console Verification (
14B MoE,~7,154prompt tokens, 256 MiB flex)OffA2cold prefill:23,003.8 ms(cached_tokens: 0);Onwarm SSD restore:2,717.9 ms(cached_tokens: 7,130,8.46xfaster, disk load0.36 s@581 MB/s).1,640.4 MiBacross 16 files):2,601.1 ms(cached_tokens: 7,150, disk load0.41 s@511 MB/s)./data/PS5LM/cache/promptsto0files andA4ran cold prefill in22,973.3 ms(cached_tokens: 0)..seq, 50%-truncated.seq, and 50%-truncated.chkwere all caught by FNV-1a / stream validation, discarded without crashing, and fell back to prefill ->HTTP 200(cached_tokens: 0)..seq/.chk/.partfiles cleanly (0left).--cache-disk-mib 300evicted the oldest207.570 MiBentry, keeping disk usage at207.6 MiB <= 300 MiB.--cache-disk /app0/nopelogged a warning gracefully and servedHTTP 200; hosttest_disk_enospcverified/dev/fullENOSPC(errno=28),128 MiBfree-space guard, andRLIMIT_FSIZE(errno=27) aborting and unlinking.part.0.00 GiBVRAM overhead (min_pool_free2.04vs2.04 GiB),0 MiBflex overhead (111vs111 MiB),+0.08 GiBtransient heap peak (0.78vs0.86 GiB), and1.000xwrite amplification (single-passftpsrvstream to.part+ atomic rename).B -> Atrials,cached_tokens = 7,114..7,134, allHTTP 200):2,502.1 ms| Median2,604.2 ms| Mean2,587.6 ms| Worst2,644.2 ms(98–104 MB/ssaves,564–581 MB/sloads).Refs #89.
Console Screenshots
Live PS5 TV Settings → Model showing Disk cache spillover defaulting to
Off(Disk cache limit:8 GB).Opening Disk cache spillover lists
Offfirst aboveAuto (when near full)andAlways on.Opening Disk cache limit presents the SSD cache cap choices (
2 GB,4 GB,8 GB,16 GB,32 GB).Generated with Google's Antigravity