Cpu usage semantics#61
Open
homm wants to merge 5 commits into
Open
Conversation
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR ports the frequency/usage calculation fixes from #59.
Summary
It changes how usage tuples are calculated:
0 MHz / 0%instead of being forced to the minimum DVFS frequency.The JSON shape is unchanged:
ecpu_usage,pcpu_usage, andgpu_usageare still[freq_mhz, usage].Why
In the previous implementation,
calc_freqscaled usage byavg_freq / max_freq, and the result was exposed through fields such aspcpu_usage:That mixes occupancy with frequency. Under Low Power Mode, thermal limits, or any workload where frequency and occupancy diverge, a fully busy core can look partially idle just because it is not running at the theoretical maximum frequency.
Issue #46 correctly pointed out that the reported value was misleading. The problem was likely not that one CPU cluster was being dropped, but that the metric itself under-reported occupancy by folding frequency into usage.
This PR first computes usage from residency, then aggregates CPU cluster values as a compact "effective load at shown active frequency" summary.
Examples
All examples use a 10-core P-cluster with
min_freq = 1250 MHzandmax_freq = 4500 MHz.All idle
Why: if the cluster has no active residency in the sample window, there is no observed active frequency to report.
One active core
Why: one of ten cores is fully occupied, and the active work is running at 3600 MHz.
One active core, idle cores still report frequency
Why: idle cores may still carry a reported frequency, but the cluster summary should describe active work.
One peak core plus low-frequency active cores
Why: the summary keeps the observed peak active frequency visible, while lower-frequency work contributes proportionally less to effective load at that frequency.
All cores fully active under frequency limits
Why: the cluster is fully occupied. A lower frequency caused by thermal or power limits should not make fully busy cores look idle.