Skip to content

doc: Document KV cache materialization during chunked prefill#114

Merged
Connor1996 merged 2 commits intoskyzh:mainfrom
Connor1996:codex/prefill-materialize-docs
Apr 13, 2026
Merged

doc: Document KV cache materialization during chunked prefill#114
Connor1996 merged 2 commits intoskyzh:mainfrom
Connor1996:codex/prefill-materialize-docs

Conversation

@Connor1996
Copy link
Copy Markdown
Collaborator

@Connor1996 Connor1996 commented Apr 12, 2026

What changed

This follow-up adds a short explanation for why chunked prefill materializes the KV cache with mx.eval:

  • add an inline comment in src/tiny_llm_ref/batch.py
  • add a matching tip in book/src/week2-06-prefill-and-batch.md

Why

The existing code does the right thing, but the reason is easy to miss when reading the implementation or the chapter. This note makes it explicit that mx.eval is there to keep the lazy graph from growing across prefill chunks.

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
@Connor1996 Connor1996 changed the title [codex] document KV cache materialization during chunked prefill doc: Document KV cache materialization during chunked prefill Apr 13, 2026
@Connor1996 Connor1996 marked this pull request as ready for review April 13, 2026 00:00
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
@Connor1996 Connor1996 merged commit 370514e into skyzh:main Apr 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant