Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog.d/glm-long-context-decode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### GLM-5.3-Flash decodes faster at long context

GLM's paged attention reads (index metadata, latent history and each query's selected latents) now bind up to 17
memory segments per GPU launch and copy only the pages each segment holds, instead of one full-history launch per
segment after a zero fill. Decode steps and MTP verification rounds also submit GPU work in larger command buffers,
as Nemotron Super already does for plain decode. On an M5 Ultra, one request now decodes at about 73, 62 and 48
tokens per second after 8K-, 32K- and 64K-token prompts, up from about 63, 36 and 19. Outputs are unchanged: every
read copies the same bytes.
11 changes: 10 additions & 1 deletion docs/architecture/inference.md
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,16 @@ engine prices one worst-case step at setup and stays inactive when it exceeds
the post-load envelope (about 56.8 GB of admission on a 256 GiB host, shared
with KV). Decode and MTP verification rows (at most 8 sparse queries) read one
selection row per query, retained until the step fence (about 46 MB per query
across 11 DSA layers). A longer row whose selection rows would read at least
across 11 DSA layers). Each paged read launch binds up to 17 of the 64 MiB
segments that hold the row's pages (`PagedSegmentDispatchPlan.maximumBindings`):
index metadata and latent-history reads cover only those segments' pages, one
threadgroup per page, with no zero fill, and a selection read copies each row
with one SIMD-group (`GLM5NextPagedTransfers`). Plain decode steps (every row
one token) and MTP rounds whose rows are all decode or verification rows (at
most 8 tokens) commit a Metal command buffer every 100 operations with no
input-size bound, as Nemotron Super and Flint do for plain decode
(`GLM5NextDecodeCommandBuffers`); prefill chunks keep MLX's defaults. A longer
row whose selection rows would read at least
its history instead reads its whole latent plane once per layer through
the page table and runs the contiguous arithmetic over it
(`GLM5NextPagedPayload.latentHistory`, `GLM5NextPagedModelBinding.readsLatentHistory`),
Expand Down