KV Cache Events with Attention DP bug fix (#16030) (#16412)

This commit is contained in:
Kartik Ramesh
2026-01-19 00:13:48 -06:00
committed by GitHub
parent 9fe56cd0fb
commit 5836324c55
2 changed files with 8 additions and 4 deletions

View File

@@ -297,9 +297,6 @@ class Scheduler(
self.enable_metrics_for_all_schedulers = (
server_args.enable_metrics_for_all_schedulers
)
self.enable_kv_cache_events = bool(
server_args.kv_events_config and tp_rank == 0
)
self.enable_trace = server_args.enable_trace
self.stream_interval = server_args.stream_interval
self.spec_algorithm = SpeculativeAlgorithm.from_string(
@@ -321,6 +318,10 @@ class Scheduler(
)
)
self.enable_kv_cache_events = bool(
server_args.kv_events_config and self.attn_tp_rank == 0
)
# Init model configs
self.init_model_config()

View File

@@ -13,6 +13,7 @@ from sglang.srt.disaggregation.kv_events import (
)
from sglang.srt.utils import kill_process_tree
from sglang.test.test_utils import (
DEFAULT_MLA_MODEL_NAME_FOR_TEST,
DEFAULT_SMALL_MODEL_NAME_FOR_TEST,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
DEFAULT_URL_FOR_TEST,
@@ -154,6 +155,8 @@ class TestKvEvents(CustomTestCase):
pass
finally:
sub.close()
context.term()
kill_process_tree(process.pid)
def test_kv_events_attn_dp(self):
@@ -175,7 +178,7 @@ class TestKvEvents(CustomTestCase):
# Launch sglang server with DP attention enabled
process = popen_launch_server(
"silence09/DeepSeek-R1-Small-2layers",
DEFAULT_MLA_MODEL_NAME_FOR_TEST,
DEFAULT_URL_FOR_TEST,
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=[