Skip to content

[AgentX B200] enable Kimi-K3 power and correct DCP metadata / 启用功耗并修正元数据 - #3043

Merged
edwingao28 merged 4 commits into
mainfrom
feat/kimik3-b200-power
Sep 12, 2026
Merged

edwingao28 merged 4 commits into
mainfrom
feat/kimik3-b200-power

Conversation

@edwingao28

@edwingao28 edwingao28 commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Description

Enable required power for seven B200 Kimi-K3 recipes through the shared collector. Preserve failure artifacts, resolve collector imports, and align DCP8/offload metadata.

Testing: 360 CPU tests, current-head CI and reuse authorization checks passed. Full sweep at 6fc95245: seven power/accounting points and seven tool-schema evals validated; collector-only replay unchanged. Request errors retained.

Pending: Core/CODEOWNER approval, checklist signoff and main publication.

中文

中文说明

启用七个 B200 Kimi-K3 配方的必需功耗采集,复用公共采集器。保留失败产物、修正采集器导入,并对齐 DCP8/offload 元数据。

测试: 360 项 CPU 测试、当前提交 CI 及复用授权检查通过。6fc95245 的完整 sweep 中,七个功耗及请求核算点、七个工具 schema eval 均已核验;采集器修复后的重放结果不变。保留请求错误。

待完成: Core/CODEOWNER 审批、清单签核及主分支发布。

Related Issue

Scope index and shared policy / 范围索引与共同规则: #3030.

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 official benchmark recipes, master search-space metadata, and Slurm launch/power validation paths that gate published energy numbers and job success semantics.

Overview
Turns on required DCGM power telemetry for the seven B200 Kimi-K3 agentic vLLM Slurm recipes: each YAML now declares telemetry (dcgm-power, pinned exporter), explicit concurrencies, and drops AIPERF_SERVER_METRICS_URLS.

Master config for kimik3-fp4-b200-dynamo-vllm-agentic-dspark now records DCP8 with KV offload disabled (kv-offloading: none, dcp-size: 8) instead of Mooncake DRAM offload, matching the serving setup.

The B200 nscale launcher adds an AgentX power lane for Kimi-K3 agentic runs: checkout a separate pinned srt-slurm producer, copy agentic recipes into the clone, inject power concurrencies before srtctl apply, and after the job call collect_agentic_power_results (Slurm sacct checks + per-concurrency power_adapter) while still staging logs before failing on power validation. Slurm stream failures no longer abort early on this lane. DCGM exporter cold import now passes the full image ref to import_squash so Enroot gets a single # registry separator.

Adds collect_agentic_power_results in slurm_utils.sh, runners/test_kimik3_bh_power.py, an agentic collection contract test, CI path/trigger updates, and a perf-changelog.yaml entry.

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

收集并校验 AgentX Slurm 功耗结果,保留原生任务失败证据。
启用 Kimi-K3 B200 实测功耗并修正 DCP 与 Offload 元数据。
@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 关于重新运行失败任务的文档

@edwingao28
edwingao28 changed the base branch from feat/agentx-slurm-power-results to main September 12, 2026 04:55
@edwingao28
edwingao28 marked this pull request as ready for review September 12, 2026 04:59
@edwingao28
edwingao28 requested a review from a team September 12, 2026 04:59
@claude

claude Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Claude finished @edwingao28's task in 5m 45s —— View job


Review of PR #3043

  • Gather context (AGENTS.md, diff vs origin/main)
  • Review launcher / slurm_utils.sh power collector changes
  • Review recipe YAML + master config + perf-changelog changes
  • Run the CPU tests mentioned in the PR — not possible in this sandbox (pytest, bash -n, and infx.matrix.generate were all denied approval), so the tests were reviewed statically only
  • Post inline comments and summary

Summary

No blocking issues found. Two 🟡 warnings posted inline:

  1. runners/test_kimik3_bh_power.py is not executed by any CI workflow (test-changelog-gate.yml only runs test_slurm_utils.py; test-process-result.yml has an explicit file list), so the five B200 tests only ever run locally. test-process-result.yml also does not list runners/slurm_utils.sh in its paths:.
  2. collect_agentic_power_results treats an empty sacct result as a failed job. No other launcher in the repo depends on sacct, so please confirm accounting is available on the nscale login node before enabling this lane, or add a fallback so accounting unavailability is not reported as a benchmark failure.

