Skip to content

[PowerX] enable Kimi-K3 AgentX power backfills / 启用功耗补测 - #3030

Closed
edwingao28 wants to merge 2 commits into
mainfrom
feat/kimik3-power-backfill
Closed

[PowerX] enable Kimi-K3 AgentX power backfills / 启用功耗补测#3030
edwingao28 wants to merge 2 commits into
mainfrom
feat/kimik3-power-backfill

Conversation

@edwingao28

@edwingao28 edwingao28 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Reference only; do not merge or add sweep labels. Kimi-K3 power work is split below; source 2f3d637f6 is preserved in chore/preserve-kimik3-3030-full.

Testing: Existing CPU/matrix checks passed; 38 source files match the split against main@900f1989d, with scoped changelog entries.

Pending: Hardware validation and publication. Retarget stacked PRs to main after dependencies merge; validate one scope at a time under the merge policy. Child PRs retain specific blockers.

PR Scope / 范围 Base / 基线 Planned benchmark/eval jobs / 计划基准/评测任务
#3040 B300 runtime / 运行时 main 11/11
#3041 AMD telemetry / 遥测 main 11/11
#3042 Superseded by #3043 / 已并入
#3043 B200 power + Slurm collector / 功耗及采集 main 7/7
#3044 H200 power / 功耗 #3043 35/35
#3045 GB200 aggregate / 聚合 #3044 13/13
#3046 GB300 aggregate / 聚合 #3045 4/4
#3047 GB300 disaggregated / 分离 #3046 9/9

One-hour profiles; planned counts, not completed measurements. / 标准一小时 Profile;计划任务数,非已完成测量。

中文

中文说明

仅作参考;请勿合并或添加扫描标签。 Kimi-K3 功耗工作已按下表拆分,原始提交 2f3d637f6 保存在 chore/preserve-kimik3-3030-full

测试: 已有 CPU/矩阵检查通过;相对 main@900f1989d,拆分结果逐字节还原 38 个源文件,仅按范围重组 changelog。

待完成: 硬件验证和发布。堆叠依赖合并后,将子 PR 调整为以 main 为基线,按合并规则逐个范围验证;具体阻塞见各子 PR。表中为标准一小时 Profile 的计划基准/评测任务数,并非已完成测量。

Related Issue

Related implementation / 相关实现: #2767, #2926, #2927, #3026.

Type of Change

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

Checklist

  • I have tested my changes locally
  • I have updated documentation if necessary
  • For every change that can affect benchmark performance and every recipe addition or modification, I have appended a new entry to the physical end of perf-changelog.yaml and have not edited historical entries
  • Before merging via reuse, an authorized maintainer (OWNER/MEMBER/COLLABORATOR) has commented /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 sweep label will no longer automatically kick off new sweeps. Remove and re-add the label to force one.

Note

Medium Risk
Changes affect benchmark power validity, Slurm result collection, and many production recipe configs; mistakes could fail sweeps or mis-attribute energy, but scope is telemetry and launch plumbing rather than serving auth or data paths.

Overview
Turns on required DCGM / AgentX power for Kimi-K3 multi-node agentic recipes on B200, H200, GB200, and GB300: Slurm YAML gains telemetry blocks, explicit concurrencies, and (on GB lanes) ENABLE_AGENTX_POWER / REQUIRE_POWER with head client placement. B200 recipes drop localhost metrics URLs where telemetry replaces that path.

AMD monitor teardown in benchmark_lib.sh is reworked: amd-smi streams through a per-run FIFO so rows flush to disk before kill; stop waits on the CSV until every GPU has a usable integer-second tick at or after the stop request (configurable AMD_MONITOR_STOP_TIMEOUT_S), with fast abort teardown on signals. AgentX traps call stop in abort mode so cancelled runs do not block on coverage.

Power integration skips N/A or non-positive samples outside the formal benchmark window, recording them as boundary_degenerate_rows instead of invalidating energy or faking end bracketing.

Cluster launchers route Kimi-K3 power jobs to a pinned srt-slurm producer, inject concurrency lists, and run collect_agentic_power_results (Slurm accounting check, staged logs, --require-power adapter) even when the native job fails. B300 master config moves to cluster b300-dsxe and vLLM image 3696c77; B200 Kimi metadata is corrected to DCP8 with kv-offloading: none. CI docs and perf-changelog.yaml document backfill rules.

Reviewed by Cursor Bugbot for commit 2f3d637. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the contribution! Please reach out to respective companies' CODEOWNER to fill in the latest PR_REVIEW_CHECKLIST.md before pinging core maintainer on Slack for review. In order for the signoff PR check bot to trigger, you must follow the PR_REVIEW_CHECKLIST.md template correctly, including the phrase As a PR reviewer and CODEOWNER, I have reviewed this and have.

For PR verification, add the full-sweep-fail-fast label (strongly recommended) to this PR — the benchmark sweep only runs on labeled PRs. Use full-sweep-enabled only if you need matrix jobs to keep running past a failure.

