Skip to content

feat: enable Muse Glimmer DFlash prefix snapshots (L1/L2 caches) - #5

Open
nazerim wants to merge 1 commit into
jundot:mainfrom
nazerim:feat/muse-glimmer-prefix-snapshots
Open

feat: enable Muse Glimmer DFlash prefix snapshots (L1/L2 caches)#5
nazerim wants to merge 1 commit into
jundot:mainfrom
nazerim:feat/muse-glimmer-prefix-snapshots

Conversation

@nazerim

@nazerim nazerim commented Aug 14, 2026

Copy link
Copy Markdown

Summary

Enable DFlash prefix snapshots (L1 in-memory + L2 SSD caches) for the Muse Glimmer target.

Problem

MuseGlimmerTargetOps.capabilities_for declared supports_prefix_snapshot=False as a conservative bring-up gate that was never lifted. Result: the DFlash prefix cache never inserted anything (insertions=0 forever), 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.
  • The generic serialize/hydrate machinery (dflash_mlx/cache/codecs.py) already supports muse's mixed cache layout — sliding-window RotatingKVCache (ring _idx + absolute offsets) alongside full KVCache layers — so only the capability flag gates it.
  • New round-trip test 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

  • New test passes standalone (17 passed in test_target_muse_glimmer.py); full dflash-mlx suite 1306 passed.
  • Live on oMLX with a real Muse-Glimmer-30B-oQ6 server: growing-conversation request hit 316/346 tokens via L1 (prefill_tokens_saved=316); L2 SSD writes/persistence confirmed across a server restart.

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
nazerim force-pushed the feat/muse-glimmer-prefix-snapshots branch from 5b74688 to 42413d2 Compare August 16, 2026 18:50
@nazerim
nazerim marked this pull request as ready for review August 16, 2026 18:54
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