diff --git a/src/guidellm/benchmark/profiles.py b/src/guidellm/benchmark/profiles.py index 08fea0efc..848722809 100644 --- a/src/guidellm/benchmark/profiles.py +++ b/src/guidellm/benchmark/profiles.py @@ -432,6 +432,10 @@ def resolve_args( kwargs.pop("random_seed", None) if rate is not None and len(rate) > 0: kwargs["max_concurrency"] = rate[0] + else: + # Require explicit max_concurrency; in the future max_concurrency + # should be dynamic and rate can specify some tunable + raise ValueError("ThroughputProfile requires a rate parameter") return kwargs @property diff --git a/src/guidellm/scheduler/strategies.py b/src/guidellm/scheduler/strategies.py index dfdd97f58..0522d300a 100644 --- a/src/guidellm/scheduler/strategies.py +++ b/src/guidellm/scheduler/strategies.py @@ -387,7 +387,7 @@ def __str__(self) -> str: """ :return: String identifier for throughput strategy """ - return "throughput" + return f"throughput@{self.max_concurrency or 'unlimited'}" @property def processes_limit(self) -> PositiveInt | None: diff --git a/tests/unit/scheduler/test_strategies.py b/tests/unit/scheduler/test_strategies.py index 7f01fc89b..cc9d3b0a4 100644 --- a/tests/unit/scheduler/test_strategies.py +++ b/tests/unit/scheduler/test_strategies.py @@ -335,9 +335,10 @@ def test_string_representation( self, valid_instances: tuple[ThroughputStrategy, dict] ): """Test __str__ method for ThroughputStrategy.""" - instance, _ = valid_instances + instance, constructor_args = valid_instances + max_concurrency = constructor_args.get("max_concurrency") result = str(instance) - assert result == "throughput" + assert result == f"throughput@{max_concurrency or 'unlimited'}" @pytest.mark.smoke def test_marshalling(self, valid_instances: tuple[ThroughputStrategy, dict]):