[misc] Rename SGLANG_OPT_SWA_RELEASE_LEAF_LOCK_AFTER_WINDOW to SGLANG_OPT_RELEASE_PREFILL_SWA (#42657)
This commit is contained in:
@@ -691,7 +691,11 @@ class Envs:
|
||||
# - Source builds with a missing or unusable Rust toolchain.
|
||||
# This also applies when Rust is explicitly selected.
|
||||
SGLANG_UNIFIED_RADIX_TREE_CORE_BACKEND = EnvStr("rust")
|
||||
SGLANG_OPT_SWA_RELEASE_LEAF_LOCK_AFTER_WINDOW = EnvBool(False)
|
||||
# Once decode passes the sliding window, drop the SWA part of the prefill's
|
||||
# tree lock; its SWA KV becomes evictable rather than freed.
|
||||
SGLANG_OPT_RELEASE_PREFILL_SWA = EnvBoolWithAlias(
|
||||
False, deprecated_name="SGLANG_OPT_SWA_RELEASE_LEAF_LOCK_AFTER_WINDOW"
|
||||
)
|
||||
|
||||
# ===================================================================
|
||||
# PD disaggregation runtime
|
||||
|
||||
@@ -3919,9 +3919,8 @@ class ScheduleBatch(ScheduleBatchDisaggregationDecodeMixin):
|
||||
# Auxiliary windows check their own cursors and prefix locks.
|
||||
has_auxiliary_swa = self.tree_cache.supports_auxiliary_swa()
|
||||
|
||||
release_leaf_lock = (
|
||||
envs.SGLANG_OPT_SWA_RELEASE_LEAF_LOCK_AFTER_WINDOW.get()
|
||||
and hasattr(self.tree_cache, "dec_swa_lock_only")
|
||||
release_leaf_lock = envs.SGLANG_OPT_RELEASE_PREFILL_SWA.get() and hasattr(
|
||||
self.tree_cache, "dec_swa_lock_only"
|
||||
)
|
||||
|
||||
eviction_interval = max(1, envs.SGLANG_SWA_EVICTION_INTERVAL.get())
|
||||
@@ -3949,10 +3948,8 @@ class ScheduleBatch(ScheduleBatchDisaggregationDecodeMixin):
|
||||
),
|
||||
)
|
||||
|
||||
# Once the decode position has moved past the sliding window,
|
||||
# the SWA portion of the prefill-time tree lock is no longer
|
||||
# needed by this request. Convert it from protected to
|
||||
# evictable so SWA LRU can reclaim it under pressure.
|
||||
# Past the window the request no longer reads its prefill's SWA;
|
||||
# release that part of the tree lock so SWA LRU can reclaim it.
|
||||
if (
|
||||
release_leaf_lock
|
||||
and not req.swa_prefix_lock_released
|
||||
|
||||
Reference in New Issue
Block a user