You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GLM CUDA: keep kept prompt states in pinned host memory (complements #1732) #1735
GLM CUDA keeps its kept prompt states in one device arena, which gets only the memory the KV page pool leaves over
(#1510). On a discrete card that can be a fraction of a GiB, so a long conversation's state is refused and every turn
prefills the whole conversation again. #1732 addresses this by keeping prompts as the pool's own pages.
This issue is a complementary route for discrete cards: keep kept states in pinned host memory.
The server already has a host-cache path (host_snaps, --prompt-cache-gib sized in host memory, as Nemotron uses);
GLM doesn't opt in.
With the snapshot arena in pinned host memory mapped into the device's address space, the existing cuMemcpyDtoDAsync keep/restore copies move a state across PCIe (~57 GB/s each way on PCIe Gen5 x16).
The device cache's share goes back to the KV pool.
Unset, nothing changes.
Where it helps most is many long conversations at once (agent sessions):
Measured on two RTX PRO 6000 Blackwell cards (96 GB) at TP=2 with Mia-AiLab/GLM-5.3-Flash-EXL3-4bpw-TensorFold
(weights 86.2 GiB a rank, 320K window):
main
with TF_GLM_HOST_CACHE=1 --prompt-cache-gib 24
device prompt cache
0.5 GiB
none (24 GiB per rank in host memory)
next turn of a 250K-token conversation
prefills again (83 s)
0.8 s
10 interleaved conversations, 40K-200K tokens
0% of follow-up tokens resumed
74%
decode, cold 32K/64K prefill
unchanged (within 0.4%)
Resumed replies are identical to fresh ones, and bench_concurrent --alone --serial passes. A pull request with the
full receipt follows.
This is the first of a few steps toward serving GLM-5.3-Flash on two 96 GB cards with system memory taking the pressure
off the KV window. Later steps would be GLM's vision tower in host memory, then live DSA latent rows in host memory for
long windows, building on the host tier in #1501/#1522. Each would be its own issue and pull request, and we'd like
maintainer guidance on the last one before starting it.
Activity
russellmm commentedon Oct 31, 2026
/atc claim
glm cuda: TF_GLM_HOST_CACHE keeps kept prompt states in pinned host m…
glm cuda: TF_GLM_HOST_CACHE keeps kept prompt states in pinned host m…