-
Notifications
You must be signed in to change notification settings - Fork 742
[BugFix] Fix bugs in /v1/abort_requests interface from PR(#6992) #7176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4a8d3de
250eab6
e9d94e0
6d3ec7a
25561e6
f479ae7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1593,13 +1593,14 @@ def _control_abort_requests(self, control_req: ControlRequest): | |
| engine_recv_first_token_time=request.metrics.engine_recv_first_token_time if request.metrics else now, | ||
| request_start_time=request.metrics.arrival_time if request.metrics else now, | ||
| ) | ||
| eos_token_ids = getattr(request, "eos_token_ids", [0]) | ||
|
qwes5s5 marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Bug
建议修复: eos_token_ids = getattr(request, "eos_token_ids", None) or [0]或更明确地: eos_token_ids = request.eos_token_ids if request.eos_token_ids else [0] |
||
| result = RequestOutput( | ||
| request_id=req_id, | ||
| finished=True, | ||
| outputs=CompletionOutput( | ||
| index=0, | ||
| send_idx=len(partial_token_ids), | ||
| token_ids=[self.data_processor.eos_token_ids[0]], | ||
| token_ids=[eos_token_ids[0]], | ||
| ), | ||
| metrics=abort_metrics, | ||
| error_code=200, | ||
|
|
@@ -1643,10 +1644,19 @@ def _wait_abort_complete(self, target_req_ids, stall_timeout=1): | |
| reset progress state if any, then continue monitoring | ||
| """ | ||
| target_set = set(target_req_ids) | ||
| target_set = target_set & (set(self.resource_manager.requests.keys()) | set(self.scheduler.requests.keys())) | ||
| prev_remaining_count = len(target_set) | ||
| last_progress_time = time.time() | ||
| remaining = target_set & self.resource_manager.get_reqs_in_aborting() | ||
|
qwes5s5 marked this conversation as resolved.
|
||
| while remaining: | ||
| alive_reqs = set(self.resource_manager.requests.keys()) | set(self.scheduler.requests.keys()) | ||
| finished_reqs = target_set - alive_reqs | ||
| if finished_reqs: | ||
| self.llm_logger.info(f"abort targets already finished, skip: {finished_reqs}") | ||
| for req_id in finished_reqs: | ||
| self.resource_manager.waiting_abort_req_id_set.discard(req_id) | ||
| self.resource_manager.to_be_aborted_req_id_set.discard(req_id) | ||
| target_set -= finished_reqs | ||
| remaining = target_set & self.resource_manager.get_reqs_in_aborting() | ||
| if not remaining: | ||
| self.llm_logger.info(f"all {len(target_set)} abort reqs cleaned") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.