Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hnyls2002 committed Jul 29, 2024
1 parent 7885e6d commit 9c1be6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions python/sglang/srt/managers/controller/tp_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,10 @@ def cache_filled_batch(self, batch: Batch):
)
req.prefix_indices, req.last_node = new_prefix_indices, new_last_node

if req is self.current_inflight_req:
# inflight request would get a new req idx
self.req_to_token_pool.free(int(req_pool_indices_cpu[i]))

def forward_decode_batch(self, batch: Batch):
# Check if decode out of memory
if not batch.check_decode_mem():
Expand Down
2 changes: 1 addition & 1 deletion python/sglang/srt/memory_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def alloc(self, need_size: int):

return select_index

def free(self, free_index: int):
def free(self, free_index):
self.mem_state[free_index] = True
if isinstance(free_index, (int,)):
self.can_use_mem_size += 1
Expand Down

0 comments on commit 9c1be6a

Please sign in to comment.