Checks that passed: configs/nvidia-master.yaml and perf-changelog.yaml are edited together and the new entry is appended at the tail with the existing blank-line separator; it is not append-only. All seven recipes carry identical telemetry: blocks, concurrencies: matching their filename, decode-context-parallel-size: 8, and enable_offload: false, so dcp-size: 8 / kv-offloading: none in the master config now match the serving commands. The DCGM exporter fix is correct: the old code pre-substituted nvcr.io# and enroot_uri_for_image then added a second #. Removing AIPERF_SERVER_METRICS_URLS is safe because the aggregated vLLM frontend's /metrics is auto-detected and the gb300 recipes already run with only AIPERF_REQUIRED_SERVER_METRIC_PREFIX. The import_squash / enroot import docker:// reproducibility pattern is retained and the container image is public.

Note: the inferencemax-repos MCP server failed to connect this session, so vLLM source was not consulted for the MooncakeStoreConnector enable_offload: false semantics behind the kv-offloading: none metadata change; CODEOWNERs should confirm that interpretation.
· Branch

@@ -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: test-changelog-gate.yml only runs runners/test_slurm_utils.py, and test-process-result.yml runs an explicit file list under utils/ that does not include this file. The "B200 (5) CPU tests" in the PR description therefore only pass locally; a regression in the launcher routing, the failed-job artifact staging, or the exporter import URI would go unnoticed by CI. (test-process-result.yml also does not list runners/slurm_utils.sh in its paths:, so future edits to collect_agentic_power_results would not trigger the collector test added in utils/test_gb300_power_official_contract.py.)

Fix: Add runners/test_kimik3_bh_power.py to the paths: filter and to the pytest invocation in .github/workflows/test-process-result.yml (or move the file under utils/ next to the other power contract tests), and add runners/slurm_utils.sh to that workflow's paths:. I cannot edit workflow files from this bot, so this needs to be done by the author.

Comment thread runners/slurm_utils.sh
Comment on lines +175 to +192
for attempt in 1 2 3; do
echo "$attempt" > "$logs_dir/power/native-job-status-attempts.txt"
sacct -X -n -P -j "$job_id" --format=JobIDRaw,State,ExitCode \
> "$logs_dir/power/native-job-status.txt" \
2>> "$logs_dir/power/native-job-status.stderr" || true
if awk -F'|' -v job="$job_id" '
$1 == job && $2 !~ /^(PENDING|RUNNING|COMPLETING)$/ { found = 1 }
END { exit !found }
' "$logs_dir/power/native-job-status.txt"; then
break
fi
if [[ "$attempt" != "3" ]]; then sleep 5; fi
done
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

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: The collector hard-fails every point when sacct returns no row for the job, and sacct is not used by any other launcher in this repo.

Why it matters: If the nscale login node does not have Slurm accounting storage enabled (or sacct is not on PATH for the runner user), the sacct call at line 177 writes nothing to native-job-status.txt, the found check at line 188 fails, rc=1, and every Kimi-K3 B200 power run exits non-zero after the benchmark and power capture succeeded. The only evidence would be native-job-status.stderr inside the LOGS bundle.

Fix: Please confirm sacct -X -n -P -j <id> returns a row on the nscale login node before enabling the lane, or add an explicit fallback so accounting unavailability is distinguishable from a failed job, e.g.:

Suggested change
for attempt in 1 2 3; do
echo "$attempt" > "$logs_dir/power/native-job-status-attempts.txt"
sacct -X -n -P -j "$job_id" --format=JobIDRaw,State,ExitCode \
> "$logs_dir/power/native-job-status.txt" \
2>> "$logs_dir/power/native-job-status.stderr" || true
if awk -F'|' -v job="$job_id" '
$1 == job && $2 !~ /^(PENDING|RUNNING|COMPLETING)$/ { found = 1 }
END { exit !found }
' "$logs_dir/power/native-job-status.txt"; then
break
fi
if [[ "$attempt" != "3" ]]; then sleep 5; fi
done
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
for attempt in 1 2 3; do
echo "$attempt" > "$logs_dir/power/native-job-status-attempts.txt"
sacct -X -n -P -j "$job_id" --format=JobIDRaw,State,ExitCode \
> "$logs_dir/power/native-job-status.txt" \
2>> "$logs_dir/power/native-job-status.stderr" || true
if awk -F'|' -v job="$job_id" '
$1 == job && $2 !~ /^(PENDING|RUNNING|COMPLETING)$/ { found = 1 }
END { exit !found }
' "$logs_dir/power/native-job-status.txt"; then
break
fi
if [[ "$attempt" != "3" ]]; then sleep 5; fi
done
if ! grep -q . "$logs_dir/power/native-job-status.txt"; then
echo "ERROR: sacct returned no accounting row for job $job_id; see $logs_dir/power/native-job-status.stderr" >&2
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
rc=1
fi

