Repository navigation
Replies: 7 comments
|
Tested the hybrid GDN cache branch (rebased onto
Regression observed with
|
|
Follow-up on the
While |
|
@nfiedel @parasew I'd like to split this up and start with #0 + #1 as one PR. #0 doesn't change anything on main by itself, because nothing reads the rewritten
I'd hold #2 for now. The regression in parasew's trace isn't a missing walk-back. Every candidate value is the baseline match floored to a multiple of 16384, and the reject log only fires when there is no grid block below the match. The block that loses its state is the previous prompt's last full block, which is exactly where the next turn picks up. The scheduler still captures that boundary, but I haven't gone through #3 and #4 yet. #4 needs #1 anyway, so they can follow after. |
|
Confirming for the M1 Max run: Thinking was OFF (default in the probe script). I've also just verified the # A0 -> A1 -> A2
# A2 is PROTECTED (e.g. by an active request)
# A1 and A0 are NOT in protected_hashes
releasable = budget.releasable_bytes({b"A2"}) # returns size(A0) + size(A1)
freed = budget.shrink_to(0, protected_hashes={b"A2"}) # returns 0 (A2 blocks P)In I'm preparing an isolated run for |
|
Tested #1 ( 1. Hot-Only Tier Survival (1 GB Hot Cache)Scenario: Conversation grows 16k -> 56k. At 36k, it exceeds the 1 GB RAM limit (approx. 10 blocks at 92 MB each).
Befund: Plain 2. SSD Write Reduction (SSD-on)Scenario: 6 main turns interleaved with 6 side turns (short 3k "distractor" requests). 1 GB Hot Cache.
Befund: By prioritizing orphans and leaves for eviction, 3. Bonus:
|
|
Thanks @jundot and @parasew for your detailed comments, identifying regressions, and suggesting the path forward. I've opened a PR with change 0 + change 1 only, as suggested: #5255. Changes 2–4 (snapshot interval, RAM staging budget, SSD write policy) are set aside for now. On your three conditions:
On the interval regression @parasew found: I reproduced it. It needs thinking off, or a client that resends the assistant turn differently, plus answers long enough to cross a block.
A fix exists: also keep the snapshot at each prompt's last full block. That snapshot is already captured, so it costs no extra prefill.
I can explore that with change 2 once this PR is settled. Any & all feedback is welcome. Thanks! |
|
Thanks jundot for merging the chain-aware eviction PR. I've opened change 2, gdn_snapshot_interval, as #5628. It's opt-in: the default of 1 keeps current behavior of storing every snapshot. With N=4, hybrid models keep only every 4th recurrent snapshot, plus each prompt's last full block and the tail. This cuts the cache by up to ~50% in RAM and on SSD. Appending a turn or regenerating the last one is unaffected. Only a branch inside an earlier part of a prompt re-prefills, at most N−1 blocks, and outputs stay identical. This includes the fix for the regression found earlier in this thread, where a turn that diverges right after the previous prompt lost its snapshot. |
Uh oh!
There was an error while loading. Please reload this page.
Motivation
I'm running agents using Qwen3.8-Flash-Next (hybrid GDN) locally. Three goals:
Changes (independent unless noted; defaults unchanged except #3)
parent_hash.hot_cache_eviction_policy: "chain_aware_lru"(diff)gdn_snapshot_interval: N(diff)gdn_staging_ram_budget(default"30%"of the hot cache) (diff)ssd_cache_write_policy: "min_chain_tokens"(diff)Results (Mac Studio M5 Ultra, 256 GB, deterministic agent replays)
Ask
Is this direction welcome? I'm happy to split, rename or reshape any of it, open PRs in whatever order suits you, or leave the implementation to you. The benchmark harness and full results are on my fork.
AI-assisted (Claude Code); I've reviewed and validated the results.
All reactions