A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 09:45 UTC
[Bugfix] Add kwargs to RequestOutput __init__ to be forward compatible (#18513)
Signed-off-by: Linkun <github@lkchen.net>
lkchen committed
May 22, 2025 at 05:24 UTC
a35a494745727179bee77980e31709f101b0bf58
3 files changed
+24
.buildkite/test-pipeline.yaml
+1
@@ -59,6 +59,7 @@ steps:
59
- pytest -v -s async_engine # AsyncLLMEngine
60
- NUM_SCHEDULER_STEPS=4 pytest -v -s async_engine/test_async_llm_engine.py
61
- pytest -v -s test_inputs.py
62
+ - pytest -v -s test_outputs.py
63
- pytest -v -s multimodal
64
- pytest -v -s test_utils.py # Utils
65
- pytest -v -s worker # Worker
tests/test_outputs.py
new
+14
@@ -0,0 +1,14 @@
1
+# SPDX-License-Identifier: Apache-2.0
2
+
3
+from vllm.outputs import RequestOutput
4
+
5
+
6
+def test_request_output_forward_compatible():
7
+ output = RequestOutput(request_id="test_request_id",
8
+ prompt="test prompt",
9
+ prompt_token_ids=[1, 2, 3],
10
+ prompt_logprobs=None,
11
+ outputs=[],
12
+ finished=False,
13
+ example_arg_added_in_new_version="some_value")
14
+ assert output is not None
vllm/outputs.py
+9
@@ -9,12 +9,15 @@ from typing import Any, Generic, Optional, Union
9
import torch
10
from typing_extensions import TypeVar, deprecated
11
12
+from vllm.logger import init_logger
13
from vllm.lora.request import LoRARequest
14
from vllm.multimodal.inputs import MultiModalPlaceholderDict
15
from vllm.sampling_params import RequestOutputKind
16
from vllm.sequence import (PromptLogprobs, RequestMetrics, SampleLogprobs,
17
SequenceGroup, SequenceGroupBase, SequenceStatus)
18
19
+logger = init_logger(__name__)
20
+
21
22
@dataclass
23
class CompletionOutput:
@@ -122,7 +125,13 @@ class RequestOutput:
125
*,
126
multi_modal_placeholders: Optional[MultiModalPlaceholderDict] = None,
127
kv_transfer_params: Optional[dict[str, Any]] = None,
128
+ # Forward compatibility, code that uses args added in new release can
129
+ # still run with older versions of vLLM without breaking.
130
+ **kwargs: Any,
131
) -> None:
132
+ if kwargs:
133
+ logger.warning_once("RequestOutput: Ignoring extra arguments: %s",
134
+ str(kwargs))
135
self.request_id = request_id
136
self.prompt = prompt
137
self.prompt_token_ids = prompt_token_ids