diff --git a/python/sglang/srt/mem_cache/dsv41_request_window.py b/python/sglang/srt/mem_cache/dsv41_request_window.py index a5a99358d7..8c203ff1da 100644 --- a/python/sglang/srt/mem_cache/dsv41_request_window.py +++ b/python/sglang/srt/mem_cache/dsv41_request_window.py @@ -234,7 +234,8 @@ class RequestWindow: loc = slots.to(torch.int64)[:, None] * self.capacity + torch.arange( self.capacity, device=slots.device ) - self.tags[:, loc.flatten()] = -1 + # index_fill_ stays on the device; a scalar index_put waits for the stream. + self.tags.index_fill_(1, loc.flatten(), -1) self.prepared = None def activate(self, layout):