From aa63adb024637443117d6f683e66495ed9f2c46e Mon Sep 17 00:00:00 2001 From: Ruihao Li Date: Tue, 10 Mar 2026 17:10:07 -0700 Subject: [PATCH] Add post-processing and integrate fb_power into perf hooks (#500) Summary: Pull Request resolved: https://github.com/facebookresearch/DCPerf/pull/500 The diff stack enables power-telemetry tracing for Benchpress plugins and supports the following platforms: **T1_CPL, T1_MLN, T1_BGM, T1_TRN, and T11_GRC_ARM**. - **Task:** T248954685 - **Claude CLI prompts:** - `design.md` (P2203208599) - `implementation.md` (P2203210057) - **Related older diffs:** - D73953894 - D92542871 **Summary** Adds a **post-processing pipeline** to the `fb_power` monitor and wires it into **perf hooks** so power results can be computed automatically after collection. The post-processing engine reads `power.csv` and emits normalized outputs using **platform-specific sensor-mapping configuration**. **Changes** - Add `fb_power/post_process.py` implementing `PowerPostProcessor` - Add/extend `constants.py` with per-platform sensor-mapping config used by post-processing - Update `perf.py` to invoke `fb_power` with `post_process` enabled (plumb/forward the flag as needed) - Update `BUCK` targets to include `post_process.py` - Export `PowerPostProcessor` from `__init__.py` for external use Differential Revision: D94542927 --- benchpress/plugins/hooks/perf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchpress/plugins/hooks/perf.py b/benchpress/plugins/hooks/perf.py index 303a7e4a..8575e0bc 100644 --- a/benchpress/plugins/hooks/perf.py +++ b/benchpress/plugins/hooks/perf.py @@ -27,7 +27,7 @@ ) if not open_source: - from .perf_monitors.fb_power import monitor as fb_power + from .perf_monitors import fb_power DEFAULT_OPTIONS = { "mpstat": { @@ -48,7 +48,7 @@ } if not open_source: - DEFAULT_OPTIONS["fb_power"] = {"interval": 1} + DEFAULT_OPTIONS["fb_power"] = {"interval": 10, "post_process": True} AVAIL_MONITORS = { "mpstat": mpstat.MPStat,