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 12, 02:15 UTC
[ROCm][CI] Fix v1/logits_processors failure on ROCm (#29927)
Signed-off-by: Micah Williamson <micah.williamson@amd.com>
Micah Williamson committed
Dec 3, 2025 at 11:17 UTC
d1f7392c5f774245d0a0776d141a64e72ca3e8ca
3 files changed
+3
-16
tests/v1/logits_processors/test_custom_offline.py
-5
@@ -1,7 +1,6 @@
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
import random
4
-import sys
4
from typing import Any
5
6
import pytest
@@ -10,7 +9,6 @@ from tests.utils import create_new_process_for_each_test
9
from tests.v1.logits_processors.utils import (
10
DUMMY_LOGITPROC_ARG,
11
DUMMY_LOGITPROC_FQCN,
13
- DUMMY_LOGITPROC_MODULE,
12
MAX_TOKENS,
13
MODEL_NAME,
14
POOLING_MODEL_NAME,
@@ -18,7 +16,6 @@ from tests.v1.logits_processors.utils import (
16
CustomLogitprocSource,
17
DummyLogitsProcessor,
18
WrappedPerReqLogitsProcessor,
21
- dummy_module,
19
prompts,
20
)
21
from tests.v1.logits_processors.utils import entry_points as fake_entry_points
@@ -162,8 +159,6 @@ def test_custom_logitsprocs(monkeypatch, logitproc_source: CustomLogitprocSource
159
kwargs: dict[str, list[str | type[LogitsProcessor]]] = {}
160
if logitproc_source == CustomLogitprocSource.LOGITPROC_SOURCE_FQCN:
161
# Scenario: load logitproc based on fully-qualified class name (FQCN)
165
- # Inject dummy module which defines logitproc
166
- sys.modules[DUMMY_LOGITPROC_MODULE] = dummy_module
162
kwargs["logits_processors"] = [DUMMY_LOGITPROC_FQCN]
163
elif logitproc_source == CustomLogitprocSource.LOGITPROC_SOURCE_CLASS:
164
# Scenario: load logitproc from provided class object
tests/v1/logits_processors/test_custom_online.py
+2
-10
@@ -14,11 +14,9 @@ from tests.utils import RemoteOpenAIServerCustom, create_new_process_for_each_te
14
from tests.v1.logits_processors.utils import (
15
DUMMY_LOGITPROC_ARG,
16
DUMMY_LOGITPROC_FQCN,
17
- DUMMY_LOGITPROC_MODULE,
17
MAX_TOKENS,
18
MODEL_NAME,
19
TEMP_GREEDY,
21
- dummy_module,
20
prompts,
21
)
22
from tests.v1.logits_processors.utils import entry_points as fake_entry_points
@@ -47,20 +45,14 @@ def _server_with_logitproc_entrypoint(
45
main.main()
46
47
50
-def _server_with_logitproc_module(
48
+def _server_with_logitproc_fqcn(
49
env_dict: dict[str, str] | None,
50
model: str,
51
vllm_serve_args: list[str],
52
) -> None:
53
"""Start vLLM server, inject module with dummy logitproc"""
56
-
57
- # Patch `modules` to inject dummy logitproc module
54
from vllm.entrypoints.cli import main
55
60
- sys.modules[DUMMY_LOGITPROC_MODULE] = dummy_module
61
-
62
- # fork is required for workers to see entrypoint patch
63
- os.environ["VLLM_WORKER_MULTIPROC_METHOD"] = "fork"
56
if env_dict is not None:
57
os.environ.update(env_dict)
58
@@ -99,7 +91,7 @@ def server(default_server_args, request, monkeypatch):
91
if request.param:
92
# Launch server, append FQCN argument, inject dummy logitproc module
93
args = default_server_args + request.param
102
- _server_fxn = _server_with_logitproc_module
94
+ _server_fxn = _server_with_logitproc_fqcn
95
else:
96
# Launch server, inject dummy logitproc entrypoint
97
args = default_server_args
tests/v1/logits_processors/utils.py
+1
-1
@@ -27,7 +27,7 @@ DUMMY_LOGITPROC_ARG = "target_token"
27
TEMP_GREEDY = 0.0
28
MAX_TOKENS = 20
29
DUMMY_LOGITPROC_ENTRYPOINT = "dummy_logitproc"
30
-DUMMY_LOGITPROC_MODULE = "DummyModule"
30
+DUMMY_LOGITPROC_MODULE = "tests.v1.logits_processors.utils"
31
DUMMY_LOGITPROC_FQCN = f"{DUMMY_LOGITPROC_MODULE}:DummyLogitsProcessor"
32
33