PR authors are responsible for ensuring that after merging, all GitHub Action jobs fully pass. A lot of the time, failures are just flakes and simply re-running the failed jobs will fix it. See GitHub's docs on re-running failed jobs


感谢你的贡献!请联系相应公司的 CODEOWNER 填写最新的 PR_REVIEW_CHECKLIST.md,然后再在 Slack 上联系核心维护者进行审阅。为了触发 signoff PR 检查机器人,你必须正确遵循 PR_REVIEW_CHECKLIST.md 模板,包括保留英文语句 As a PR reviewer and CODEOWNER, I have reviewed this and have

如需进行 PR 验证,请为此 PR 添加 full-sweep-fail-fast 标签(强烈推荐)— 基准测试 sweep 仅在带有标签的 PR 上运行。仅当需要矩阵任务在失败后继续运行时才使用 full-sweep-enabled

PR 作者有责任确保合并后所有 GitHub Action 任务完全通过。 很多时候失败只是偶发抖动(flake),重新运行失败的任务即可解决。参见 GitHub 关于重新运行失败任务的文档

为 Kimi-K3 AgentX 补测启用必需功耗采集,保留失败诊断并修正 AMD 收尾与硬件元数据。

Signed-off-by: Wenyao Gao <wenyao.gao28@gmail.com>
@claude

claude Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Claude finished @edwingao28's task in 6m 26s —— View job


Review of PR #3030

  • Gather context (diff vs origin/main, changed files)
  • Review benchmark_lib.sh, slurm_utils.sh, runner launchers
  • Review infx/results/power/single_node.py and tests
  • Review recipes, configs/nvidia-master.yaml, perf-changelog.yaml
  • Post inline comments and summary

Summary: No blocking issues found. Two 🟡 warnings posted inline: the new collect_agentic_power_results helper introduces the repo's first hard dependency on sacct and fails a successful run if accounting is unavailable on a cluster, and runners/test_kimik3_bh_power.py is not wired into any CI workflow so its launcher tests only ran locally. The perf-changelog.yaml entry is correctly appended at the end and covers the nvidia-master.yaml edits; cluster:b300-dsxe is a registered label, and dcp-size: 8 with tp: 8 satisfies the matrix divisibility rule.

One question for the author, not a defect I can confirm: the GB200/GB300 recipes set client_placement: head plus ENABLE_AGENTX_POWER/REQUIRE_POWER, while the B200 and H200 recipes set none of these and B200 additionally drops AIPERF_SERVER_METRICS_URLS while keeping AIPERF_REQUIRED_SERVER_METRIC_PREFIX: "vllm:". That still passes if AIPerf auto-scrapes the direct vLLM frontend's /metrics, but it is worth confirming on the first B200 and H200 qualification points that server_metrics_export.json contains vllm: series, since validate_required_agentic_server_metrics fails the run otherwise.

Comment thread runners/slurm_utils.sh
Comment on lines +188 to +193
if ! awk -F'|' -v job="$job_id" '
$1 == job { found = 1; if ($2 != "COMPLETED" || $3 != "0:0") failed = 1 }
END { exit (!found || failed) }
' "$logs_dir/power/native-job-status.txt"; then
rc=1
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 WARNING: Every Kimi-K3 power run now hard-fails when sacct cannot produce a terminal row for the job, and this is the first and only sacct dependency in runners/.

Why it matters: sacct needs slurmdbd accounting storage. If it is not installed or accounting is disabled on any of the four clusters (Nscale B200 is the least certain), the status file stays empty after three attempts, !found trips, rc=1, and a fully successful job with valid power exits non-zero. The unit tests only exercise a stubbed sacct, and none of the seven qualification runs have reached this step yet, so the branch is unverified on real hardware. The failure message would also be indistinguishable from a genuine Slurm failure.

