Skip to content

feat: generation pipeline — cache, kvScheme, thinking, perplexity - #32

Merged
ekryski merged 1 commit into
ekryski:alphafrom
TheTom:pr/alpha-2-evaluate
Apr 16, 2026
Merged

ekryski merged 1 commit into
ekryski:alphafrom
TheTom:pr/alpha-2-evaluate

Conversation

@TheTom

@TheTom TheTom commented Apr 16, 2026 •

Copy link
Copy Markdown

Clean port from ek/tom-eric-moe-tuning. Part of alpha cleanup. Includes:

  • KVCache memory leak improvements
  • KVCache set up for speculative decoding (especially for Mambacache which is hard to do speculative decoding with, requires snapshotting)
  • Smarter memory ticket size evaluation that takes into account model size, quantization, kv cache, and prompt size. This way we're not under-allocating nullifying the value of pinning memory or over allocating dramatically. Could use some tuning in the future.

@ekryski ekryski left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be merged after #31 as there is some overlap that should be rebased.

- Add cache: parameter to TokenIterator and ModelContainer.generate()
- Add kvScheme to GenerateParameters for KV cache quantization
- Add additionalProcessors to GenerateParameters with CompositeLogitProcessor
- Add ModelContainer.generateTokens() with cache: parameter
- Add ModelContainer.newCache() for pre-allocated cache creation
- Add WiredMemoryUtils.estimatedTicket() and estimateBudget() for static memory estimation
- Add WiredMemoryUtils.ticket(from:) for measurement-based ticket creation
- Add public init on WiredMemoryMeasurement

Co-Authored-By: tturney1@gmail.com
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants