[4/4] [Power] feat: strict AMD gpu monitor lifecycle for MI355X / MI355X 单节点功率监控严格生命周期 - #2494
Conversation
|
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 For PR verification, add the 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 模板,包括保留英文语句 如需进行 PR 验证,请为此 PR 添加 PR 作者有责任确保合并后所有 GitHub Action 任务完全通过。 很多时候失败只是偶发抖动(flake),重新运行失败的任务即可解决。参见 GitHub 关于重新运行失败任务的文档 |
|
Claude finished @edwingao28's task in 3m 45s —— View job Review
LGTM - no blocking issues found. Checked specifically: the refactored Note: I could not run pytest in this environment (command approval denied), so I relied on static review; the suites run in CI. |
There was a problem hiding this comment.
I didn't find any bugs, but this PR is worth a human look given it makes several hardware-timing assumptions about AMD's amd-smi tool (a magic interval+2s sleep to bracket the window boundary, buffering behavior under kill) that are hard to verify outside the actual MI355X hardware they were tuned against, and it touches the power-measurement pipeline behind the published benchmark anchor numbers.
What was reviewed: the AMD stop-lifecycle sleep/kill/repair sequence in benchmark_lib.sh, the awk fflush buffering fix, and the new cross_check_accumulator GPU-set matching/tolerance logic in aggregate_power.py (advisory only, does not affect power_valid). Checked that the accumulator cross-check intersects GPU IDs between start/end snapshots and the stream rather than assuming matching populations, and that a hung amd-smi call in the monitor sidecars is bounded by the surrounding job timeout rather than blocking indefinitely — both raised as candidates and not reproducible in the diff.
Extended reasoning...
This PR hardens the AMD branch of the single-node GPU power-monitor lifecycle (benchmark_lib.sh), adds an advisory hardware energy-accumulator cross-check (utils/aggregate_power.py), and wires three new sidecar artifacts through the benchmark CI template. It is part of a stacked cross-platform power-measurement series (#2323 → #2437 → #2456 → this PR).
Security risk is minimal — no auth, secrets, or user-facing surface is touched; the changes are internal CI/benchmarking tooling that shells out to amd-smi/nvidia-smi and writes local CSV/JSON artifacts.
The level of scrutiny warranted is higher than a typical CI tweak because this pipeline computes the power/energy metrics used in externally-published benchmark numbers (the PR body includes an anchor-results table with J/token and W/GPU figures). The bash changes rely on empirically-tuned timing (a before killing the AMD watch stream, PYTHONUNBUFFERED + per-row fflush to avoid losing buffered samples on kill) that the author validated against real MI355X hardware runs, but which cannot be independently re-verified without that hardware. The Python cross-check is well isolated and explicitly advisory (never affects power_valid), which limits its blast radius, but the bash lifecycle changes directly gate whether a run's telemetry is considered valid.
Other factors: test coverage is extensive (new bash lifecycle tests mirroring the NVIDIA harness, a real-header column-detection regression test, and 11 accumulator cross-check unit tests), and the bug-hunting pass found no defects, including on the specific hardware-timing and GPU-set-matching concerns a finder raised. Given the combination of non-trivial hardware-specific timing logic and downstream use in published metrics, I'd still like a human familiar with the AMD tooling to confirm the timing assumptions before merge.
…55X 单节点功率监控严格生命周期 Rebuild the stacked-PR history while preserving the merged source tree. / 在保留合并后代码树的前提下重建堆叠 PR 历史。
ad78ff0 to
a948565
Compare
…1p1d / 打开 gb200/gb300 官方 1P1D 能耗采集 (#2456) * [3/4] [Power] feat: enable official dcgm energy lane for gb200/gb300 1p1d / 打开 gb200/gb300 官方 1P1D 能耗采集 Rebuild the stacked-PR history while preserving the merged source tree. / 在保留合并后代码树的前提下重建堆叠 PR 历史。 * [4/4] [Power] feat: strict AMD gpu monitor lifecycle for MI355X / MI355X 单节点功率监控严格生命周期 (#2494) Rebuild the stacked-PR history while preserving the merged source tree. / 在保留合并后代码树的前提下重建堆叠 PR 历史。
Hardens the AMD branch of the single-node GPU power monitor so MI355X runs produce strictly valid energy data through the same pipeline as NVIDIA. Stacked on #2323 (PR1); part of the cross-platform power series (#2323 → #2437 → #2456).
What changes
stop_gpu_monitorwaits one extra tick on AMD before killing the watch stream, so the last benchmark window's right edge is always bracketed for boundary interpolation. The amd-smi one-shot CSV has no timestamp column, so the NVIDIA-style "append one post-exit sample" approach cannot work on AMD.gpu_metrics_energy_{start,end}.csv) plus agpu_metrics_identity.jsonstatic dump. The accumulator endpoint delta gives auditors an independent cross-check of the trapezoid integral.benchmark-tmpl.ymluploads the three sidecars in the gpu_metrics and power_audit artifacts (if-no-files-found: ignore, so non-AMD lanes are unaffected).Ground truth (measured on an MI355X compute node inside the production sglang-rocm container, AMDSMI 26.2.0 / host ROCm 7.1.1):
timestamp,...header, epoch-second timestamps, bare-numbersocket_power; the header also containspower_management, so a test now pins column detection tosocket_powermetric -E --csvcarriesgpu,total_energy_consumptionTests: 3 new bash lifecycle tests (mirroring the existing NVIDIA harness) + 1 real-header column-detection pin + 11 accumulator cross-check tests;
test_process_result.py+test_aggregate_power.py= 97 passed. The cross-check ships inaggregate_power.pyas an advisoryaccumulator_checkblock in the validation payload — it never affectspower_valid.中文说明
把单节点 GPU 功率监控的 AMD 分支补齐到严格生命周期,使 MI355X 与 NVIDIA 走同一条能量管线:
依据为 MI355X 计算节点上生产容器内的实测(AMDSMI 26.2.0):调用延迟 p95 80.9ms、累加器单调且单位为焦耳、每秒增量与瞬时功率一致、watch 表头含 power_management 陷阱列(已用测试钉死列探测)。
Anchor results, N=3 per platform (mean over 3 independent dispatches; CV% in parentheses; Qwen3.5-397B-A17B-FP8, 8k1k, sglang). MI355X: 30960241075, 30962586410, 30964321893. B200: 30958610420, 30962588049, 30964371690. Every window power_valid=1.
On MI355X the hardware energy-accumulator cross-check ran in production on all six windows: relative error vs the trapezoid integral 0.07%–1.30%, all within the 5% advisory tolerance. The b200 TP8 c4 row rides along because the sweep matrix has no TP filter; it is reported for completeness, not compared against TP4 rows.
中文:两平台各 3 次独立 dispatch 的锚点复现表。J/out-tok 的 CV 最差 2.37%(b200 TP4 c4),MI355X 两档均 ≤1.16%;MI355X 六个窗口的硬件累加器交叉验证误差 0.07%–1.30%,全部在 5% 容差内。TP8 c4 行是 sweep 矩阵无 TP 过滤的顺带产物,仅作记录。