Limit per-session prompt-end retention in the shared prefix cache

Aperta
#24,914 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@brave30 ci sta già lavorando.

Dal 13/11/2026.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start by reading the implementation and tests for --prefix-checkpoint-prompt-end and the shared prefix cache, then trace how captures, deduplicated entries, and session close/reset are handled. Design and validate an optional per-session retention policy while preserving shared reuse and the single global capacity. Done means the retry, multi-session pressure, deduplication, and close/reset cases are covered, and the tradeoff for older turns is documented.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Follow-up to #24624.

With --prefix-checkpoint-prompt-end every, each turn can add another snapshot to the shared prefix cache. One long conversation can therefore fill the cache and evict other sessions' prompt ends, reducing their retry reuse. For example, eight distinct prompt ends from one session can occupy an eight-entry cache.

Explore a retention mode that keeps only each session's newest prompt end, or its initial and newest prompt ends (at most two entries per session). Captures would record the originating session so older entries from that session can be replaced.

Entries should remain shared and reusable across sessions. --prefix-cache-entries must remain the single total capacity; a per-session cap should not reserve space or introduce private caches.

Validate that the policy:

  • Preserves reuse for cancellation, stop-string, and failure retries when the relevant prompt-end snapshot was captured.
  • Limits how much one session can occupy under multi-session cache pressure, while respecting global eviction and capacity.
  • Handles deduplicated snapshots and session close/reset consistently.

Document the tradeoff: retaining fewer historical prompt ends reduces reuse when returning to older turns. This is a follow-up policy option, not a prerequisite for #24624.

Lingua principale
Python
Stelle
5.2k
Fork
1.3k
Merge medio
1g 7h
PR unite (30g)
644

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pytorch/executorch

Tutte le issue di pytorch/executorch

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.