Repository navigation
feat(dataset): smooth tanh inter-turn delay cap; honor the cap on public DAG datasets - #1
Open
v-shobhit wants to merge 1 commit into
Conversation
…lic DAG datasets
Add --inter-turn-delay-cap-mode {hard,tanh} (dataset field
inter_turn_delay_cap_mode, default "hard"). In "tanh" mode every recorded
inter-turn delay d becomes cap * tanh(d / cap): close to the identity for
short delays (1 s -> 1.00 s, 5 s -> 4.62 s at a 10 s cap), smooth through the
cap (10 s -> 7.62 s), and approaching but never exceeding it (60 s and
longer -> 10.00 s). "hard" keeps today's min(delay, cap).
Fix: DagJsonlLoader read the cap only from FileDataset, so
--inter-turn-delay-cap-seconds was silently ignored when a public loader
(agentperf_v2) hands its downloaded dag_jsonl file to the DAG loader. The
cap and mode now resolve from PublicDataset as well.
Honored by the DAG JSONL (incl. agentperf_v2), multi-turn, trace-base
(mooncake/bailian/burst-gpt) and baseten_trace loaders. weka_trace keeps the
hard clamp (its parallel workers clamp with the hard rule) and warns if tanh
is requested. The mode keys the mmap dataset cache. The tracker reports the
total delay removed in tanh mode.
On deepseek-v4.1-flash/public (25,159 delays, 81.1 h of recorded pauses), a
10 s cap leaves 12.7 h (hard) or 12.0 h (tanh); tanh shortens the 90.5% of
delays already under the cap by 6.6% in total.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Shobhit Verma <shobhitv@nvidia.com>
Try out this PRQuick install: pip install --upgrade --force-reinstall git+https://github.com/ai-dynamo/aiperf.git@ecc30701f475b40f8c1b479fc6c84c0a689b1444Recommended 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@ecc30701f475b40f8c1b479fc6c84c0a689b1444Last updated for commit: |
v-shobhit
added a commit
to v-shobhit/aiperf
that referenced
this pull request
Nov 12, 2026
…ysis#1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a smooth
tanhoption for the inter-turn delay cap, and fixes the cap being ignored on theagentperf-v2public dataset.Recorded delays in the dataset
These are the pauses the harness actually sleeps: 24,936 delays, 47.6 h in total. Subagent join turns are left out because the harness fires them as soon as the children finish. The median pause is 0.34 s, but the 9% of pauses over 10 s hold 87% of the time (p99 120 s, max 28 min). Those long pauses set a run's wall time.
Change
--inter-turn-delay-cap-mode {hard,tanh}(defaulthard).tanhsleepscap * tanh(d / cap): close to the recorded delay for short pauses, bending smoothly into the cap and never above it.hardstaysmin(d, cap).--public-dataset agentperf_v2,DagJsonlLoaderonly read the cap fromFileDataset, so--inter-turn-delay-cap-secondswas silently ignored. Cap and mode now also resolve fromPublicDataset.With a 10 s cap, the 47.6 h of slept pauses drops to 12.3 h (hard) or 11.5 h (tanh). Hard puts the 8.9% of delays over 10 s at exactly 10 s; tanh spreads them out.
How the cap shortens a run
An
agentperf-v2run ends when every user has replayed its burn-in and measured slice. Both are fixed stretches of the recorded timeline (15 min, then up to 75 min), so the requests sent don't depend on the cap. What changes is how long each user takes to get through them:The cap helps a run only when its slowest user is mostly waiting on recorded pauses. Estimates from our uncapped DeepSeek-V4.1-Flash runs on GB200 (TP2,
agentperf-v2scenario), each user's measured idle gaps replaced by their 10 s tanh-capped value:The default stays uncapped; the
agentperf-v2scenario is unchanged.Testing
tests/unit/dataset/loader/test_inter_turn_delay_soft_cap.py(curve, monotonicity, pass-throughs, tracker, DAG loader in both modes,PublicDatasetresolution), plus routing and cache-key tests.pytest tests/unit/{config,dataset,common,timing,cli}: 10,346 passed, 105 skipped, 1 xfailed.ruffandgenerate_config_schema --checkclean.aiperf-mock-serverwith--public-dataset agentperf_v2 --inter-turn-delay-cap-seconds 10: both modes cap 2,382 delays (tanh removes 248,895.5 s in total). Before the fix, neither applied.🤖 Generated with Claude Code