Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions components/planner/src/dynamo/planner/utils/planner_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,16 +372,38 @@ async def make_adjustments(self):
expect_ttft = self.prefill_interpolator.interpolate_ttft(
self.last_metrics.isl
)
self.p_correction_factor = self.last_metrics.ttft / expect_ttft
if expect_ttft > 0:
self.p_correction_factor = self.last_metrics.ttft / expect_ttft
else:
logger.warning(
f"Expected TTFT is {expect_ttft}, using default correction factor 1.0"
)
self.p_correction_factor = 1.0
# for ITL, we expect the correction factor to be close to 1
if len(self.d_endpoints) > 0:
concurrency = (
self.last_metrics.num_req # type: ignore
/ len(self.d_endpoints)
* self.last_metrics.request_duration # type: ignore
/ self.args.adjustment_interval
)
else:
logger.warning(
"No decode workers available, using default concurrency of 1.0"
)
concurrency = 1.0

expect_itl = self.decode_interpolator.interpolate_itl(
concurrency=self.last_metrics.num_req # type: ignore
/ len(self.d_endpoints)
* self.last_metrics.request_duration # type: ignore
/ self.args.adjustment_interval,
concurrency=concurrency,
context_length=self.last_metrics.isl + self.last_metrics.osl / 2, # type: ignore
)
self.d_correction_factor = self.last_metrics.itl / expect_itl
if expect_itl > 0:
self.d_correction_factor = self.last_metrics.itl / expect_itl
else:
logger.warning(
f"Expected ITL is {expect_itl}, using default correction factor 1.0"
)
self.d_correction_factor = 1.0
logger.info(
f"Correction factors: TTFT: {self.p_correction_factor:.3f}, ITL: {self.d_correction_factor:.3f}"
)
Expand Down
Loading