[Minor] Improve the style and fix flaky tests (#1584)

This commit is contained in:
Lianmin Zheng
2024-10-06 00:10:48 -07:00
committed by GitHub
parent 2422de5193
commit 9244f27f0a
7 changed files with 15 additions and 7 deletions
+3 -1
View File
@@ -747,7 +747,9 @@ class ScheduleBatch:
return
self.reqs = [self.reqs[i] for i in unfinished_indices]
new_indices = torch.tensor(unfinished_indices, dtype=torch.int32, device="cuda")
new_indices = torch.tensor(
unfinished_indices, dtype=torch.int32, device=self.seq_lens.device
)
self.req_pool_indices = self.req_pool_indices[new_indices]
self.seq_lens = self.seq_lens[new_indices]
self.out_cache_loc = None
@@ -218,6 +218,7 @@ class PrefillAdder:
if not insert_sort:
self.req_states.append((tokens_left, tokens_occupied))
else:
i = 0
for i in range(len(self.req_states)):
if tokens_left <= self.req_states[i][0]:
break
+2 -2
View File
@@ -144,7 +144,7 @@ class Scheduler:
)
self.tp_cpu_group = self.tp_worker.model_runner.tp_group.cpu_group
# Get token and memory info from the tp worker
# Get token and memory info from the model worker
(
self.max_total_num_tokens,
self.max_prefill_tokens,
@@ -976,7 +976,7 @@ def run_scheduler_process(
port_args: PortArgs,
gpu_id: int,
tp_rank: int,
pipe_writer: multiprocessing.connection.Connection,
pipe_writer,
):
configure_logger(server_args, prefix=f" TP{tp_rank}")
suppress_other_loggers()