Skip to content

Pass AIPERF_SLICE_DURATION to agentx profile / 将 AIPERF_SLICE_DURATION 传递给 agentx profile - #4288

Closed
FrankD412 wants to merge 2 commits into
SemiAnalysisAI:mainfrom
FrankD412:fdinatale/agentx-slice-duration
Closed

FrankD412 wants to merge 2 commits into
SemiAnalysisAI:mainfrom
FrankD412:fdinatale/agentx-slice-duration

Conversation

@FrankD412

@FrankD412 FrankD412 commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

AgentX replay runs cannot choose aiperf's timeslice width. agentx-harness 1.0.11's AgentX scenario preset defaults slice_duration to 1.0 s, and infx.bench.agentic has no way to pass --slice-duration, so every run computes per-second request and server-metric timeslices in the final export. Nothing in InferenceX reads them: result processing uses only run-wide stats (total, sum, max, avg), never timeslices or the slice-derived rate_* fields.

This adds an optional AIPERF_SLICE_DURATION input. When a recipe sets benchmark.env.AIPERF_SLICE_DURATION, replay_argv() appends --slice-duration <value> to agentx profile. When it is unset, the command line is unchanged. A recipe can use it to coarsen slicing (removing most of the export cost) or, if the preset default changes upstream, to turn per-second slicing back on for by-hand analysis.

No benchmark point changes, so there is no perf-changelog.yaml entry.

Companion change: SemiAnalysisAI/agentx-harness#55 removes the 1 s default from the agentx preset, so timeslicing becomes opt-in. Until a release with it is pinned here, recipes can set AIPERF_SLICE_DURATION to avoid the cost; afterwards the variable is how a recipe turns per-window slicing back on.

On DSV4.1-Flash FP4 16P1D at c13312 (GB300), a 3600 s slice cut aiperf's post-profiling processing from 1 h 38 m to 23 m and the job from 3:41 to 2:23 of the 4 h limit; serving metrics and the processed result fields were unchanged.

Validation details

Matched srt-slurm runs, same recipe (tachometer off), agentx-harness==1.0.11, differing only in AIPERF_SLICE_DURATION:

Default (1 s slices) AIPERF_SLICE_DURATION=3600
Profiling end → All results received 1 h 37 m 54 s 22 m 57 s
Total job 3:41:16 2:22:50
Timeslices / server_metrics_export.json 3,525 / 1.28 GB 1 / 1.97 MB
Output throughput 410,433 tok/s 409,594 tok/s (−0.2 %)
ITL p50 / p99 9.45 / 10.96 ms 9.48 / 10.96 ms
Errors 2 0

benchmark_command.txt contained --slice-duration 3600, and the exported input_config.artifacts.slice_duration was 3600.0. Both processed result JSONs have the same 169 fields and 26 nulls.

AI model disclosure
  • Model/version: claude-opus-5-5 (Anthropic), as exposed by the Hermes runtime
  • Role: investigated the processing tail, implemented the change and test, ran the A/B benchmark analysis, and drafted this description
PR checklist and change type

Type of Change

  • Bug fix
  • New feature
  • Configuration change
  • Documentation update
  • Other (please describe)

Checklist

  • I have completed the AI model disclosure and kept it current
  • I have tested my changes locally
  • I have updated documentation if necessary
  • If python -m infx.matrix.changed --base origin/main lists affected config keys, I have appended one new entry covering them to the physical end of inferencex-e2e/perf-changelog.yaml; if it lists none, I have added none. I have not edited historical entries
  • If this PR appends an inferencex-e2e/perf-changelog.yaml entry, it carries exactly one primary sweep label (a maintainer applies it on fork PRs): full-sweep-fail-fast (recommended), full-sweep-enabled, or non-canary-full-sweep-enabled. Optional modifiers all-evals, evals-only, and agentx-fast require a primary label; the last two block reuse while applied.
  • Before merging via reuse, an authorized maintainer (OWNER/MEMBER/COLLABORATOR) has commented /use <run_id> (or the legacy /reuse-sweep-run) on this PR. Do this only once there is a final full sweep that is all green with evals passing, since after this comment the primary sweep label will no longer automatically kick off new sweeps. Remove and re-add the primary sweep label to force a new sweep.
中文

AgentX 回放运行无法设置 aiperf 的时间切片宽度。agentx-harness 1.0.11 的 AgentX 场景预设将 slice_duration 默认设为 1.0 秒,而 infx.bench.agentic 无法传递 --slice-duration,因此每次运行都会在最终导出时计算逐秒的请求指标和服务端指标时间切片。InferenceX 并不读取这些数据:结果处理只使用全程 stats(total、sum、max、avg),从不使用 timeslices 或基于切片计算的 rate_* 字段。

本 PR 新增可选输入 AIPERF_SLICE_DURATION。配方设置 benchmark.env.AIPERF_SLICE_DURATION 时,replay_argv() 会向 agentx profile 追加 --slice-duration <value>;未设置时命令行不变。配方可以用它放宽切片宽度(去掉大部分导出开销),或者在上游更改预设默认值后,重新开启逐秒切片以便手动分析。

本 PR 不改变任何基准测试点,因此不新增 perf-changelog.yaml 条目。

配套改动:SemiAnalysisAI/agentx-harness#55 移除 agentx 预设中 1 秒的默认切片宽度,使时间切片改为按需开启。在本仓库固定到包含该改动的版本之前,配方可以设置 AIPERF_SLICE_DURATION 来避免这部分开销;之后,配方可通过该变量重新开启按时间窗口切片。

在 GB300 上的 DSV4.1-Flash FP4 16P1D、并发 13312 配置中,3600 秒切片使 aiperf 在 profiling 结束后的处理时间从 1 小时 38 分降至 23 分,作业总时长从 3:41 降至 2:23(上限 4 小时);服务指标和处理后的结果字段均未改变。验证数据见上方 “Validation details” 表格。

AI 模型使用说明:使用 claude-opus-5-5(Anthropic,由 Hermes 运行环境提供的标识)排查处理耗时、实现改动和测试、分析 A/B 基准测试结果并撰写本说明。

Recipes can now set the aiperf timeslice width through
benchmark.env.AIPERF_SLICE_DURATION, which becomes
`agentx profile --slice-duration <value>`. Unset leaves the scenario
default and the command line unchanged.

中文:新增 AIPERF_SLICE_DURATION,并将其传递给 agentx profile。配方可通过
benchmark.env.AIPERF_SLICE_DURATION 设置 aiperf 时间切片宽度,对应
`agentx profile --slice-duration <value>`。未设置时保留场景默认值,命令行不变。
@FrankD412

Copy link
Copy Markdown
Collaborator Author

I ran some studies locally and the time to post-process is much better with recent additions. I think we can close this for now. This closure will also apply to SemiAnalysisAI/agentx-harness#55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant