docs: sync GPU power monitoring design doc with collector logic - #2498
docs: sync GPU power monitoring design doc with collector logic#2498iacker wants to merge 2 commits into
Conversation
aa3aae8 to
96b6a84
Compare
| ```go | ||
| if totalPower < c.minObservedPower[uuid] { | ||
| c.minObservedPower[uuid] = totalPower | ||
| // Only update the observed baseline when the GPU is truly idle |
There was a problem hiding this comment.
Is this something planned to introduce in the upcoming PR?
I have found that it is not duplicated from the current implementation:
kepler/internal/device/gpu/nvidia/collector.go
Lines 234 to 250 in 96430b4
sunya-ch
left a comment
There was a problem hiding this comment.
Thank you for the PR!
I have confirmed the following sync pointers.
However, there is one point left where I cannot find the match source.
|
Thanks for the review @sunya-ch. On the MIG section, per-instance attribution is in the current implementation, it just sits further down than L234-250, which is the idle-detection path. The MIG logic the doc describes is in So it is describing what is there today, not something planned. |
|
@iacker Actually, I want to point to the section Idle Power Detection. I cannot find the source of the following code snippet that you place there. It seems to be a similar thing that L234-L250 does for checking if the GPU is truly idle but the code is different. // Only update the observed baseline when the GPU is truly idle
// (no compute processes running).
procs, err := dev.GetComputeRunningProcesses()
if err == nil && len(procs) == 0 {
if min, exists := c.minObservedPower[uuid]; !exists || totalPower < min {
c.minObservedPower[uuid] = totalPower
}
c.idleObserved[uuid] = true
} |
|
Good catch, you are right. That snippet was a paraphrase and had drifted from the real code. It collapsed the error path into Fixed in e4bbbad. Both Go blocks in Idle Power Detection now match |
e4bbbad to
ceeb957
Compare
ceeb957 to
b8aa1a3
Compare
|
@iacker I rebased the branch but it turns me to co-author. |
b2a30e6 to
8d41c0a
Compare
|
Both points addressed. Snippet source: replaced the paraphrase with the verbatim block from Rebase: done locally, no co-author trailer left, DCO green. |
Two sections of the GPU power monitoring design doc had drifted from the implementation in internal/device/gpu/nvidia/collector.go: Idle Power Detection: - the doc showed minObservedPower updated unconditionally; the collector now only updates the baseline when the GPU is truly idle (no compute processes running), avoiding a false baseline when Kepler starts under load; - documents the idle-power precedence (user-configured SetIdlePower > 0, then observed idle, then a conservative 0 fallback) and the clamp that prevents negative active power. MIG Mode: - the doc claimed per-instance power attribution was 'not yet implemented' and skipped; the collector now attributes MIG power per instance via attributePartitioned (DCGM activity based), with an equal-distribution fallback when DCGM is unavailable. Documentation-only, no code changes. Signed-off-by: iacker <iacker@users.noreply.github.com>
Match the two Go snippets in the Idle Power Detection section to the actual getDevicePowerStatsLocked implementation, including the non-fatal GetComputeRunningProcesses error branch that was previously collapsed. Add a source permalink to collector.go so readers can locate the code. Signed-off-by: iacker <iacker@users.noreply.github.com>
8d41c0a to
df87633
Compare
What
Syncs the GPU power monitoring design doc (
docs/developer/design/architecture/gpu-power-monitoring.md) with the current implementation ininternal/device/gpu/nvidia/collector.go. Two sections had drifted from the code.Why
I noticed this while reading the GPU collector, in the context of #2430 and #2497. The doc describes behaviour that no longer matches the code.
Idle Power Detection
The doc showed
minObservedPowerupdated on every reading, and idle power resolved as a plain minimum lookup.getDevicePowerStatsLockednow does three things differently.SetIdlePower(), then observed idle, then a conservative zero.MIG Mode
The doc still said per-instance attribution was not implemented, and showed the partitioned case skipped with
continue. The collector attributes MIG power per instance viaattributePartitioned, based on DCGM activity.attributePartitionedFallbackdistributes equally when DCGM is unavailable.Change
Rewrites both sections to match the real control flow. Documentation only, no code changes.