Skip to content

cache: migrate DeepSeek V4 Flash to the component cache #1000

Description

@fedeizzo

Summary

Move DeepSeekTextRunner from the legacy ContinuationCache to the component cache (ComponentTextCache). This is the remaining in-tree work on the legacy path, and it covers the scope of cache redesign card 17.

Current state

TextModelRunner::UsesComponentCache() defaults to false (src/ext/text.hpp). Qwen and Qwen Flash-Next override it; DeepSeek does not, so it is the only in-tree model on the legacy cache. Checkpoints are whole-session SessionSnapshot objects, in RAM and on disk.

Serving currently routes by that capability. D1 records a single switch-over with no routing, and card 17 is still marked proposed, so those documents should be updated to match what shipped.

Scope

  • Measure and record DeepSeek continuation capacity rows, including committed backing, before writing the adapter. The RFC research has no campaign for this model.
  • Inventory Session and SessionSnapshot state: compressed KV pools, sliding windows, indexers, mutable compressor state and DSpark draft state.
  • Decide for each component whether it is shareable or private. Compressed pools may not have a plain row-per-token geometry; this is the open chunk geometry question in the RFC.
  • Implement the adapter for AR and DSpark modes, using src/models/qwen38_flash_next/continuation_adapter.cpp and src/models/qwen/continuation_adapter.cpp as references.
  • Audit mutation paths, including session runtime, ROCm graph replay and rollback, and add guard calls on each.
  • Override UsesComponentCache(), CreateComponentCacheResources(), BindComponentState() and ReconcileComponentState(), then remove the legacy snapshot and persistence overrides from the runner.

Done when

  • Model-local round trips pass for each component, and the next step after restore matches an uninterrupted run in both modes.
  • Private bytes per checkpoint, shareable bytes per token, and capture and restore time are recorded at 32k and 100k tokens in both modes.
  • The cache and long-context functional suites pass on a real DeepSeek checkpoint for AR and DSpark.
  • The standard speed benchmark shows no regression against matched main, per phase.

Notes

Activity

  1. added
    cache
    serving
    on Nov 4, 2026
  2. self-assigned this
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cacheserving

Fields

Priority

High-prio

Effort

Medium-effort

Model

DeepSeek v4 flash

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions