[Auto Sync] Rename is_hybrid to is_hybrid_swa (#14252)

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: Hanming Lu <hanming@x.ai>
This commit is contained in:
Lianmin Zheng
2025-12-01 23:24:24 -08:00
committed by GitHub
co-authored by github-actions[bot] <github-actions[bot]@users.noreply.github.com> Hanming Lu Hanming Lu
parent 63b9300f00
commit 64092c8b55
15 changed files with 79 additions and 79 deletions
@@ -359,7 +359,7 @@ class PrefillAdder:
]
)
self.is_hybrid = isinstance(
self.is_hybrid_swa = isinstance(
self.token_to_kv_pool_allocator, SWATokenToKVPoolAllocator
)
self.is_hybrid_gdn_cache = isinstance(self.tree_cache, MambaRadixCache)
@@ -380,7 +380,7 @@ class PrefillAdder:
@property
def rem_total_tokens(self):
if self.is_hybrid:
if self.is_hybrid_swa:
available_and_evictable = min(
self.token_to_kv_pool_allocator.full_available_size()
+ self.tree_cache.full_evictable_size(),
@@ -402,7 +402,7 @@ class PrefillAdder:
@property
def cur_rem_tokens(self):
if self.is_hybrid:
if self.is_hybrid_swa:
available_and_evictable = min(
self.token_to_kv_pool_allocator.full_available_size()
+ self.tree_cache.full_evictable_size(),
@@ -472,7 +472,7 @@ class PrefillAdder:
@contextmanager
def _lock_node(self, last_node: TreeNode):
if self.is_hybrid:
if self.is_hybrid_swa:
try:
swa_uuid_for_lock = self.tree_cache.inc_lock_ref(last_node)
yield None
@@ -525,7 +525,7 @@ class PrefillAdder:
else:
add_req_state(req, insert_sort=True)
if not self.is_hybrid:
if not self.is_hybrid_swa:
# Skip this logic for swa. The SWA has different memory management, and
# this mechanism is underestimating the memory usage.
cur_rem_tokens = self.cur_rem_tokens - self.ceil_paged_tokens(
@@ -616,7 +616,7 @@ class PrefillAdder:
if self.rem_chunk_tokens is None or input_tokens <= self.rem_chunk_tokens:
# Non-chunked prefill
self.can_run_list.append(req)
if self.is_hybrid:
if self.is_hybrid_swa:
swa_uuid_for_lock = self.tree_cache.inc_lock_ref(req.last_node)
req.swa_uuid_for_lock = swa_uuid_for_lock
else:
@@ -652,7 +652,7 @@ class PrefillAdder:
self.can_run_list.append(req)
self.new_chunked_req = req
if self.is_hybrid:
if self.is_hybrid_swa:
swa_uuid_for_lock = self.tree_cache.inc_lock_ref(req.last_node)
req.swa_uuid_for_lock = swa_uuid_for_lock
else: