feat: enable Muse Glimmer DFlash prefix snapshots (L1/L2 caches) - #5
Open
nazerim wants to merge 1 commit into
Open
feat: enable Muse Glimmer DFlash prefix snapshots (L1/L2 caches)#5nazerim wants to merge 1 commit into
nazerim wants to merge 1 commit into
Conversation
supports_prefix_snapshot was left False as a conservative bring-up gate. The generic serialize/hydrate machinery already handles muse's mixed cache layout (sliding-window RotatingKVCache with ring index + full KVCache layers), verified by the new test_snapshot_round_trip_matches_fresh_continuation: prefill -> snapshot -> hydrate -> continue must reproduce fresh-continuation logits, with rotating ring index and absolute offsets preserved. Enabling this populates the DFlash L1 in-memory prefix cache (and, with dflash_ssd_cache enabled, the L2 SSD tier) for Muse Glimmer — previously every request cold-prefilled (0% cached tokens; ~130s prefills on 54k prompts).
nazerim
force-pushed
the
feat/muse-glimmer-prefix-snapshots
branch
from
August 16, 2026 18:50
5b74688 to
42413d2
Compare
nazerim
marked this pull request as ready for review
August 16, 2026 18:54
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
Enable DFlash prefix snapshots (L1 in-memory + L2 SSD caches) for the Muse Glimmer target.
Problem
MuseGlimmerTargetOps.capabilities_fordeclaredsupports_prefix_snapshot=Falseas a conservative bring-up gate that was never lifted. Result: the DFlash prefix cache never inserted anything (insertions=0forever), so every request cold-prefilled. On long tool-call conversations (30k–57k token prompts) that meant a full ~130s prefill per turn, with 0% cached tokens in server stats.Change
target_muse_glimmer.py:supports_prefix_snapshot=True+supports_rotating_cache_snapshot=True.dflash_mlx/cache/codecs.py) already supports muse's mixed cache layout — sliding-windowRotatingKVCache(ring_idx+ absolute offsets) alongside fullKVCachelayers — so only the capability flag gates it.test_snapshot_round_trip_matches_fresh_continuation: prefill → serialize → hydrate → continue must reproduce fresh-continuation logits, with ring indices and offsets preserved. This is the "muse-specific round-trip coverage" the original conservative comment asked for.Verification
test_target_muse_glimmer.py); full dflash-mlx suite 1306 passed.316/346tokens via L1 (prefill_tokens_saved=316); L2 SSD writes/persistence confirmed across a server restart.