Repository navigation
DeepSeek-V4.1: --prompt-cache-gib sets the kept states' RAM limit, on every rank (#1625) - #2056
Merged
Merged
Conversation
Served.open dropped the server's prompt-cache budget, so the store's residency came only from the TF_DSV41_SESSION_* variables. The flag now sets the resident byte limit (0: none kept) when TF_DSV41_SESSION_RESIDENT_GIB is unset; a set variable wins and the engine logs it. With TP > 1 the followers never see the flag, so it is ignored there with a log line rather than letting rank 0's evictions diverge from the other ranks'. Refs #1625.
…imit Each rank's store enforces the resident limit itself on the same bytes, so the limit must be one value on every rank, but `tf-dsv41 follow` never sees the flag and the previous commit ignored it at TP > 1. Rank 0 now resolves its limit (the variable wins, else the flag, else unlimited) and sends it over the plan link right after the session preflight; followers use it. A follower whose own TF_DSV41_SESSION_RESIDENT_GIB is set and differs refuses on every rank by name, since a split limit would make a later restore disagree across ranks. The session protocol identity moves to 3, so ranks of different builds refuse at the preflight instead of misreading the new exchange. Refs #1625.
ashhart
force-pushed
the
lead/1625-cache-gib
branch
from
November 3, 2026 23:23
fe7e3fa to
bf788e6
Compare
This was referenced Nov 3, 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.
Closes #1625's first point. DeepSeek-V4.1 took its kept-state budget only from
TF_DSV41_SESSION_*, so--prompt-cache-gibdid nothing.--prompt-cache-gib Nsets the store's resident (in-RAM) limit to N GiB. 0 keeps no idle state in RAM; withTF_DSV41_SESSION_DISK, an evicted chat is parked on disk.TF_DSV41_SESSION_RESIDENT_GIBwins, with one log line.Host tests cover one rank (4 GiB, 1.5 GiB, 0, variable wins, neither) and two ranks over the loopback plan socket (the flag reaches the follower, a mismatch refuses on both, the default is kept on both). Both were checked to fail with the code broken. The DeepSeek host suites pass, the Linux CUDA build compiles, and there are no new lean problems. Replies don't move: the limit only decides which idle chats stay in RAM. A TP=2 run on two GB10s is still owed: the cap on both ranks, the same evictions, and the mismatch refusal. The 2,048-token resume boundary the issue also raises is a separate change.