From 2048047ad7af77f2173a8836ce038cf50884b06e Mon Sep 17 00:00:00 2001 From: Ivan Podkidyshev Date: Fri, 14 Aug 2026 16:27:45 +0200 Subject: [PATCH 1/2] allow custom models for vllm and sglang --- doc/workloads/sglang.rst | 24 ++++++++++++++ doc/workloads/vllm.rst | 24 ++++++++++++++ src/cloudai/workloads/common/llm_serving.py | 21 ++++++++++-- .../sglang/slurm_command_gen_strategy.py | 5 ++- .../vllm/slurm_command_gen_strategy.py | 5 ++- .../sglang/test_command_gen_strategy_slurm.py | 32 +++++++++++++++++++ tests/workloads/sglang/test_workload.py | 17 +++++++++- .../vllm/test_command_gen_strategy_slurm.py | 30 +++++++++++++++++ tests/workloads/vllm/test_workload.py | 22 +++++++++++++ 9 files changed, 175 insertions(+), 5 deletions(-) diff --git a/doc/workloads/sglang.rst b/doc/workloads/sglang.rst index 6d62f6ee9..759dd70a3 100644 --- a/doc/workloads/sglang.rst +++ b/doc/workloads/sglang.rst @@ -70,6 +70,30 @@ supported under ``[[Tests]]`` in a test scenario. Define them in a test definiti ``test_name`` when custom benchmark or semantic-evaluation arguments are needed. +Local Models +------------ +Set ``cmd_args.model_path`` to load an existing model directory instead of downloading ``cmd_args.model`` from +Hugging Face. The path must be absolute and visible inside the container. Use ``extra_container_mounts`` to mount a +host or shared-filesystem directory. ``model`` remains the name exposed by the server and used by benchmark clients. + +.. code-block:: toml + :caption: test.toml (local model) + + name = "sglang_local_model" + description = "SGLang with a local model" + test_template_name = "sglang" + extra_container_mounts = [ + "/lustre/models/custom:/models/custom:ro", + ] + + [cmd_args] + docker_image_url = "lmsysorg/sglang:dev-cu13" + model = "custom-model" + model_path = "/models/custom" + +The mounted directory must contain a model, configuration, and tokenizer supported by SGLang. + + Semantic Validation ------------------- To run GSM8K semantic validation after the serving benchmark, add ``semantic_eval_cmd_args``. CloudAI reports diff --git a/doc/workloads/vllm.rst b/doc/workloads/vllm.rst index 009270b32..074260821 100644 --- a/doc/workloads/vllm.rst +++ b/doc/workloads/vllm.rst @@ -70,6 +70,30 @@ supported under ``[[Tests]]`` in a test scenario. Define them in a test definiti ``test_name`` when custom benchmark or semantic-evaluation arguments are needed. +Local Models +------------ +Set ``cmd_args.model_path`` to load an existing model directory instead of downloading ``cmd_args.model`` from +Hugging Face. The path must be absolute and visible inside the container. Use ``extra_container_mounts`` to mount a +host or shared-filesystem directory. ``model`` remains the name exposed by the server and used by benchmark clients. + +.. code-block:: toml + :caption: test.toml (local model) + + name = "vllm_local_model" + description = "vLLM with a local model" + test_template_name = "vllm" + extra_container_mounts = [ + "/lustre/models/custom:/models/custom:ro", + ] + + [cmd_args] + docker_image_url = "vllm/vllm-openai:v0.14.0-cu130" + model = "custom-model" + model_path = "/models/custom" + +The mounted directory must contain a model, configuration, and tokenizer supported by vLLM. + + Semantic Validation ------------------- To run GSM8K semantic validation after the serving benchmark, add ``semantic_eval_cmd_args``. CloudAI reports diff --git a/src/cloudai/workloads/common/llm_serving.py b/src/cloudai/workloads/common/llm_serving.py index 09e98270a..9f9197d83 100644 --- a/src/cloudai/workloads/common/llm_serving.py +++ b/src/cloudai/workloads/common/llm_serving.py @@ -22,7 +22,7 @@ from pathlib import Path from typing import Any, ClassVar, Generic, TypeVar, cast -from pydantic import BaseModel, ConfigDict, Field, model_validator +from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator from rich.console import Console from rich.table import Table from typing_extensions import Self @@ -143,6 +143,13 @@ class LLMServingCmdArgs(CmdArgs, Generic[LLMServingArgsT]): docker_image_url: str model: str + model_path: str | None = Field( + default=None, + description=( + "Absolute, container-visible path to a local model. When set, the model is loaded from this path and " + "CloudAI does not download it from Hugging Face." + ), + ) port: int = Field(default=8300, ge=1, le=65535) host: str = Field(default="0.0.0.0", description="Host/interface for serve or router processes to bind to.") bench_host: str | None = Field( @@ -158,6 +165,13 @@ class LLMServingCmdArgs(CmdArgs, Generic[LLMServingArgsT]): prefill: LLMServingArgsT | None = Field(default=None) decode: LLMServingArgsT + @field_validator("model_path") + @classmethod + def validate_model_path(cls, model_path: str | None) -> str | None: + if model_path is not None and not Path(model_path).is_absolute(): + raise ValueError("model_path must be an absolute path inside the container.") + return model_path + @model_validator(mode="after") def validate_disaggregated_port(self) -> Self: if self.prefill is not None and self.port > 65335: @@ -190,7 +204,10 @@ def extra_installables(self) -> list[Installable]: @property def installables(self) -> list[Installable]: - return [*self.git_repos, self.docker_image, self.hf_model, *self.extra_installables] + installables: list[Installable] = [*self.git_repos, self.docker_image] + if self.cmd_args.model_path is None: + installables.append(self.hf_model) + return [*installables, *self.extra_installables] def model_post_init(self, __context: Any) -> None: super().model_post_init(__context) diff --git a/src/cloudai/workloads/sglang/slurm_command_gen_strategy.py b/src/cloudai/workloads/sglang/slurm_command_gen_strategy.py index f1e576ac5..8202c5cb3 100644 --- a/src/cloudai/workloads/sglang/slurm_command_gen_strategy.py +++ b/src/cloudai/workloads/sglang/slurm_command_gen_strategy.py @@ -43,7 +43,10 @@ def workload_name(self) -> str: def get_serve_commands(self) -> list[list[str]]: cmd_args = self.tdef.cmd_args - base_cmd = ["python3", "-m", cmd_args.serve_module, "--model-path", cmd_args.model] + model_source = cmd_args.model_path or cmd_args.model + base_cmd = ["python3", "-m", cmd_args.serve_module, "--model-path", model_source] + if cmd_args.model_path is not None: + base_cmd.extend(["--served-model-name", cmd_args.model]) if not cmd_args.prefill: return [ [ diff --git a/src/cloudai/workloads/vllm/slurm_command_gen_strategy.py b/src/cloudai/workloads/vllm/slurm_command_gen_strategy.py index cea0fd1b2..48989ad6c 100644 --- a/src/cloudai/workloads/vllm/slurm_command_gen_strategy.py +++ b/src/cloudai/workloads/vllm/slurm_command_gen_strategy.py @@ -105,7 +105,10 @@ def get_serve_commands(self) -> list[list[str]]: tdef: VllmTestDefinition = cast(VllmTestDefinition, self.test_run.test) cmd_args: VllmCmdArgs = tdef.cmd_args - base_cmd = ["vllm", "serve", cmd_args.model, "--host", self.bind_host] + model_source = cmd_args.model_path or cmd_args.model + base_cmd = ["vllm", "serve", model_source, "--host", self.bind_host] + if cmd_args.model_path is not None: + base_cmd.extend(["--served-model-name", cmd_args.model]) if not tdef.cmd_args.prefill: return [ self._with_ray_backend( diff --git a/tests/workloads/sglang/test_command_gen_strategy_slurm.py b/tests/workloads/sglang/test_command_gen_strategy_slurm.py index 3519e5ac2..5274313f9 100644 --- a/tests/workloads/sglang/test_command_gen_strategy_slurm.py +++ b/tests/workloads/sglang/test_command_gen_strategy_slurm.py @@ -71,6 +71,38 @@ def test_container_mounts(sglang_cmd_gen_strategy: SglangSlurmCommandGenStrategy ] +def test_local_model_path_is_used_for_loading_and_model_name_for_requests( + sglang: SglangTestDefinition, sglang_tr: TestRun, slurm_system: SlurmSystem +) -> None: + sglang.cmd_args.model = "custom-model" + sglang.cmd_args.model_path = "/models/custom-model" + sglang.extra_container_mounts = ["/lustre/custom-model:/models/custom-model:ro"] + strategy = SglangSlurmCommandGenStrategy(slurm_system, sglang_tr) + + serve_command = strategy.get_serve_commands()[0] + bench_command = strategy.get_bench_command() + + assert serve_command[:9] == [ + "python3", + "-m", + "sglang.launch_server", + "--model-path", + "/models/custom-model", + "--served-model-name", + "custom-model", + "--host", + "0.0.0.0", + ] + assert "--model custom-model" in bench_command + assert "/lustre/custom-model:/models/custom-model:ro" in strategy.container_mounts() + + sglang.cmd_args.prefill = SglangArgs() + disaggregated_commands = strategy.get_serve_commands() + assert len(disaggregated_commands) == 2 + assert all(command[4] == "/models/custom-model" for command in disaggregated_commands) + assert all("--served-model-name" in command for command in disaggregated_commands) + + class TestGpuDetection: def test_aggregated_gpu_ids_from_decode_config(self, sglang_tr: TestRun, slurm_system: SlurmSystem) -> None: tdef = cast(SglangTestDefinition, sglang_tr.test) diff --git a/tests/workloads/sglang/test_workload.py b/tests/workloads/sglang/test_workload.py index 23720c81e..feac84162 100644 --- a/tests/workloads/sglang/test_workload.py +++ b/tests/workloads/sglang/test_workload.py @@ -14,8 +14,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cloudai.workloads.sglang import SglangArgs +from cloudai.workloads.sglang import SglangArgs, SglangCmdArgs, SglangTestDefinition def test_sglang_serve_args_exclude_internal_fields() -> None: assert SglangArgs(gpu_ids="0", disaggregation_transfer_backend="nccl").serve_args == [] + + +def test_local_model_is_not_installed_from_hugging_face() -> None: + tdef = SglangTestDefinition( + name="test", + description="test", + test_template_name="sglang", + cmd_args=SglangCmdArgs( + docker_image_url="test_url", + model="custom-model", + model_path="/models/custom-model", + ), + ) + + assert tdef.installables == [tdef.docker_image] diff --git a/tests/workloads/vllm/test_command_gen_strategy_slurm.py b/tests/workloads/vllm/test_command_gen_strategy_slurm.py index bdff95eba..3d61b4ad9 100644 --- a/tests/workloads/vllm/test_command_gen_strategy_slurm.py +++ b/tests/workloads/vllm/test_command_gen_strategy_slurm.py @@ -248,6 +248,36 @@ def test_get_vllm_serve_commands_convert_boolean_flags( str(vllm.cmd_args.port), ] + def test_local_model_path_is_used_for_loading_and_model_name_for_requests( + self, vllm: VllmTestDefinition, vllm_tr: TestRun, slurm_system: SlurmSystem + ) -> None: + vllm.cmd_args.model = "custom-model" + vllm.cmd_args.model_path = "/models/custom-model" + vllm.extra_container_mounts = ["/lustre/custom-model:/models/custom-model:ro"] + strategy = VllmSlurmCommandGenStrategy(slurm_system, vllm_tr) + + serve_command = strategy.get_serve_commands()[0] + bench_command = strategy.get_bench_command() + + assert serve_command[:8] == [ + "vllm", + "serve", + "/models/custom-model", + "--host", + "0.0.0.0", + "--served-model-name", + "custom-model", + "--port", + ] + assert "--model custom-model" in bench_command + assert "/lustre/custom-model:/models/custom-model:ro" in strategy.container_mounts() + + vllm.cmd_args.prefill = VllmArgs() + disaggregated_commands = strategy.get_serve_commands() + assert len(disaggregated_commands) == 2 + assert all(command[2] == "/models/custom-model" for command in disaggregated_commands) + assert all("--served-model-name" in command for command in disaggregated_commands) + def test_generate_wait_for_health_function(self, vllm_cmd_gen_strategy: VllmSlurmCommandGenStrategy) -> None: cmd_args = vllm_cmd_gen_strategy.test_run.test.cmd_args diff --git a/tests/workloads/vllm/test_workload.py b/tests/workloads/vllm/test_workload.py index 6d123e56b..d5ab4a8ae 100644 --- a/tests/workloads/vllm/test_workload.py +++ b/tests/workloads/vllm/test_workload.py @@ -54,6 +54,28 @@ def test_installables_include_proxy_script_repo() -> None: assert tdef.installables == [tdef.docker_image, tdef.hf_model, proxy_script_repo] +def test_local_model_is_not_installed_from_hugging_face() -> None: + proxy_script_repo = GitRepo(url="./proxy_script_repo", commit="commit") + tdef = VllmTestDefinition( + name="test", + description="test", + test_template_name="vllm", + cmd_args=VllmCmdArgs( + docker_image_url="test_url", + model="custom-model", + model_path="/models/custom-model", + ), + proxy_script_repo=proxy_script_repo, + ) + + assert tdef.installables == [tdef.docker_image, proxy_script_repo] + + +def test_local_model_path_must_be_absolute() -> None: + with pytest.raises(ValueError, match="model_path must be an absolute path"): + VllmCmdArgs(docker_image_url="test_url", model_path="models/custom-model") + + def test_constraint_check_rejects_tp_pp_dp_above_available_gpus(tmp_path) -> None: tdef = VllmTestDefinition( name="test", From 7362f9bd50b06b25b2e30a6201362a54ae87f96e Mon Sep 17 00:00:00 2001 From: Ivan Podkidyshev Date: Fri, 14 Aug 2026 20:19:06 +0200 Subject: [PATCH 2/2] come up with simpler solution --- doc/workloads/sglang.rst | 8 ++--- doc/workloads/vllm.rst | 8 ++--- src/cloudai/workloads/common/llm_serving.py | 18 ++--------- .../sglang/slurm_command_gen_strategy.py | 5 +-- .../vllm/slurm_command_gen_strategy.py | 5 +-- .../sglang/test_command_gen_strategy_slurm.py | 32 ------------------- tests/workloads/sglang/test_workload.py | 3 +- .../vllm/test_command_gen_strategy_slurm.py | 30 ----------------- tests/workloads/vllm/test_workload.py | 8 +---- 9 files changed, 12 insertions(+), 105 deletions(-) diff --git a/doc/workloads/sglang.rst b/doc/workloads/sglang.rst index 759dd70a3..237537af4 100644 --- a/doc/workloads/sglang.rst +++ b/doc/workloads/sglang.rst @@ -72,9 +72,8 @@ supported under ``[[Tests]]`` in a test scenario. Define them in a test definiti Local Models ------------ -Set ``cmd_args.model_path`` to load an existing model directory instead of downloading ``cmd_args.model`` from -Hugging Face. The path must be absolute and visible inside the container. Use ``extra_container_mounts`` to mount a -host or shared-filesystem directory. ``model`` remains the name exposed by the server and used by benchmark clients. +Set ``cmd_args.model`` to an absolute, container-visible path to load an existing model directory instead of +downloading a model from Hugging Face. Use ``extra_container_mounts`` to mount a host or shared-filesystem directory. .. code-block:: toml :caption: test.toml (local model) @@ -88,8 +87,7 @@ host or shared-filesystem directory. ``model`` remains the name exposed by the s [cmd_args] docker_image_url = "lmsysorg/sglang:dev-cu13" - model = "custom-model" - model_path = "/models/custom" + model = "/models/custom" The mounted directory must contain a model, configuration, and tokenizer supported by SGLang. diff --git a/doc/workloads/vllm.rst b/doc/workloads/vllm.rst index 074260821..082faf70d 100644 --- a/doc/workloads/vllm.rst +++ b/doc/workloads/vllm.rst @@ -72,9 +72,8 @@ supported under ``[[Tests]]`` in a test scenario. Define them in a test definiti Local Models ------------ -Set ``cmd_args.model_path`` to load an existing model directory instead of downloading ``cmd_args.model`` from -Hugging Face. The path must be absolute and visible inside the container. Use ``extra_container_mounts`` to mount a -host or shared-filesystem directory. ``model`` remains the name exposed by the server and used by benchmark clients. +Set ``cmd_args.model`` to an absolute, container-visible path to load an existing model directory instead of +downloading a model from Hugging Face. Use ``extra_container_mounts`` to mount a host or shared-filesystem directory. .. code-block:: toml :caption: test.toml (local model) @@ -88,8 +87,7 @@ host or shared-filesystem directory. ``model`` remains the name exposed by the s [cmd_args] docker_image_url = "vllm/vllm-openai:v0.14.0-cu130" - model = "custom-model" - model_path = "/models/custom" + model = "/models/custom" The mounted directory must contain a model, configuration, and tokenizer supported by vLLM. diff --git a/src/cloudai/workloads/common/llm_serving.py b/src/cloudai/workloads/common/llm_serving.py index 9f9197d83..6b45ff854 100644 --- a/src/cloudai/workloads/common/llm_serving.py +++ b/src/cloudai/workloads/common/llm_serving.py @@ -22,7 +22,7 @@ from pathlib import Path from typing import Any, ClassVar, Generic, TypeVar, cast -from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator +from pydantic import BaseModel, ConfigDict, Field, model_validator from rich.console import Console from rich.table import Table from typing_extensions import Self @@ -143,13 +143,6 @@ class LLMServingCmdArgs(CmdArgs, Generic[LLMServingArgsT]): docker_image_url: str model: str - model_path: str | None = Field( - default=None, - description=( - "Absolute, container-visible path to a local model. When set, the model is loaded from this path and " - "CloudAI does not download it from Hugging Face." - ), - ) port: int = Field(default=8300, ge=1, le=65535) host: str = Field(default="0.0.0.0", description="Host/interface for serve or router processes to bind to.") bench_host: str | None = Field( @@ -165,13 +158,6 @@ class LLMServingCmdArgs(CmdArgs, Generic[LLMServingArgsT]): prefill: LLMServingArgsT | None = Field(default=None) decode: LLMServingArgsT - @field_validator("model_path") - @classmethod - def validate_model_path(cls, model_path: str | None) -> str | None: - if model_path is not None and not Path(model_path).is_absolute(): - raise ValueError("model_path must be an absolute path inside the container.") - return model_path - @model_validator(mode="after") def validate_disaggregated_port(self) -> Self: if self.prefill is not None and self.port > 65335: @@ -205,7 +191,7 @@ def extra_installables(self) -> list[Installable]: @property def installables(self) -> list[Installable]: installables: list[Installable] = [*self.git_repos, self.docker_image] - if self.cmd_args.model_path is None: + if not Path(self.cmd_args.model).is_absolute(): installables.append(self.hf_model) return [*installables, *self.extra_installables] diff --git a/src/cloudai/workloads/sglang/slurm_command_gen_strategy.py b/src/cloudai/workloads/sglang/slurm_command_gen_strategy.py index 8202c5cb3..f1e576ac5 100644 --- a/src/cloudai/workloads/sglang/slurm_command_gen_strategy.py +++ b/src/cloudai/workloads/sglang/slurm_command_gen_strategy.py @@ -43,10 +43,7 @@ def workload_name(self) -> str: def get_serve_commands(self) -> list[list[str]]: cmd_args = self.tdef.cmd_args - model_source = cmd_args.model_path or cmd_args.model - base_cmd = ["python3", "-m", cmd_args.serve_module, "--model-path", model_source] - if cmd_args.model_path is not None: - base_cmd.extend(["--served-model-name", cmd_args.model]) + base_cmd = ["python3", "-m", cmd_args.serve_module, "--model-path", cmd_args.model] if not cmd_args.prefill: return [ [ diff --git a/src/cloudai/workloads/vllm/slurm_command_gen_strategy.py b/src/cloudai/workloads/vllm/slurm_command_gen_strategy.py index 48989ad6c..cea0fd1b2 100644 --- a/src/cloudai/workloads/vllm/slurm_command_gen_strategy.py +++ b/src/cloudai/workloads/vllm/slurm_command_gen_strategy.py @@ -105,10 +105,7 @@ def get_serve_commands(self) -> list[list[str]]: tdef: VllmTestDefinition = cast(VllmTestDefinition, self.test_run.test) cmd_args: VllmCmdArgs = tdef.cmd_args - model_source = cmd_args.model_path or cmd_args.model - base_cmd = ["vllm", "serve", model_source, "--host", self.bind_host] - if cmd_args.model_path is not None: - base_cmd.extend(["--served-model-name", cmd_args.model]) + base_cmd = ["vllm", "serve", cmd_args.model, "--host", self.bind_host] if not tdef.cmd_args.prefill: return [ self._with_ray_backend( diff --git a/tests/workloads/sglang/test_command_gen_strategy_slurm.py b/tests/workloads/sglang/test_command_gen_strategy_slurm.py index 5274313f9..3519e5ac2 100644 --- a/tests/workloads/sglang/test_command_gen_strategy_slurm.py +++ b/tests/workloads/sglang/test_command_gen_strategy_slurm.py @@ -71,38 +71,6 @@ def test_container_mounts(sglang_cmd_gen_strategy: SglangSlurmCommandGenStrategy ] -def test_local_model_path_is_used_for_loading_and_model_name_for_requests( - sglang: SglangTestDefinition, sglang_tr: TestRun, slurm_system: SlurmSystem -) -> None: - sglang.cmd_args.model = "custom-model" - sglang.cmd_args.model_path = "/models/custom-model" - sglang.extra_container_mounts = ["/lustre/custom-model:/models/custom-model:ro"] - strategy = SglangSlurmCommandGenStrategy(slurm_system, sglang_tr) - - serve_command = strategy.get_serve_commands()[0] - bench_command = strategy.get_bench_command() - - assert serve_command[:9] == [ - "python3", - "-m", - "sglang.launch_server", - "--model-path", - "/models/custom-model", - "--served-model-name", - "custom-model", - "--host", - "0.0.0.0", - ] - assert "--model custom-model" in bench_command - assert "/lustre/custom-model:/models/custom-model:ro" in strategy.container_mounts() - - sglang.cmd_args.prefill = SglangArgs() - disaggregated_commands = strategy.get_serve_commands() - assert len(disaggregated_commands) == 2 - assert all(command[4] == "/models/custom-model" for command in disaggregated_commands) - assert all("--served-model-name" in command for command in disaggregated_commands) - - class TestGpuDetection: def test_aggregated_gpu_ids_from_decode_config(self, sglang_tr: TestRun, slurm_system: SlurmSystem) -> None: tdef = cast(SglangTestDefinition, sglang_tr.test) diff --git a/tests/workloads/sglang/test_workload.py b/tests/workloads/sglang/test_workload.py index feac84162..ee921e4fd 100644 --- a/tests/workloads/sglang/test_workload.py +++ b/tests/workloads/sglang/test_workload.py @@ -28,8 +28,7 @@ def test_local_model_is_not_installed_from_hugging_face() -> None: test_template_name="sglang", cmd_args=SglangCmdArgs( docker_image_url="test_url", - model="custom-model", - model_path="/models/custom-model", + model="/models/custom-model", ), ) diff --git a/tests/workloads/vllm/test_command_gen_strategy_slurm.py b/tests/workloads/vllm/test_command_gen_strategy_slurm.py index 3d61b4ad9..bdff95eba 100644 --- a/tests/workloads/vllm/test_command_gen_strategy_slurm.py +++ b/tests/workloads/vllm/test_command_gen_strategy_slurm.py @@ -248,36 +248,6 @@ def test_get_vllm_serve_commands_convert_boolean_flags( str(vllm.cmd_args.port), ] - def test_local_model_path_is_used_for_loading_and_model_name_for_requests( - self, vllm: VllmTestDefinition, vllm_tr: TestRun, slurm_system: SlurmSystem - ) -> None: - vllm.cmd_args.model = "custom-model" - vllm.cmd_args.model_path = "/models/custom-model" - vllm.extra_container_mounts = ["/lustre/custom-model:/models/custom-model:ro"] - strategy = VllmSlurmCommandGenStrategy(slurm_system, vllm_tr) - - serve_command = strategy.get_serve_commands()[0] - bench_command = strategy.get_bench_command() - - assert serve_command[:8] == [ - "vllm", - "serve", - "/models/custom-model", - "--host", - "0.0.0.0", - "--served-model-name", - "custom-model", - "--port", - ] - assert "--model custom-model" in bench_command - assert "/lustre/custom-model:/models/custom-model:ro" in strategy.container_mounts() - - vllm.cmd_args.prefill = VllmArgs() - disaggregated_commands = strategy.get_serve_commands() - assert len(disaggregated_commands) == 2 - assert all(command[2] == "/models/custom-model" for command in disaggregated_commands) - assert all("--served-model-name" in command for command in disaggregated_commands) - def test_generate_wait_for_health_function(self, vllm_cmd_gen_strategy: VllmSlurmCommandGenStrategy) -> None: cmd_args = vllm_cmd_gen_strategy.test_run.test.cmd_args diff --git a/tests/workloads/vllm/test_workload.py b/tests/workloads/vllm/test_workload.py index d5ab4a8ae..4d0be03df 100644 --- a/tests/workloads/vllm/test_workload.py +++ b/tests/workloads/vllm/test_workload.py @@ -62,8 +62,7 @@ def test_local_model_is_not_installed_from_hugging_face() -> None: test_template_name="vllm", cmd_args=VllmCmdArgs( docker_image_url="test_url", - model="custom-model", - model_path="/models/custom-model", + model="/models/custom-model", ), proxy_script_repo=proxy_script_repo, ) @@ -71,11 +70,6 @@ def test_local_model_is_not_installed_from_hugging_face() -> None: assert tdef.installables == [tdef.docker_image, proxy_script_repo] -def test_local_model_path_must_be_absolute() -> None: - with pytest.raises(ValueError, match="model_path must be an absolute path"): - VllmCmdArgs(docker_image_url="test_url", model_path="models/custom-model") - - def test_constraint_check_rejects_tp_pp_dp_above_available_gpus(tmp_path) -> None: tdef = VllmTestDefinition( name="test",