Fix memory leak in prefill delayer (#16358)

This commit is contained in:
fzyzcjy
2026-01-04 10:11:18 +08:00
committed by GitHub
parent 9bd64d739b
commit 5d4b7c78bf
2 changed files with 7 additions and 11 deletions
+4 -4
View File
@@ -1929,10 +1929,10 @@ class Scheduler(
if self.prefill_delayer
else True
)
if (not delayer_allow_prefill) or (
(self.running_batch.batch_is_full or len(self.waiting_queue) == 0)
and self.chunked_req is None
):
if (
(not delayer_allow_prefill)
or ((self.running_batch.batch_is_full or len(self.waiting_queue) == 0))
) and self.chunked_req is None:
return None
running_bs = len(self.running_batch.reqs)
+3 -7
View File
@@ -27,19 +27,14 @@ class TestPrefillDelayerThroughput(CustomTestCase):
"--dp",
"8",
"--chunked-prefill-size",
"262144",
"131072",
"--mem-fraction-static",
"0.6",
]
# TODO further fix mem leak
with envs.SGLANG_SCHEDULER_DECREASE_PREFILL_IDLE.override(
with_prefill_delayer
), envs.SGLANG_PREFILL_DELAYER_MAX_DELAY_PASSES.override(
100
), envs.SGLANG_ENABLE_STRICT_MEM_CHECK_DURING_IDLE.override(
False
):
), envs.SGLANG_PREFILL_DELAYER_MAX_DELAY_PASSES.override(100):
process = popen_launch_server(
model,
base_url,
@@ -52,6 +47,7 @@ class TestPrefillDelayerThroughput(CustomTestCase):
base_url=base_url,
dataset_name="random",
num_prompts=500,
# trigger chunked prefill
random_input_len=30000,
random_output_len=256,
request_rate=32,