Skip to content

fix(scenario): make any context overflow invalidate agentperf-v2 runs - #2

Open
roborluo wants to merge 2 commits into
ArtificialAnalysis:agentperf-v2from
roborluo:fix/agentperf-v2-zero-context-overflow
Open

roborluo wants to merge 2 commits into
ArtificialAnalysis:agentperf-v2from
roborluo:fix/agentperf-v2-zero-context-overflow

Conversation

@roborluo

@roborluo roborluo commented Nov 12, 2026 •

Copy link
Copy Markdown

Problem

In agentic replay, a context-overflow response is skipped: the session ends, the record stays out of the metrics, and the turns after it are never sent. The only validity check is the overflow rate against AIPERF_AGENTX_CONTEXT_OVERFLOW_RATE_LIMIT (1%), and it counts overflow events, not the turns that were skipped.

So a server started with a shorter context window than the dataset needs (for example 512k) can skip the longest, most expensive turns and still report submission_valid=true. One overflow ends a whole session, so a few dozen overflows per run stay far below 1%.

Every request in the agentperf-v2 recordings fits in a 1M-token window (the largest prompts are about 804k, 873k and 845k tokens for the three models). A correctly configured server never overflows.

Change

  • New ScenarioSpec.max_context_overflow_rate (default None, which keeps the env limit).
  • agentperf-v2 sets it to 0.0, so any context overflow flips submission_valid to false with context_overflow_rate_exceeded.
  • The env var can only tighten a scenario's ceiling, never loosen it.
  • Other scenarios are unchanged and keep the 1% rule.

Known gaps (not changed here)

  • An overflow on a subagent request during warmup is counted only in the warmup metrics, so it does not reach this gate. Root-session warmup overflows already abort the run, and the subagent's next turn in profiling would normally overflow and be counted.
  • In multi-run aggregates, a run in which every request overflowed has no successful requests, so it is marked failed and its overflows are left out of the aggregate gate. That run's own export is still marked invalid.

Tests

tests/unit/exporters/test_submission_valid_field.py: zero overflows stay valid; one overflow in 10,000 is invalid for agentperf-v2; inferencex-agentx-mvp keeps the 1% rule; the env var cannot loosen the agentperf-v2 ceiling. The agentperf-v2 tutorial now states the 1M-token context requirement.

🤖 Generated with Claude Code

Context-overflow responses in agentic replay are skipped: the session
ends and the skipped turns never reach the metrics, while the validity
gate only checks overflow events against a 1% rate. A server started
with a context window shorter than the dataset needs could skip the
longest turns and still report submission_valid=true.

Every request in the agentperf-v2 recordings fits a 1M-token window, so
a correctly configured server never overflows. Add a per-scenario
max_context_overflow_rate ceiling and set it to 0.0 for agentperf-v2.
The AIPERF_AGENTX_CONTEXT_OVERFLOW_RATE_LIMIT env var can only tighten
a scenario's ceiling, never loosen it. Other scenarios keep the 1% rule.

Signed-off-by: Bofeng Luo <bofengl@nvidia.com>
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Try out this PR

Quick install:

pip install --upgrade --force-reinstall git+https://github.com/ai-dynamo/aiperf.git@6dd4f37cdba1740c3561ea7c7a08ffd274b8e5c4

Recommended with virtual environment (using uv):

uv venv --python 3.12 && source .venv/bin/activate
uv pip install --upgrade --force-reinstall git+https://github.com/ai-dynamo/aiperf.git@6dd4f37cdba1740c3561ea7c7a08ffd274b8e5c4

Last updated for commit: 6dd4f37 • Browse code

…rement

Signed-off-by: Bofeng Luo <bofengl@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant