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>
39 lines
1002 B
Python
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
|