[Bugfix] Fix LOGITPROC_SOURCE_ENTRYPOINT test to use spawn-compatible dist-info registration for XPU/ROCm (#42040)
Signed-off-by: dqzhengAP <dqzheng1996@gmail.com> Signed-off-by: David Zheng <153074367+dzhengAP@users.noreply.github.com> Signed-off-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
This commit is contained in:
co-authored by
gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Andreas Karatzas
Kunshang Ji
parent
97cc7685c4
commit
df2636a9d8
@@ -18,8 +18,8 @@ from tests.v1.logits_processors.utils import (
|
||||
MODEL_NAME,
|
||||
TEMP_GREEDY,
|
||||
prompts,
|
||||
setup_fake_entrypoint,
|
||||
)
|
||||
from tests.v1.logits_processors.utils import entry_points as fake_entry_points
|
||||
|
||||
|
||||
def _server_with_logitproc_entrypoint(
|
||||
@@ -27,16 +27,9 @@ def _server_with_logitproc_entrypoint(
|
||||
model: str,
|
||||
vllm_serve_args: list[str],
|
||||
) -> None:
|
||||
"""Start vLLM server, inject dummy logitproc entrypoint"""
|
||||
|
||||
# Patch `entry_points` to inject logitproc entrypoint
|
||||
import importlib.metadata
|
||||
|
||||
importlib.metadata.entry_points = fake_entry_points # type: ignore
|
||||
"""Start vLLM server with dummy logitproc entrypoint."""
|
||||
from vllm.entrypoints.cli import main
|
||||
|
||||
# fork is required for workers to see entrypoint patch
|
||||
os.environ["VLLM_WORKER_MULTIPROC_METHOD"] = "fork"
|
||||
if env_dict is not None:
|
||||
os.environ.update(env_dict)
|
||||
|
||||
@@ -50,7 +43,7 @@ def _server_with_logitproc_fqcn(
|
||||
model: str,
|
||||
vllm_serve_args: list[str],
|
||||
) -> None:
|
||||
"""Start vLLM server, inject module with dummy logitproc"""
|
||||
"""Start vLLM server with dummy logitproc specified by FQCN."""
|
||||
from vllm.entrypoints.cli import main
|
||||
|
||||
if env_dict is not None:
|
||||
@@ -80,8 +73,8 @@ def default_server_args():
|
||||
def server(default_server_args, request, monkeypatch):
|
||||
"""Consider two server configurations:
|
||||
(1) --logits-processors cli arg specifies dummy logits processor via fully-
|
||||
qualified class name (FQCN); patch in a dummy logits processor module
|
||||
(2) No --logits-processors cli arg; patch in a dummy logits processor
|
||||
qualified class name (FQCN)
|
||||
(2) No --logits-processors cli arg; inject a dummy logits processor
|
||||
entrypoint
|
||||
"""
|
||||
|
||||
@@ -94,6 +87,7 @@ def server(default_server_args, request, monkeypatch):
|
||||
_server_fxn = _server_with_logitproc_fqcn
|
||||
else:
|
||||
# Launch server, inject dummy logitproc entrypoint
|
||||
setup_fake_entrypoint(monkeypatch)
|
||||
args = default_server_args
|
||||
_server_fxn = _server_with_logitproc_entrypoint
|
||||
|
||||
@@ -119,7 +113,6 @@ api_keyword_args = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"model_name",
|
||||
[MODEL_NAME],
|
||||
|
||||
Reference in New Issue
Block a user