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

未關閉
#24,914 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@brave30 已經在處理了。

開始於 2026年11月13日。

評估

難度
5/5
預估耗時
一週以上
新手友好度
35/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
python

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
Python
星號
5.2k
分支
1.3k
平均合併
1 天 7 小時
30 天內合併 PR
644

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

pytorch/executorch 的其他 Issue

查看 pytorch/executorch 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。