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

Đang mở
#24,914 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@brave30 đang làm issue này rồi.

Từ ngày 13/11/2026.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
ai-infra-agents

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
5.2k
Fork
1.3k
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
644

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pytorch/executorch

Tất cả issue của pytorch/executorch

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.