Repository navigation
Conversation
…k slots Keep hot conversation states in bounded host RAM and spill older states to disk. Preserve LRU age across spill/restart, enforce disk budgets before writes, flush normal returns, and report bounded miss reasons without prompt text. Add a portable source-extracted host regression and attach scoped historical results. Keep the existing disk fallback and deployment budgets configurable. Constraint: Default off; no deployment-specific RAM/disk allocation Constraint: Exclude unrelated NUMA and dynamic-DFlash overlays Confidence: high Scope-risk: moderate Not-tested: PR-head CUDA link, real-model disk restart, full-budget pressure, or production multi-agent speedup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Concurrent agents interleave conversations while waiting on tools or other tasks. Once the active contexts and count-capped slots are exhausted, returning to an unchanged conversation can require reading its prompt again despite spare host memory and disk capacity.
Add opt-in RAM-to-disk conversation slots: keep bounded hot states in RAM, spill the RAM LRU, and trim disk states by actual last use. Preserve recency across spill/restart, reject oversized/zero-budget writes before evicting other files, flush normal CLI/serve returns, and distinguish miss reasons without logging prompt text.
MAYA_GLM_SLOT_SPILLremains off by default. Both budgets are configurable:MAYA_GLM_SLOT_RAM_GBfalls back to 8 GiB when opted in; disk uses the existingMAYA_GLM_SLOT_GBfallback of 16 GiB. No deployment-specific allocation is embedded.MAYA_GLM_SLOTS=0still disables slots.This branch is based on current
mainand excludes the development branch's separate NUMA/shared-pool and dynamic-DFlash changes. It changes conversation retention, not the number of decoding workers or the scheduler.Answers
No weights, routing, sampling or prefix/image compatibility rules are changed. Full real-model disk restoration and token-parity validation remain outside the evidence below.
Tested on
generate.cppcompiled as a host object. No CUDA link or model execution on this branch. The portable harness is wired into CPU-only CI.12,24,35. Linux/CUDA incremental link passed. Seven bounded model requests returnedOK; returning to a 1470-token prompt restored 1469 tokens from RAM, while an edited beginning restored 0. Natural traffic interleaved.082464a: upstream Linux Python/host checks and macOS/Metal checks passed. The new conversation-slot step passed on Linux; the fork push workflows also passed.Validation details and machine-readable receipts: scope and limits, standalone host results, historical results.
Speed
No new throughput or production-average claim. In an earlier pre-fix capacity observation, returning to the first of nine 9236-token conversations took 4.480s with legacy slots (0 cached tokens) versus 0.202s with RAM spill (9235 cached tokens). This was one synthetic return with interleaved traffic, not an isolated multi-agent benchmark. Five conversations had not exhausted the active contexts plus saved slots.
No new
agent_bench.pyrun, decode/prefill A/B, full quality suite, full-budget pressure test, or real-model disk-overflow/restart test was performed. Historical RAM hits do not validate disk restoration. Preparing this PR did not connect to the model host, start WSL, send inference requests, or change the running service.Checks