Skip to content

Commit 7bb9967

Browse files
committed
fix req queue init error.
1 parent 4486665 commit 7bb9967

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

lightllm/server/router/batch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99

1010
class Batch:
11-
def __init__(self, batch_id, reqs: List[Req], dp_size: int):
11+
def __init__(self, batch_id, reqs: List[Req], dp_size_in_node: int):
1212
self.batch_id = batch_id
1313
self.reqs = reqs
1414
self.id_to_reqs = {req.request_id: req for req in reqs}
15-
self.dp_size = dp_size
15+
self.dp_size_in_node = dp_size_in_node
1616
return
1717

1818
def input_tokens(self):
@@ -22,7 +22,7 @@ def input_tokens(self):
2222
return batch_input_tokens
2323

2424
def get_batch_decode_need_tokens(self):
25-
new_batch_decode_need_tokens = [0 for _ in range(self.dp_size)] # for chunked prefill
25+
new_batch_decode_need_tokens = [0 for _ in range(self.dp_size_in_node)] # for chunked prefill
2626

2727
for req in self.reqs:
2828
req_dp_index = req.sample_params.suggested_dp_index

lightllm/server/router/req_queue/chunked_prefill/impl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66

77
class ChunkedPrefillQueue(BaseQueue):
8-
def __init__(self, args, router, dp_index, dp_size) -> None:
9-
super().__init__(args, router, dp_index, dp_size)
8+
def __init__(self, args, router, dp_index, dp_size_in_node) -> None:
9+
super().__init__(args, router, dp_index, dp_size_in_node)
1010

1111
def _init_cache_list(self, current_batch: Batch, is_busy):
1212
if current_batch is not None:
@@ -99,7 +99,7 @@ def generate_new_batch(self, current_batch: Batch, limit_router_queue_length: in
9999
break
100100

101101
if len(can_run_list) != 0:
102-
new_batch = Batch(uuid.uuid4().int, can_run_list, dp_size=self.dp_size)
102+
new_batch = Batch(uuid.uuid4().int, can_run_list, dp_size_in_node=self.dp_size_in_node)
103103
for req in abort_req_list:
104104
self.router.shm_req_manager.put_back_req_obj(req)
105105
self.waiting_req_list = self.waiting_req_list[len(can_run_list) + aborted_count :]

lightllm/server/router/req_queue/continues_batch/beam_impl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66

77
class BeamContinuesBatchQueue(BaseQueue):
8-
def __init__(self, args, router, dp_index, dp_size) -> None:
9-
super().__init__(args, router, dp_index, dp_size)
8+
def __init__(self, args, router, dp_index, dp_size_in_node) -> None:
9+
super().__init__(args, router, dp_index, dp_size_in_node)
1010
return
1111

1212
def _init_cache_list(self, current_batch: Batch, is_busy):
@@ -129,7 +129,7 @@ def generate_new_batch(self, current_batch: Batch, limit_router_queue_length: in
129129
req.is_paused = False
130130

131131
if len(can_run_list) != 0:
132-
new_batch = Batch(uuid.uuid4().int, can_run_list, dp_size=self.dp_size)
132+
new_batch = Batch(uuid.uuid4().int, can_run_list, dp_size_in_node=self.dp_size_in_node)
133133
for req in abort_req_list:
134134
self.router.shm_req_manager.put_back_req_obj(req)
135135

lightllm/server/router/req_queue/continues_batch/impl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77

88
class ContinuesBatchQueue(BaseQueue):
9-
def __init__(self, args, router, dp_index, dp_size) -> None:
10-
super().__init__(args, router, dp_index, dp_size)
9+
def __init__(self, args, router, dp_index, dp_size_in_node) -> None:
10+
super().__init__(args, router, dp_index, dp_size_in_node)
1111

1212
def _init_cache_list(self, current_batch: Batch, is_busy):
1313
if current_batch is not None:
@@ -100,7 +100,7 @@ def generate_new_batch(self, current_batch: Batch, limit_router_queue_length: in
100100
else:
101101
break
102102
if len(can_run_list) != 0:
103-
new_batch = Batch(uuid.uuid4().int, can_run_list, dp_size=self.dp_size)
103+
new_batch = Batch(uuid.uuid4().int, can_run_list, dp_size_in_node=self.dp_size_in_node)
104104
for req in abort_req_list:
105105
self.router.shm_req_manager.put_back_req_obj(req)
106106
self.waiting_req_list = self.waiting_req_list[len(can_run_list) + aborted_count :]

lightllm/server/router/req_queue/continues_batch/pd_decode_impl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010

1111
class ContinuesBatchQueueForPDDecode(BaseQueue):
12-
def __init__(self, args, router, dp_index, dp_size) -> None:
13-
super().__init__(args, router, dp_index, dp_size)
12+
def __init__(self, args, router, dp_index, dp_size_in_node) -> None:
13+
super().__init__(args, router, dp_index, dp_size_in_node)
1414

1515
def _init_cache_list(self, current_batch: Batch, is_busy):
1616
if current_batch is not None:
@@ -47,7 +47,7 @@ def generate_new_batch(self, current_batch: Batch, limit_router_queue_length: in
4747
break
4848

4949
if len(can_run_list) != 0:
50-
new_batch = Batch(uuid.uuid4().int, can_run_list, dp_size=self.dp_size)
50+
new_batch = Batch(uuid.uuid4().int, can_run_list, dp_size_in_node=self.dp_size_in_node)
5151
for req in abort_req_list:
5252
self.router.shm_req_manager.put_back_req_obj(req)
5353
self.waiting_req_list = self.waiting_req_list[len(can_run_list) + aborted_count :]

0 commit comments

Comments
 (0)