[WIP][Bugfix][MiniCPM-o] Fix Full duplex bugs for minicpm-challenge (#5496)

Signed-off-by: Sy03 <1370724210@qq.com>
This commit is contained in:
Sy03 authored and GitHub committed 2026-07-28 15:59:26 +08:00
1 parent fb89ab43ea
commit ffa9a6af69
60 files changed
+3696 -634

No files matched your search

+11 -3
View File
@@ -731,9 +731,17 @@ class OmniARScheduler(OmniSchedulerMixin, VLLMScheduler):
if self.log_stats:
session.record_event(EngineCoreEventType.QUEUED)
return
update_info = getattr(update, "additional_information", None)
update_meta = update_info.get("meta") if isinstance(update_info, dict) else None
if isinstance(update_meta, dict) and update_meta.get("replace_streaming_prompt") is True:
update_infos = (
getattr(update, "model_intermediate_buffer", None),
getattr(update, "additional_information", None),
)
replace_streaming_prompt = any(
isinstance(info, dict)
and isinstance(info.get("meta"), dict)
and info["meta"].get("replace_streaming_prompt") is True
for info in update_infos
)
if replace_streaming_prompt:
self._replace_streaming_session(session, update)
return
super()._update_request_as_session(session, update)
@@ -54,6 +54,21 @@ class OmniGenerationScheduler(OmniSchedulerMixin, VLLMScheduler):
)
self._latest_omni_connector_output: OmniConnectorOutput | None = None
def _handle_stopped_request(self, request: Request) -> bool:
if (
request.resumable
and not request.streaming_queue
and self.chunk_transfer_adapter is not None
and self.chunk_transfer_adapter.receives_chunks
):
# Downstream async-chunk stages receive the next segment from the
# connector, not from an API StreamingUpdate. Enqueue them as
# schedulable before the base class can park them in skipped_waiting.
request.status = RequestStatus.WAITING
self._enqueue_waiting_request(request)
return False
return super()._handle_stopped_request(request)
def schedule(self, throttle_prefills: bool = False) -> SchedulerOutput:
"""One-shot generation fast path:
- Feed all input tokens of the request at once
@@ -63,6 +63,11 @@ class OmniSchedulerMixin:
session.num_computed_tokens = 0
session.prompt_token_ids = new_prompt
session.additional_information = update.additional_information or None
session.model_intermediate_buffer = getattr(
update,
"model_intermediate_buffer",
None,
)
session.update_block_hashes()
session.num_prompt_tokens = len(new_prompt)
session.arrival_time = update.arrival_time