- 合并 GenerationRequest/GenerationParams,统一 max_tokens 参数名 - PagePool/PrefixCache 分离为 Allocator + PrefixCache + PagePool - 拆分 KV 存储为独立 Storage 类,PagedCache → KVCache,CacheView → KvcacheView - Allocator.inc_ref 移除 LRU 防止竞争,Storage.write 增加负页防御 - Allocator/PrefixCache/TaskTable 加 threading.Lock 保证线程安全 - server.py uvicorn.run 改为传 app 对象修复导入错误 - benchmark.py 适配 KVCache 新 API
33 lines
674 B
Python
33 lines
674 B
Python
"""Inference core: cache, executor, scheduler, task management."""
|
|
|
|
from astrai.inference.core.cache import (
|
|
Allocator,
|
|
KVCache,
|
|
KvcacheView,
|
|
PagePool,
|
|
PrefixCache,
|
|
Storage,
|
|
TaskTable,
|
|
page_hash,
|
|
)
|
|
from astrai.inference.core.executor import Executor
|
|
from astrai.inference.core.scheduler import InferenceScheduler
|
|
from astrai.inference.core.task import STOP, Task, TaskManager, TaskStatus
|
|
|
|
__all__ = [
|
|
"Allocator",
|
|
"KVCache",
|
|
"KvcacheView",
|
|
"PagePool",
|
|
"PrefixCache",
|
|
"Storage",
|
|
"TaskTable",
|
|
"page_hash",
|
|
"Executor",
|
|
"InferenceScheduler",
|
|
"STOP",
|
|
"Task",
|
|
"TaskManager",
|
|
"TaskStatus",
|
|
]
|