-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[Core] Restructure core loop for async input preparation #23391
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 2 commits
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 |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
|
|
||
| from concurrent.futures import Future | ||
| from typing import Callable, Optional, Union | ||
| from typing import Callable, Optional | ||
|
|
||
| import torch | ||
| import torch.distributed as dist | ||
|
|
@@ -80,12 +79,14 @@ def get_kv_cache_specs(self) -> list[dict[str, KVCacheSpec]]: | |
| output = self.collective_rpc("get_kv_cache_spec") | ||
| return output | ||
|
|
||
| def execute_model( | ||
| self, | ||
| scheduler_output, | ||
| ) -> Union[ModelRunnerOutput, Future[ModelRunnerOutput]]: | ||
| output = self.collective_rpc("execute_model", | ||
| args=(scheduler_output, )) | ||
| def prepare_inputs(self, scheduler_output) -> None: | ||
| self.collective_rpc("prepare_inputs", args=(scheduler_output, )) | ||
|
|
||
| def execute_model(self) -> None: | ||
| self.collective_rpc("execute_model") | ||
|
|
||
| def sample(self, grammar_bitmask) -> ModelRunnerOutput: | ||
| output = self.collective_rpc("sample", args=(grammar_bitmask, )) | ||
| return output[0] | ||
|
Contributor
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. The |
||
|
|
||
| def take_draft_token_ids(self) -> Optional[DraftTokenIds]: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call to
execute_model_with_error_logginghas been removed in this refactoring of thestepmethod, and it's also missing from the newstep_asyncmethod. This is a potential regression as model execution errors will no longer be caught and logged with detailed context, which can make debugging difficult. It's recommended to reintroduce the error handling in both methods. Forstep, you could wrap the new multi-step execution logic in a helper function and pass it toexecute_model_with_error_logging.