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

Abierto
#24,914 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@brave30 ya está trabajando en esto.

Desde el 13/11/2026.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
5.2k
Forks
1.3k
Merge medio
1 d 7 h
PR fusionados (30 d)
644

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pytorch/executorch

Todos los issues de pytorch/executorch

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.