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
11 changes: 11 additions & 0 deletions perf-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5475,3 +5475,14 @@
- "9 MTP configs: 1P1D DEP2+1D TEP16 (conc 48), 1P4D DEP2+4D TP16 (conc 4), 1P7D DEP2+7D TEP8 (conc 42), 2P15D DEP2+15D TP4 (conc 90), 3P4D DEP2+4D TEP8 (conc 192), 3P7D DEP2+7D TEP8 (conc 168), 4P1D DEP2+1D DEP16 (conc 384), 6P5D DEP2+5D TEP8 (conc 480), 9P1D DEP2+1D DEP16 (conc 1536)."
- "Runner: launch_gb300-nv.sh updated to clone NVIDIA/srt-slurm@v1.0.29 and overlay local recipes from benchmarks/multi_node/srt-slurm-recipes/trtllm/qwen3.5/gb300-fp4/disagg/ for the dynamo-trt+qwen3.5+fp4 path; --no-preflight added for model on compute-node /scratch."
pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2218

- config-keys:
- kimik3-fp4-b300-vllm-agentic
scenario-type:
- agentic-coding
description:
- "Add client-observed full-response inter-token latency and matching interactivity aggregates for AgentX request artifacts."
- "Keep server-reported completion-token counts aligned with the full HTTP response lifecycle when Kimi-K3 stops emitting parsed content at an end-of-message marker but continues raw generation."
- "Exercise the Kimi-K3 B300 concurrency-1 GPU-resident and DRAM-offload points as the targeted regression for the previously inflated visible-content interactivity calculation."
pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2504

32 changes: 28 additions & 4 deletions utils/agentic/aggregation/request_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,23 @@ def _nest_stats(prefix: str, flat: dict[str, Any]) -> dict[str, Any]:
}


def _interactivity_stats(itl_stats: dict[str, Any], itls: list[float]) -> dict[str, float]:
def _interactivity_stats(
itl_stats: dict[str, Any],
itls: list[float],
*,
itl_prefix: str = "itl",
intvty_prefix: str = "intvty",
) -> dict[str, float]:
"""Derive slow-tail interactivity from the matching ITL statistic."""
out: dict[str, float] = {}
for key in ("mean", "p50", "p75", "p90", "p95"):
value = itl_stats.get(f"{key}_itl")
value = itl_stats.get(f"{key}_{itl_prefix}")
if isinstance(value, int | float) and not isinstance(value, bool) and value > 0:
out[f"{key}_intvty"] = 1.0 / value
out[f"{key}_{intvty_prefix}"] = 1.0 / value

per_request = [1.0 / value for value in itls if value > 0]
if per_request:
out["std_intvty"] = (
out[f"std_{intvty_prefix}"] = (
statistics.pstdev(per_request) if len(per_request) > 1 else 0.0
)
return out
Expand All @@ -149,25 +155,43 @@ def compute_latency_stats(records: list[dict[str, Any]]) -> tuple[dict[str, Any]
ttfts = _ms_to_s(extract_per_record_floats(records, "time_to_first_token"))
e2els = _ms_to_s(extract_per_record_floats(records, "request_latency"))
itls = _ms_to_s(extract_per_record_floats(records, "inter_token_latency"))
full_response_itls = _ms_to_s(
extract_per_record_floats(records, "full_response_inter_token_latency")
)
ttft_stats = stats_for("ttft", ttfts)
e2el_stats = stats_for("e2el", e2els)
itl_stats = stats_for("itl", itls)
tpot_stats = stats_for("tpot", itls)
intvty_stats = _interactivity_stats(itl_stats, itls)
full_response_itl_stats = stats_for("full_response_itl", full_response_itls)
full_response_intvty_stats = _interactivity_stats(
full_response_itl_stats,
full_response_itls,
itl_prefix="full_response_itl",
intvty_prefix="full_response_intvty",
)

flat: dict[str, Any] = {}
flat.update(ttft_stats)
flat.update(e2el_stats)
flat.update(itl_stats)
flat.update(tpot_stats)
flat.update(intvty_stats)
flat.update(full_response_itl_stats)
flat.update(full_response_intvty_stats)

nested = {
"ttft": _nest_stats("ttft", ttft_stats),
"e2el": _nest_stats("e2el", e2el_stats),
"itl": _nest_stats("itl", itl_stats),
"tpot": _nest_stats("tpot", tpot_stats),
"intvty": _nest_stats("intvty", intvty_stats),
"full_response_itl": _nest_stats(
"full_response_itl", full_response_itl_stats
),
"full_response_intvty": _nest_stats(
"full_response_intvty", full_response_intvty_stats
),
}
return flat, nested

Expand Down
52 changes: 51 additions & 1 deletion utils/agentic/aggregation/test_process_agentic_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@
"raw",
}
REQUEST_METRICS_KEYS = {"qps", "latency", "tokens", "throughput", "cache"}
REQUEST_LATENCY_KEYS = {"ttft", "e2el", "itl", "tpot", "intvty"}
REQUEST_LATENCY_KEYS = {
"ttft",
"e2el",
"itl",
"tpot",
"intvty",
"full_response_itl",
"full_response_intvty",
}
REQUEST_TOKEN_KEYS = {"input", "output_actual", "output_expected"}
REQUEST_THROUGHPUT_KEYS = {
"input",
Expand Down Expand Up @@ -510,6 +518,48 @@ def test_processor_throughput_per_gpu(tmp_path: Path):
)


def test_processor_aggregates_full_response_itl_and_interactivity(tmp_path: Path):
result_dir = tmp_path / "results"
artifact = result_dir / "aiperf_artifacts"
artifact.mkdir(parents=True)

full_response_itls_ms = (5.469791, 5.0, 4.0)
with open(artifact / "profile_export.jsonl", "w") as f:
for idx, full_response_itl_ms in enumerate(full_response_itls_ms):
record = _make_record(
conv_id=f"trace-{idx}",
turn_index=0,
isl=100,
osl=26_571,
ttft_ms=529.058811,
e2e_ms=610.559573,
itl_ms=0.003067398,
start_ns=(idx + 1) * 1_000_000_000,
end_ns=(idx + 1) * 1_000_000_000 + 145_861_451_008,
)
record["metrics"]["full_response_inter_token_latency"] = {
"value": full_response_itl_ms,
"unit": "ms",
}
f.write(json.dumps(record) + "\n")

with open(artifact / "profile_export_aiperf.json", "w") as f:
json.dump({"request_count": len(full_response_itls_ms)}, f)

agg = _run_processor(result_dir, tmp_path / "out")
latency = agg["request_metrics"]["latency"]
full_response_itl = latency["full_response_itl"]
full_response_intvty = latency["full_response_intvty"]

assert full_response_itl["p50"] == pytest.approx(0.005)
assert full_response_itl["p75"] == pytest.approx(0.00523)
assert full_response_intvty["p50"] == pytest.approx(
1 / full_response_itl["p50"]
)
assert full_response_intvty["p75"] == pytest.approx(1 / 0.0052348955)
assert full_response_intvty["p75"] < full_response_intvty["p50"]


def test_processor_surfaces_allocated_cpu_dram(tmp_path: Path):
result_dir = _write_fixture(tmp_path)

Expand Down