[Bugfix] MOSS-TTS: fix cross-request audio corruption under batching (#4415)

Signed-off-by: leo.yang <leo.yang.engineer@gmail.com>
Co-authored-by: Yueqian Lin <70319226+linyueqian@users.noreply.github.com>
This commit is contained in:
yangyonggitandYueqian Lin authored and GitHub committed 2026-06-18 18:11:51 +00:00
1 parent 8f28b969e9
commit 1228a109f0
3 files changed
+245 -24

No files matched your search

+14
View File
@@ -1313,6 +1313,20 @@ class OmniGPUModelRunner(GPUModelRunner):
traceback.print_exc()
# Per-request (start, end) hidden-row spans so make_omni_output can map
# flat hidden rows to the right request in mixed prefill+decode steps,
# instead of assuming an equal rows-per-request split (which samples the
# wrong rows whenever per-request token counts differ).
nstp = self._omni_num_scheduled_tokens_np
if nstp is not None and len(nstp) == len(self.input_batch.req_ids):
try:
model_kwargs_extra["request_token_spans"] = self._compute_request_token_spans(nstp)
except Exception as e:
# Visible on purpose: the fallback is the equal rows-per-request
# split, which can re-introduce the cross-request corruption this
# plumbing fixes — a silent failure here must not pass unnoticed.
logger.warning("[OMNI] Failed to compute request_token_spans: %s", e)
if self._omni_query_start_loc_model_kwarg:
try:
num_reqs = len(self.input_batch.req_ids)