Refactor cache init logic (#13800)
This commit is contained in:
@@ -3,6 +3,7 @@ import unittest
|
||||
import torch
|
||||
|
||||
from sglang.srt.mem_cache.allocator import SWAKVPool, SWATokenToKVPoolAllocator
|
||||
from sglang.srt.mem_cache.cache_init_params import CacheInitParams
|
||||
from sglang.srt.mem_cache.memory_pool import ReqToTokenPool
|
||||
from sglang.srt.mem_cache.radix_cache import RadixKey
|
||||
from sglang.srt.mem_cache.swa_radix_cache import SWARadixCache
|
||||
@@ -110,11 +111,13 @@ class TestSWA(unittest.TestCase):
|
||||
)
|
||||
# setup radix cache
|
||||
tree = SWARadixCache(
|
||||
req_to_token_pool=req_to_token_pool,
|
||||
token_to_kv_pool_allocator=allocator,
|
||||
params=CacheInitParams(
|
||||
req_to_token_pool=req_to_token_pool,
|
||||
token_to_kv_pool_allocator=allocator,
|
||||
disable=False,
|
||||
page_size=1,
|
||||
),
|
||||
sliding_window_size=sliding_window_size,
|
||||
page_size=1,
|
||||
disable=False,
|
||||
)
|
||||
|
||||
# test
|
||||
@@ -241,12 +244,14 @@ class TestSWA(unittest.TestCase):
|
||||
)
|
||||
# setup radix cache
|
||||
tree = SWARadixCache(
|
||||
req_to_token_pool=req_to_token_pool,
|
||||
token_to_kv_pool_allocator=allocator,
|
||||
params=CacheInitParams(
|
||||
req_to_token_pool=req_to_token_pool,
|
||||
token_to_kv_pool_allocator=allocator,
|
||||
page_size=1,
|
||||
disable=False,
|
||||
is_eagle=True,
|
||||
),
|
||||
sliding_window_size=sliding_window_size,
|
||||
page_size=1,
|
||||
disable=False,
|
||||
is_eagle=True,
|
||||
)
|
||||
|
||||
# test
|
||||
|
||||
Reference in New Issue
Block a user