[Bugfix] Give exact-shape codec models an unpadded input_ids view (#6775)

Signed-off-by: Inesh Reddy <ineshreddy249@gmail.com>
Signed-off-by: IneshReddy249 <ineshreddy249@gmail.com>
Co-authored-by: Gao Han <hgaoaf@connect.ust.hk>
This commit is contained in:
Inesh Reddy ChappidiandGao Han authored and GitHub committed 2026-09-04 15:28:49 -07:00
1 parent 348fd0fc07
commit 66d938100b
8 files changed
+147 -2

No files matched your search

+11
View File
@@ -1,3 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
from __future__ import annotations
from typing import Any
@@ -11,3 +14,11 @@ class OmniWorkerMixin:
from vllm_omni.plugins import load_omni_general_plugins
load_omni_general_plugins()
def maybe_unpad_input_ids(model, input_ids, num_tokens_unpadded):
"""Trim cudagraph-bucket padding for models that split a flat ``input_ids``
by per-request ``seq_token_counts``. See #6712."""
if input_ids is not None and getattr(model, "requires_exact_input_shape", False):
return input_ids[:num_tokens_unpadded]
return input_ids