Files
sglang/python/sglang/srt/mem_cache/cache_init_params.py
T
Lianmin Zhenggithub-actions[bot] <github-actions[bot]@users.noreply.github.com>Hanming Lugemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
b027c5aca6 [Auto Sync] Update cache_init_params.py (20260209) (#18502)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Hanming Lu <69857889+hanming-lu@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-02-09 14:49:41 -08:00

39 lines
1002 B
Python

from __future__ import annotations
import dataclasses
from typing import TYPE_CHECKING, Optional
import torch
if TYPE_CHECKING:
from sglang.srt.mem_cache.allocator import BaseTokenToKVPoolAllocator
from sglang.srt.mem_cache.memory_pool import ReqToTokenPool
@dataclasses.dataclass
class CacheInitParams:
disable: bool
req_to_token_pool: ReqToTokenPool
token_to_kv_pool_allocator: BaseTokenToKVPoolAllocator
page_size: int
is_eagle: bool = False
tp_cache_group: Optional[torch.distributed.ProcessGroup] = None
eviction_policy: str = "lru"
disable_finished_insert: bool = False
enable_metrics: bool = False
enable_kv_cache_events: bool = False
enable_mamba_extra_buffer: bool = False
pp_rank: int = 0
pp_size: int = 1
chunked_prefill_size: Optional[int] = None
sliding_window_size: Optional[int] = None
# Time-to-live for cache entries in seconds. If None, TTL is disabled.
cache_ttl_seconds: Optional[float] = None