Skip to content

Commit 0bc17a2

Browse files
committed
Round rates to next 0.25
1 parent 272fdd5 commit 0bc17a2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/guidellm/benchmark/profile.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,15 @@ def next_strategy(self) -> Optional[SchedulingStrategy]:
302302
max_rate += (max_rate - min_rate) / self.sweep_size
303303
rates = np.linspace(min_rate, max_rate, self.sweep_size - 1)[1:]
304304

305+
# Round to the next 0.25
306+
rates = (np.ceil(rates * 8) + 1 ) // 2 / 4
307+
# Remove duplicates caused by rounding
308+
rates = np.unique(rates)
309+
310+
# End early if we don't have enough rates
311+
if self.completed_strategies - 1 > len(rates):
312+
return None
313+
305314
if self.rate_type == "constant":
306315
return AsyncConstantStrategy(
307316
rate=rates[self.completed_strategies - 2],

0 commit comments

Comments
 (0)