SiAPI.ai
Português (BR)

GLM-5.3 1M Context: What Happens When Agent Sessions Stretch

By Cameron Voss

Published · 6 min read

TL;DR

The 1M-token window on GLM-5.3 is a real engineering budget, not a marketing rounding. One 1M request carries roughly 53.4 GiB of FP8 KV cache, and an H200 leaves about 15 GiB of headroom per GPU, so the window only exists because the serving stack shards the cache along tokens and spills part of it into host memory. Each of those moves has a measurable price. On your side of the API, the window stays shut unless you open it yourself. Here is what breaks as context grows, in the order it breaks.

In this article

The memory wall: 53 GiB in a 15 GiB room

Start with arithmetic instead of benchmarks. In FP8, the KV cache for a single 1M-token request weighs about 53.4 GiB. An H200 keeps roughly 15.3 GiB free for KV after weights and activations. One GPU cannot hold the request, and the obvious fix does not work: under tensor parallelism the latent KV of MLA is replicated on every rank, so eight GPUs still hold 53.4 GiB each. Adding silicon buys no headroom at all.

What works is cutting the cache along the token axis. Decode context parallelism, DCP, round-robins tokens across ranks and brings the per-GPU requirement down to about 6.7 GiB, inside the budget. That one change is the difference between 1M context as a spec sheet line and 1M context as a running service.

Bar chart of KV cache memory per GPU for one 1M-token GLM-5.3 request: 53.4 GiB on one GPU under DP8, 53.4 GiB on every GPU under TP8, and 6.7 GiB per GPU under PCP8 with DCP8, against a 15.3 GiB per-GPU budget line
KV per GPU for one 1M-token request: tensor parallelism replicates the cache, so eight GPUs hold the same 53.4 GiB each. Sharding by token with DCP8 is what fits the 15.3 GiB per-GPU budget.

Prefill is memory-bound until you split the prompt

Sharding the decode cache does not fix the wait for the first token. Under TP8 each GPU holds 8 of the 64 attention heads but still runs the full sparse indexer over every token in the prompt, so prefill moves far more bytes than it computes: around 26 FLOPs per byte, against a compute-bound ridge near 206 on H200. The GPUs spend the prefill waiting on memory.

Prefill context parallelism, PCP, cuts the prompt into 16 chunks and hands each GPU a V-shaped pair of them, so every rank indexes only the tokens it owns while keeping all 64 heads. Arithmetic intensity climbs to about 191 FLOPs per byte, close enough to the ridge to behave like a compute-bound kernel. In the vLLM team's AgentX runs, median time to first token at long context fell from 1.5 to 5.2 seconds under DP8 to 0.8 to 0.9 seconds under PCP8 with DCP8, at equal throughput, with 1.7 to 3.2 times the interactivity.

The concurrency cliff, and the toll for skipping it

DCP is not free. Every decode step all-gathers the shards each layer needs for attention into a temporary copy, then frees it. That costs about 6 percent per step up to 64K of cached context, rising to about 15 percent at 248K for a 2K-token chunk. You pay the toll on every token you stream.

Line chart of DCP8 per-step overhead as a percentage of a step without DCP, against cached context length: about 6 percent up to 64K tokens, rising to 15 percent at 248K for a 2K-token chunk
The DCP8 tax per step: flat and modest through 64K, then climbing. Long sessions pay more per token than short ones, which is exactly where the budget planning matters.

The harder wall at decode is concurrency. With KV pinned in HBM, the number of users you can serve at 1M context is the HBM divided by 53.4 GiB, which is a small number with no decimal places. HiSparse moves the decode KV into a host memory pool, 48 GiB per node plus 16 GiB of offload per rank in the tested setup, so concurrency becomes bounded by RAM instead of HBM.

The price and the payoff both show up in the throughput-interactivity pareto. At 64 concurrent sessions, PCP8 with DCP8 prefill plus HiSparse decode holds 8,340 logical tokens per second per GPU at 29.6 tok/s per user. Every other combination in the same test collapses to 1 or 2 tok/s per user at that load. At the full 1M context limit, only that one combination runs at all.

Pareto chart of total tokens per second per GPU against P90 interactivity in tokens per second per user, at 142K and 1M context, for four prefill and decode combinations; only PCP8 plus DCP8 prefill with HiSparse decode has points at 1M context
Throughput against interactivity: at 142K several configurations compete. At 1M the field narrows to one, and the gap between it and the rest is the difference between a responsive agent and a queued one.

The window stays closed until you open it

None of the above is visible from the API, and the client brings traps of its own. The window holds up on multi-hour agentic sessions, but in tools such as Claude Code it does not open by default: you append [1m] to the model name and set CLAUDE_CODE_AUTO_COMPACT_WINDOW to 1000000. Skip that and the client compacts history on its own schedule, and you spend the session inside a much smaller window than the one you paid for.

Two more settings matter at this length. Reasoning is always on, since the API accepts only thinking.type: "enabled", and reasoning_effort at low, high or max is both the quality dial and the cost dial, because reasoning tokens bill as output. And GLM-5.3 is text-only; vision requests belong to GLM-5.3-Flash.

The public numbers are first-party runs: Terminal-Bench 3.0 at 28.3 against 4.6 for GLM-5.2, DeepSWE v1.1 at 66.9 against 46.2, Agents' Last Exam at 28.5 against 23.8. Read them as a direction rather than a promise, and re-run on your own traces before you bet a pipeline on them.

Memory, latency, concurrency, then your own config

Memory breaks first: 53.4 GiB per request in FP8, fixed by sharding along tokens rather than by buying GPUs. Latency breaks second: unsharded prefill is memory-bound, and PCP buys the ridge back at the cost of a chunked schedule. Concurrency breaks third: HBM-pinned KV caps you at single-digit users, and host-memory KV lifts that cap for a 6 to 15 percent per-step toll. And on your side of the wire, silent compaction breaks the window before any server-side limit gets the chance. Check the client's compaction settings before you blame the model.

Try the 1M window on your own traffic

Charts from someone else's cluster only tell you what is possible. SiAPI.ai serves GLM-5.3 on a recurring plan behind a single key, with OpenAI- and Anthropic-compatible endpoints, so an existing client can point at the model and measure what your own long-context sessions actually cost before you commit.

Plan details and quota for the billing period are on the GLM-5.3 model page.