From b44496389c4487488b1fe6694ea83b3faaeeecb2 Mon Sep 17 00:00:00 2001 From: Zhiqiang Xie Date: Thu, 3 Sep 2026 16:08:50 -0700 Subject: [PATCH] [HiCache] Count hit allocations and in-flight backups in the buffer pipeline idle check (#37883) --- python/sglang/srt/mem_cache/buffer_mode/pipeline.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/sglang/srt/mem_cache/buffer_mode/pipeline.py b/python/sglang/srt/mem_cache/buffer_mode/pipeline.py index 6de4d0cd2..cd440c099 100644 --- a/python/sglang/srt/mem_cache/buffer_mode/pipeline.py +++ b/python/sglang/srt/mem_cache/buffer_mode/pipeline.py @@ -275,13 +275,15 @@ class BufferModePipeline: self._anchor_lock_cap_skips = 0 def is_idle(self) -> bool: - """No queued or in-flight operation holds host staging or can restart I/O.""" + """No pending or in-flight buffer-mode transfer work.""" return not ( - self.pending_write_queue + self.pending_hit_allocs or self.staged_prefetches + or self.ongoing_buffer_load_back + or self.pending_write_queue + or self.inflight_backup_node_ids or self.ongoing_write_through or self.ongoing_backup - or self.ongoing_buffer_load_back ) # ---- backup pipeline (device -> staging -> storage) ----