Repository navigation
spark-model: build SSM pools before the KV budget snapshot (fixes #61) - #63
Merged
Merged
Conversation
This was referenced Sep 25, 2026
Closed
AzeezIsh
added a commit
that referenced
this pull request
Sep 27, 2026
…QLite side files (#116) data/benchmarks.sqlite-wal (227 KB) and -shm (33 KB) were committed with #63 (e146bef, 2026-05-22) while the database itself is gitignored (*.sqlite), so the pair can never be opened and nothing in the tree references them (git grep finds no reader). Ignore *.sqlite-wal / -shm / -journal so a local benchmark DB cannot be committed again. Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Summary
Fixes #61 —
spark servedying withFailed to build model/cuMemAlloc_v2 status 2at long--max-seq-len(reproduced at 49152 on gfx1151, both Windows and the failing profile's exact flags).Root cause:
TransformerModel::newallocated the SSM state pool, Marconi snapshot pool, and decode-rollback ring after the KV cache was sized fromutil × total − used_so_far. Those allocations were invisible to the budget — at seq 49152 roughly 20 GB of post-KV allocations overflowed the physical remainder.Fix: hoists pool construction into a new
SsmPoolsbundle built infactory::build_modelbefore thegpu.free_memory()snapshot, so the pools land inused_so_farand the KV pool shrinks to fit — the same positional-budgeting rule the LoRA adapter load already documents.TransformerModel::newtakes the bundle and readshas_mtp/dflash_kgammaback from it (SSOT — the flag derivations moved with the pool construction).Test plan
cargo check -p spark-model -p spark-servercleancargo fmt --checkcleancargo clippy -p spark-model -p spark-server --testscleanGenerated with Devin