Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 6 additions & 4 deletions src/aiconfigurator/sdk/picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ def _build_disagg_summary_dict(
Returns:
Dict with keys matching ``common.ColumnsDisagg``.
"""
seq_s = min(
prefill_summary_dict["seq/s"] * prefill_num_worker * prefill_degradation_factor,
decode_summary_dict["seq/s"] * decode_num_worker * decode_degradation_factor,
)
prefill_capacity = prefill_summary_dict["seq/s"] * prefill_num_worker * prefill_degradation_factor
decode_capacity = decode_summary_dict["seq/s"] * decode_num_worker * decode_degradation_factor
prefill_ttft_capacity = prefill_summary_dict["bs"] * prefill_num_worker * 1000.0 / prefill_summary_dict["ttft"]

seq_s = min(prefill_capacity, decode_capacity, prefill_ttft_capacity)

prefill_gpus = prefill_summary_dict["pp"] * prefill_summary_dict["tp"] * prefill_summary_dict["dp"]
decode_gpus = decode_summary_dict["pp"] * decode_summary_dict["tp"] * decode_summary_dict["dp"]
num_total_gpus = prefill_gpus * prefill_num_worker + decode_gpus * decode_num_worker
Expand Down
8 changes: 4 additions & 4 deletions src/aiconfigurator/sdk/sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def _rate_match_dict(
d = decode_summary_dict
osl = p["osl"]

seq_s = min(
p["seq/s"] * prefill_num_worker * prefill_degradation,
d["seq/s"] * decode_num_worker * decode_degradation,
)
prefill_capacity = p["seq/s"] * prefill_num_worker * prefill_degradation
decode_capacity = d["seq/s"] * decode_num_worker * decode_degradation
prefill_ttft_capacity = p["bs"] * prefill_num_worker * 1000.0 / p["ttft"]
seq_s = min(prefill_capacity, decode_capacity, prefill_ttft_capacity)
prefill_gpus = p["pp"] * p["tp"] * p["dp"]
decode_gpus = d["pp"] * d["tp"] * d["dp"]
num_total_gpus = prefill_gpus * prefill_num_worker + decode_gpus * decode_num_worker
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/sdk/sweep/test_rate_match_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ def test_rate_match_with_custom_degradation_factors():
)


def test_rate_match_prefill_ttft_capacity_can_bound_throughput():
p = _make_prefill_dict(bs=1, ttft=500.0, **{"seq/s": 100.0})
d = _make_decode_dict(**{"seq/s": 100.0})

new_result = _rate_match_dict(p, 2, d, 2)
old_result = _build_disagg_summary_dict(p, 2, d, 2)

assert new_result["seq/s"] == 4.0
for key in new_result:
assert new_result[key] == old_result[key]


def test_rate_match_zero_osl_does_not_divide_by_zero():
"""request_latency uses max(osl - 1, 0); osl=1 keeps decode_time=0."""
p = _make_prefill_dict(osl=1)
Expand Down
Loading