@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.

I reviewed this PR and didn't find any bugs. Because it changes SLURM launcher control flow (continuing past a failed job to stage power evidence) and introduces a second pinned power producer (AGENTX_POWER_SRT_SLURM_PIN) alongside the existing POWER_SRT_SLURM_PIN, a human look would still be worthwhile.

What was reviewed: the USES_AGENTX_POWER routing and pin-verification path in runners/launch_b200-nscale-slurm.sh, the new collect_agentic_power_results helper in runners/slurm_utils.sh, the DCGM exporter enroot URI fix, and the recipe/master-config/perf-changelog trio for the seven B200 Kimi-K3 recipes. Checked and ruled out: dropping AIPERF_SERVER_METRICS_URLS while keeping AIPERF_REQUIRED_SERVER_METRIC_PREFIX — the dropped URL was identical to the frontend's own AIPERF_SERVER_URL (vllm-frontend, non-dynamo topology), which benchmark_lib.sh already auto-scrapes, so it was redundant; and the 3-retry/~15s sacct polling in collect_agentic_power_results treating a non-terminal row as failure — by the time this function runs, stream_slurm_job_log has already waited for the job to leave the live queue, so the retries only cover accounting-DB lag, not a job that's still actually running. The enroot URI fix was verified against the old code path, which did produce a double # separator for the DCGM exporter image; the new test confirms a single separator.

Extended reasoning...

Overview

This PR wires official DCGM power telemetry into the seven existing B200 Kimi-K3 agentic (vLLM, FP4, TP8/PP2, mooncake) recipes and adds a distinct "AgentX power" pipeline (separate srt-slurm pin, staged recipes, per-concurrency power injection) alongside the existing fixed-sequence dcgm-power lane. It touches recipe YAMLs, the matching master-config search-space entries (kv-offloading/dcp-size correction), the B200 Slurm launcher, a new shared collect_agentic_power_results helper in slurm_utils.sh, and adds/extends two test files.

Security risks

No injection, auth, or data-exposure concerns. The main integrity-relevant surface is the new pinned commit (AGENTX_POWER_SRT_SLURM_PIN) used for a git clone+checkout, which is verified against git rev-parse HEAD before use (same pattern as the existing POWER_SRT_SLURM_PIN), and a container image import path (DCGM exporter) that is checksummed and validated with unsquashfs -l. No secrets or credentials are introduced in the diff.

Level of scrutiny

This warrants a full/careful review rather than a rubber-stamp: it changes SLURM launcher control flow (no longer exiting immediately on a failed job, to allow post-job power-evidence staging), adds a second power-producer pin with its own trust/verification discipline, and modifies control-flow-sensitive bash (retry/failure classification for sacct). These are exactly the kind of infra changes where a subtle off-by-one or race could silently corrupt or mask benchmark results, even though I did not find such a bug in the specific paths I traced.

Other factors

Test coverage is solid and exercises the real implementation: test_kimik3_bh_power.py sources the actual launcher script with mocked git/cp/sacct/enroot to test power-path routing, pin-mismatch failure, evidence-preservation-before-exit, and the exporter URI fix; test_gb300_power_official_contract.py adds a parametrized test that calls collect_agentic_power_results directly (not a re-implementation) across completed/failed/incomplete-sweep scenarios. The perf-changelog.yaml entry is a clean append at the tail, and the recipe/master-config pairing (kv-offloading: none + dcp-size: 8) is consistent across all seven recipes. I traced two candidate concerns from the bug-hunting pass to their root cause and found both explained by design (frontend metrics auto-detection redundancy; job-already-left-queue precondition for the sacct retry loop), so I'm not raising them independently, but the launcher's altered exit-on-failure behavior and the new pin's provenance are the kind of design choices worth a maintainer's explicit sign-off.

从共享脚本所在的仓库解析功耗适配器,并在 CI 中执行 B200/H200 路由与结果收集测试。
@github-actions

Copy link
Copy Markdown
Contributor

@edwingao28

Copy link
Copy Markdown
Collaborator Author

/reuse-sweep-run 34674595026

在最终提交触发复用校验,保留已验收的 B200 源码祖先与测量结果。
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