Skip to content

Commit c14896f

Browse files
committed
Prototype implementation for non-linear sweeps
1 parent 71f1e3c commit c14896f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/guidellm/benchmark/profile.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ class SweepProfile(AsyncProfile):
277277
)
278278
rate: float = -1
279279
rate_type: Literal["constant", "poisson"] = "constant"
280+
max_rate_adjustment: float = Field(
281+
default=1.1,
282+
description="Multiplier to over-estimate the measured throughput.",
283+
)
280284

281285
@property
282286
def strategy_types(self) -> list[StrategyType]:
@@ -297,8 +301,10 @@ def next_strategy(self) -> Optional[SchedulingStrategy]:
297301
)
298302

299303
min_rate = self.measured_rates[0]
300-
max_rate = self.measured_rates[1]
301-
rates = np.linspace(min_rate, max_rate, self.sweep_size - 1)[1:]
304+
max_rate = self.measured_rates[1] * self.max_rate_adjustment
305+
306+
halving_fractions = 0.5 ** np.arrange(self.sweep_size - 1)
307+
rates = ((max_rate - min_rate) * halving_fractions + min_rate)[1:]
302308

303309
if self.rate_type == "constant":
304310
return AsyncConstantStrategy(
@@ -360,6 +366,9 @@ def from_standard_args( # type: ignore[override]
360366
if "strategy_type" not in kwargs:
361367
kwargs["strategy_type"] = "constant"
362368

369+
if "max_rate_percent_adjustment" not in kwargs:
370+
kwargs["max_rate_percent_adjustment"] = 25.0
371+
363372
return SweepProfile(sweep_size=int(rate), random_seed=random_seed, **kwargs)
364373

365374

0 commit comments

Comments
 (0)