-
Notifications
You must be signed in to change notification settings - Fork 8
[Draft] kv aware schedule #134
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
base: v0.11.0
Are you sure you want to change the base?
Changes from all 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 |
|---|---|---|
|
|
@@ -98,6 +98,7 @@ | |
| top_p: Optional[float] = None, | ||
| n: Optional[int] = None, | ||
| temperature: Optional[float] = None, | ||
| mm_hashes=None, | ||
|
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. |
||
| ): | ||
| self.request_id = request_id | ||
| self.parent_req = parent_req | ||
|
|
@@ -118,6 +119,7 @@ | |
| self.is_prefilling = True | ||
| self.queue = queue | ||
| self.num_cached_tokens = 0 | ||
| self.mm_hashes = mm_hashes | ||
|
|
||
| self.stats = RequestStateStats( | ||
| arrival_time=arrival_time) if log_stats else None | ||
|
|
@@ -132,6 +134,7 @@ | |
| request_index: int, | ||
| queue: Optional[RequestOutputCollector], | ||
| log_stats: bool, | ||
| mm_hashes: list[str], | ||
| ) -> "RequestState": | ||
|
|
||
| if sampling_params := request.sampling_params: | ||
|
|
@@ -179,6 +182,7 @@ | |
| arrival_time=request.arrival_time, | ||
| queue=queue, | ||
| log_stats=log_stats, | ||
| mm_hashes=mm_hashes, | ||
| ) | ||
|
|
||
| def make_request_output( | ||
|
|
@@ -257,6 +261,7 @@ | |
| finished=finished, | ||
| kv_transfer_params=kv_transfer_params, | ||
| num_cached_tokens=self.num_cached_tokens, | ||
| mm_hashes=self.mm_hashes, | ||
| ) | ||
|
|
||
| def _new_completion_output( | ||
|
|
@@ -365,13 +370,15 @@ | |
| if request_id in self.request_states: | ||
| raise ValueError(f"Request id {request_id} already running.") | ||
|
|
||
| mm_hashes = [f.identifier for f in request.mm_features] | ||
|
Check failure on line 373 in vllm/v1/engine/output_processor.py
|
||
| req_state = RequestState.from_new_request(tokenizer=self.tokenizer, | ||
| request=request, | ||
| prompt=prompt, | ||
| parent_req=parent_req, | ||
| request_index=request_index, | ||
| queue=queue, | ||
| log_stats=self.log_stats) | ||
| log_stats=self.log_stats, | ||
| mm_hashes=mm_hashes) | ||
| self.request_states[request_id] = req_state | ||
| self.lora_states.add_request(req_state) | ||
| if parent_req: | ||
|
|
||
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.
There appears to be a bug in the calculation of
end_token_idx. It should benum_full_blocks * block_sizeto correctly represent the end token index of the full blocks. The current calculationnum_full_blocks + block_sizemixes block count with block size, which will lead to an incorrect token range and cause multi-modal features to be associated with the wrong blocks.