Fix: Fall back to scontrol show job (or squeue's last-seen state) when sacct returns nothing, and make the failure reason explicit:

Suggested change
if ! awk -F'|' -v job="$job_id" '
$1 == job { found = 1; if ($2 != "COMPLETED" || $3 != "0:0") failed = 1 }
END { exit (!found || failed) }
' "$logs_dir/power/native-job-status.txt"; then
rc=1
fi
if ! awk -F'|' -v job="$job_id" '
$1 == job { found = 1; if ($2 != "COMPLETED" || $3 != "0:0") failed = 1 }
END { exit (!found || failed) }
' "$logs_dir/power/native-job-status.txt"; then
if [[ ! -s "$logs_dir/power/native-job-status.txt" ]]; then
# Accounting unavailable: fall back to the controller's view so a
# successful job is not failed for a missing sacct row.
scontrol show job "$job_id" > "$logs_dir/power/native-job-scontrol.txt" 2>&1 || true
if ! grep -Eq 'JobState=COMPLETED .*ExitCode=0:0' "$logs_dir/power/native-job-scontrol.txt"; then
echo "ERROR: could not confirm job $job_id COMPLETED via sacct or scontrol" >&2
rc=1
fi
else
echo "ERROR: job $job_id did not finish COMPLETED with ExitCode 0:0" >&2
rc=1
fi
fi

@@ -0,0 +1,141 @@
import os

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 WARNING: This new test file is not executed by any CI workflow.

Why it matters: .github/workflows/test-process-result.yml runs pytest from utils/ with an explicit file list, and test-changelog-gate.yml only picks up runners/test_slurm_utils.py. The 9 B200/H200 launcher tests described in the PR checklist therefore only ran locally, and future edits to the two launchers' routing or failure-staging blocks will not be caught.

Fix: Either move this file to utils/ and add it to the pytest list in test-process-result.yml (that workflow already triggers on runners/launch_b200-nscale-slurm.sh and runners/launch_h200-dgxc-slurm.sh), or add runners/test_kimik3_bh_power.py to the test-changelog-gate.yml invocation alongside runners/test_slurm_utils.py. I cannot edit workflow files from this bot.

将已下架的 5894fdf 镜像替换为可获取的 3696c77 构建,并追加性能变更记录。此提交仅修复镜像引用;DSXE RDMA 兼容性及端到端功耗验证仍待完成。

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Beyond the inline finding, I also checked two other candidates that were ruled out: _wait_for_amd_stop_coverage in benchmarks/benchmark_lib.sh falls back to the old fixed sleep when _amd_monitor_min_covered_tick returns empty, which is a safe degrade for non-epoch/unusable streams rather than a bug; and in runners/launch_b200-nscale-slurm.sh, a Slurm job that fails before creating LOGS_DIR still exits non-zero via the pre-existing [ ! -d "$LOGS_DIR" ] check even though the AgentX diagnostics-staging path is skipped, so failures are still correctly propagated.

Extended reasoning...

Beyond the already-posted inline finding (missing REQUIRE_POWER/ENABLE_AGENTX_POWER in the new B200/H200 recipe benchmark.env blocks), I traced two other candidates from the ruled-out list to confirm they are not additional bugs: (1) benchmarks/benchmark_lib.sh's _wait_for_amd_stop_coverage/_amd_monitor_min_covered_tick pair — when the tick helper returns empty (non-epoch timestamps or unusable CSV), the caller intentionally falls back to the pre-existing fixed sleep-and-return behavior rather than hanging or silently skipping cleanup, so this is a deliberate compatibility fallback, not a regression. (2) runners/launch_b200-nscale-slurm.sh's post-stream_slurm_job_log flow — for the new AgentX path, a Slurm job that fails before LOGS_DIR is ever created no longer exits immediately at the stream_slurm_job_log call, but it still hits the pre-existing if [ ! -d "$LOGS_DIR" ]; then ... exit 1; fi guard a few lines later and exits non-zero, so job failures are still correctly propagated even though the newly-added diagnostics-staging message is skipped in that specific corner case.

type: custom
concurrencies: [1]
command: bash /infmax-workspace/benchmarks/multi_node/agentic_srt.sh
env:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 (optional) The 7 new B200 and 3 new H200 Kimi-K3 AgentX recipes never set ENABLE_AGENTX_POWER/REQUIRE_POWER in benchmark.env, unlike the 13 GB200/GB300 recipes added in the same PR which set both to "1". Without REQUIRE_POWER, benchmark_lib.sh's early _write_agentx_multinode_window check always returns 0 even when the power window/telemetry setup is broken, so a bad setup is only caught by the login-node's post-hoc collect_agentic_power_results after the full ~1h benchmark runs, wasting the GPU job instead of failing in seconds like GB200/GB300 do. Fix: add REQUIRE_POWER: "1" (and ENABLE_AGENTX_POWER: "1") to all 10 B200/H200 recipe env blocks.

Extended reasoning...

run_agentic_replay_and_write_outputs() in benchmarks/benchmark_lib.sh reads REQUIRE_POWER via case "${REQUIRE_POWER:-0}" before calling _write_agentx_multinode_window; when unset it omits --require-power, so power_adapter.py's run_agentic_power/_fail_multinode_adapter always return 1 if require_power else 0 i.e. 0. The if [ "$power_rc" -ne 0 ]; then return "$power_rc"; fi guard right after the 'running' window write therefore never trips for B200/H200, letting the full replay run to completion even with broken telemetry. GB200/GB300 recipes set REQUIRE_POWER: "1" so they fail within seconds at the same check. Only the launcher's collect_agentic_power_results (hardcoded --require-power) catches it afterward on B200/H200, after the whole multi-node job already ran.

Verification: Severity: nit. The factual/mechanistic claim is real and verified. The 13 GB200/GB300 recipes set ENABLE_AGENTX_POWER="1" and REQUIRE_POWER="1" in benchmark.env (e.g. agg-gb200-tp8pp2-mooncake-c16-agentic.yaml:133-134), but the 7 B200 and 3 H200 recipes add only the telemetry block and concurrencies, no power env keys. On the compute node, agentic_srt.sh:149 calls… | nit. The 10 B200/H200…

@edwingao28

Copy link
Copy Markdown
Collaborator Author

close as this pr has been replaced by multiple smaller pr

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant