Add SGLANG_ENABLE_WAR_BARRIER to force-enable the overlap scheduler WAR barrier on non-CUDA (e.g. AMD) (#27967)
This commit is contained in:
@@ -309,6 +309,10 @@ class Envs:
|
|||||||
# Scheduler: others:
|
# Scheduler: others:
|
||||||
SGLANG_EMPTY_CACHE_INTERVAL = EnvFloat(-1) # in seconds. Set if you observe high memory accumulation over a long serving period.
|
SGLANG_EMPTY_CACHE_INTERVAL = EnvFloat(-1) # in seconds. Set if you observe high memory accumulation over a long serving period.
|
||||||
SGLANG_DISABLE_CONSECUTIVE_PREFILL_OVERLAP = EnvBool(False)
|
SGLANG_DISABLE_CONSECUTIVE_PREFILL_OVERLAP = EnvBool(False)
|
||||||
|
# Force-enable the WAR (write-after-read) barrier for the overlap scheduler
|
||||||
|
# even when is_cuda() is False (e.g. AMD/ROCm). On CUDA the barrier is
|
||||||
|
# already enabled regardless of this flag (see start_event_loop).
|
||||||
|
SGLANG_ENABLE_WAR_BARRIER = EnvBool(False)
|
||||||
# PP: skip output send/recv when the entire batch consists of non-final chunked prefill requests,
|
# PP: skip output send/recv when the entire batch consists of non-final chunked prefill requests,
|
||||||
# since process_batch_result_prefill discards next_token_ids for those anyway.
|
# since process_batch_result_prefill discards next_token_ids for those anyway.
|
||||||
SGLANG_PP_SKIP_PURE_CHUNKED_OUTPUT_COMM = EnvBool(False)
|
SGLANG_PP_SKIP_PURE_CHUNKED_OUTPUT_COMM = EnvBool(False)
|
||||||
|
|||||||
@@ -1424,7 +1424,9 @@ class Scheduler(
|
|||||||
# DFLASH fences its shared req_to_token writes with verify_done /
|
# DFLASH fences its shared req_to_token writes with verify_done /
|
||||||
# plan-stream deps, so the global WAR barrier only serializes plan
|
# plan-stream deps, so the global WAR barrier only serializes plan
|
||||||
# overlap. TODO: generalize this global-barrier enablement policy.
|
# overlap. TODO: generalize this global-barrier enablement policy.
|
||||||
self._war_barrier_enabled = is_cuda() and not self.spec_algorithm.is_dflash()
|
self._war_barrier_enabled = (
|
||||||
|
is_cuda() or envs.SGLANG_ENABLE_WAR_BARRIER.get()
|
||||||
|
) and not self.spec_algorithm.is_dflash()
|
||||||
with self.device_module.StreamContext(self.schedule_stream):
|
with self.device_module.StreamContext(self.schedule_stream):
|
||||||
dispatch_event_loop(self)
|
dispatch_event_loop(self)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user