1 parent
bf69cd94bb
commit
9070f15f52
4 files changed
+19
-6
No files matched your search
@@ -111,6 +111,8 @@ class OmniGenerationScheduler(VLLMScheduler):
|
||||
req_to_new_blocks[request.request_id] = new_blocks
|
||||
num_scheduled_tokens[request.request_id] = num_new_tokens
|
||||
cached_prompt_token_ids[request.request_id] = request.prompt_token_ids
|
||||
if request.num_cached_tokens < 0:
|
||||
request.num_cached_tokens = num_computed_tokens
|
||||
token_budget -= num_new_tokens
|
||||
scheduled_running_reqs.append(request)
|
||||
req_index += 1
|
||||
@@ -177,6 +179,8 @@ class OmniGenerationScheduler(VLLMScheduler):
|
||||
|
||||
req_to_new_blocks[request.request_id] = new_blocks
|
||||
num_scheduled_tokens[request.request_id] = num_new_tokens
|
||||
if request.num_cached_tokens < 0:
|
||||
request.num_cached_tokens = 0
|
||||
token_budget -= num_new_tokens
|
||||
scheduled_new_reqs.append(request)
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class SharedMemoryConnector(OmniConnectorBase):
|
||||
payload = self.serialize_obj(data)
|
||||
size = len(payload)
|
||||
|
||||
if size > self.threshold:
|
||||
if True:
|
||||
# Use Shared Memory
|
||||
lock_file = f"/dev/shm/shm_{put_key}_lockfile.lock"
|
||||
with open(lock_file, "w") as lockf:
|
||||
|
||||
@@ -145,7 +145,7 @@ class OmniMsgpackEncoder:
|
||||
"encoder_prompt": obj.encoder_prompt,
|
||||
"encoder_prompt_token_ids": obj.encoder_prompt_token_ids,
|
||||
"num_cached_tokens": obj.num_cached_tokens,
|
||||
"multi_modal_placeholders": obj.multi_modal_placeholders,
|
||||
"multi_modal_placeholders": getattr(obj, "multi_modal_placeholders", None),
|
||||
"kv_transfer_params": obj.kv_transfer_params,
|
||||
}
|
||||
# Handle dynamically added multimodal_output attribute
|
||||
@@ -301,15 +301,22 @@ class OmniMsgpackDecoder:
|
||||
"""Decode dict to RequestOutput.
|
||||
|
||||
RequestOutput is not a dataclass, so msgspec.convert doesn't work.
|
||||
We construct it manually, passing all known fields via **kwargs.
|
||||
We construct it manually using only the known __init__ parameters to
|
||||
avoid triggering the "Ignoring extra arguments" warning in vllm.
|
||||
Fields that are not part of RequestOutput.__init__ (e.g.
|
||||
multi_modal_placeholders, multimodal_output) are extracted first and
|
||||
then restored as dynamic attributes after construction.
|
||||
"""
|
||||
# Extract multimodal_output before constructing (it's dynamically added)
|
||||
# Extract dynamically-added / non-init fields before constructing so
|
||||
# they are not passed as unknown **kwargs to RequestOutput.__init__.
|
||||
mm_output = obj.pop("multimodal_output", None)
|
||||
multi_modal_placeholders = obj.pop("multi_modal_placeholders", None)
|
||||
|
||||
# RequestOutput.__init__ accepts **kwargs for forward compatibility
|
||||
ro = RequestOutput(**obj)
|
||||
|
||||
# Restore dynamically added multimodal_output attribute
|
||||
# Restore dynamic attributes that are not part of __init__.
|
||||
if multi_modal_placeholders is not None:
|
||||
setattr(ro, "multi_modal_placeholders", multi_modal_placeholders)
|
||||
if mm_output is not None:
|
||||
setattr(ro, "multimodal_output", mm_output)
|
||||
return ro
|
||||
|
||||
@@ -143,6 +143,7 @@ class _LocalPredictorKVCache:
|
||||
cursor += 1
|
||||
|
||||
max_seq_len = int(seq_lens_i32[:num_reqs].max().item())
|
||||
max_query_len = int(query_lens_i32[:num_reqs].max().item())
|
||||
query_start_loc_gpu = qsl.to(device=self.device)
|
||||
seq_lens_gpu = seq_lens_i32.to(device=self.device)
|
||||
block_table = self._block_table[:num_reqs].contiguous()
|
||||
@@ -154,6 +155,7 @@ class _LocalPredictorKVCache:
|
||||
num_tokens=num_tokens,
|
||||
query_start_loc_gpu=query_start_loc_gpu,
|
||||
query_start_loc_cpu=qsl,
|
||||
max_query_len=max_query_len,
|
||||
seq_lens=seq_lens_gpu,
|
||||
max_seq_len=max_seq_len,
|
||||
block_tables=[block_table],
|
||||
|
||||
Reference in new issue
Block a user