diff --git a/python/sglang/srt/mem_cache/hiradix_cache.py b/python/sglang/srt/mem_cache/hiradix_cache.py index 1fb6b9a7d..36e1eb721 100644 --- a/python/sglang/srt/mem_cache/hiradix_cache.py +++ b/python/sglang/srt/mem_cache/hiradix_cache.py @@ -5619,6 +5619,14 @@ class HiRadixCache(RadixCache): allocator = getattr(self.cache_controller, "cp_shared_l2_page_allocator", None) if allocator is None: return + if not getattr(self, "_placement_assert_warned", False): + self._placement_assert_warned = True + logger.warning( + "[CP-HiCache] SGLANG_CP_HICACHE_PLACEMENT_ASSERT is ON: every scheduler tick MIN/MAX-reduces " + "placement_digest across the CP group (2 blocking gloo collectives on the scheduler thread " + "BEFORE forward) + a SHA256 over the whole free-list. This is a DEBUG/bring-up invariant check " + "-- turn it OFF in production (unset the env) for the per-tick critical-path cost to vanish." + ) local = int(allocator.placement_digest(), 16) % (1 << 61) lo = torch.tensor(local, dtype=torch.int64, device="cpu") hi = torch.tensor(local, dtype=torch.int64, device="cpu")