[MLX] Support Qwen3.5 (dense) Model (#25754)
Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com> Co-authored-by: Alex Nails <alex.nails@radixark.ai> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Alex Nails
Claude Opus 4.6
parent
7c5708cba7
commit
a952e9174f
File diff suppressed because it is too large
Load Diff
@@ -41,8 +41,11 @@ from sglang.srt.mem_cache.swa_memory_pool import SWAKVPool, SWATokenToKVPoolAllo
|
||||
from sglang.srt.mem_cache.unified_cache_components.tree_component import (
|
||||
CacheTransferPhase,
|
||||
ComponentType,
|
||||
EvictLayer,
|
||||
TreeComponent,
|
||||
)
|
||||
from sglang.srt.mem_cache.unified_radix_cache import (
|
||||
COMPONENT_REGISTRY,
|
||||
UnifiedRadixCache,
|
||||
UnifiedTreeNode,
|
||||
)
|
||||
@@ -119,6 +122,52 @@ class CacheConfig:
|
||||
return "_".join(parts)
|
||||
|
||||
|
||||
class _FakeFullComponent(TreeComponent):
|
||||
component_type = ComponentType.FULL
|
||||
|
||||
def create_match_validator(self, match_device_only: bool = False):
|
||||
return lambda node: True
|
||||
|
||||
def redistribute_on_node_split(self, new_parent, child):
|
||||
return None
|
||||
|
||||
def evict_component(
|
||||
self, node, target: EvictLayer = EvictLayer.DEVICE
|
||||
) -> tuple[int, int]:
|
||||
return 0, 0
|
||||
|
||||
def drive_eviction(self, params: EvictParams, tracker: dict[ComponentType, int]):
|
||||
return None
|
||||
|
||||
def acquire_component_lock(self, node, result):
|
||||
return result
|
||||
|
||||
def release_component_lock(self, node, params):
|
||||
return None
|
||||
|
||||
|
||||
class TestUnifiedRadixComponentRegistryOverride(CustomTestCase):
|
||||
def test_component_registry_override_is_instance_local(self):
|
||||
params = CacheInitParams(
|
||||
req_to_token_pool=ReqToTokenPool(
|
||||
size=2,
|
||||
max_context_len=8,
|
||||
device="cpu",
|
||||
enable_memory_saver=False,
|
||||
),
|
||||
token_to_kv_pool_allocator=None,
|
||||
page_size=1,
|
||||
disable=True,
|
||||
tree_components=(ComponentType.FULL,),
|
||||
component_registry_override={ComponentType.FULL: _FakeFullComponent},
|
||||
)
|
||||
|
||||
tree = UnifiedRadixCache(params=params)
|
||||
|
||||
self.assertIsInstance(tree.components[ComponentType.FULL], _FakeFullComponent)
|
||||
self.assertIsNot(COMPONENT_REGISTRY[ComponentType.FULL], _FakeFullComponent)
|
||||
|
||||
|
||||
def build_fixture(cfg: CacheConfig, *, enable_kv_cache_events: bool = False):
|
||||
"""Create (tree, allocator, req_to_token_pool) from a CacheConfig."""
|
||||
server_args = ServerArgs(model_path="dummy", page_size=cfg.page_size)
|
||||
|
||||
Reference in New Issue
Block a user