Conversation
lasch
left a comment
There was a problem hiding this comment.
Thank you @WarningRan
A self-contained stage to extract power stats. 👍
A few of the items in the drain() for-loops (e.g. Step 1) might be possible to move into the same function that collects the power_counters (might require changing the position of the overall pipeline step to a place after events are sorted by time stamp. That could remove the need to do the extra sorting and get rid of that first for loop.)
But that's functional sugar and optimization like that can be done later.
May I ask you to address the flake8 warnings. They're currently passing the tests but a pending PR #82 will enforce the code formatting and this could then force other people to fix code formatting for changes they didn't make.
4b98a24 to
186352d
Compare
Signed-off-by: Zhuoran-Liu <zhuoran.liu@ibm.com>
Add Power Statistics Analysis Pipeline Stage
Summary
This PR introduces a new pipeline stage to analyze power consumption statistics. It provides time-weighted insights by correlating power counter data with kernel execution timelines, allowing for a clear distinction between "active computation" and "idle" power profiles.
Key Features
Cmpt Exec).mean_non_zero,median_non_zero).avg_total).--power-statsflag.Output Example
Implementation Details
Core Algorithm: Period Splitting
The implementation employs a "Timeline Slicing" approach:
Metrics Definition
Weighted Mean = sum(Power_nz * Duration_nz) / sum(Duration_nz). It reflects hardware intensity during active/powered states.Energy = Average_Power * Total_Time) calculations.Changes
power_stats.pycontainingPowerStatisticsContextand the core analysis logic.--power-statsargument toacelyzer.pyand registered the new stage in the event pipeline.pipeline/__init__.pyto export the new context and dispatch functions.everything.json.torch_minimal.json(disabled by default) for consistency.Usage
To enable power statistics in your trace analysis: