feat(monitor): query all NPU/GPU engines and take max utilization#716
Merged
Conversation
Contributor
Author
|
Also tested vitisa, migraphx |
timenick
reviewed
May 25, 2026
Collaborator
timenick
left a comment
There was a problem hiding this comment.
Two findings on the multi-engine PDH aggregation: the PR is about aggregation correctness, so I want it pinned by tests and documented for future readers.
timenick
approved these changes
May 25, 2026
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.
Summary
PdhPollerpreviously locked onto a single engine per adapter (first alphabeticalCompute*for NPU,3Dfor GPU). On NPUs with multipleCompute_*engines, work scheduled to a non-monitored engine read as 0% utilization; on GPUs where DML lands on a Compute engine, the3D-only query missed the activity entirely.build_adapter_querynow takesengine_types: tuple[str, ...]and registers oneutil_<engtype>+running_time_<engtype>counter per matching engine.build_npu_querycovers allCompute_*;build_gpu_querycovers both3DandCompute_*.PdhPoller._poll_loopaggregates samples withmax()acrossutil_*keys — each counter is a per-engine ratio over the same sample window, so max reports the most-loaded engine. Summing percentages would exceed 100% on multi-engine adapters and duplicate the signal that running-time already provides.running_time_delta_nssums per-engine deltas — Running Time is wall-clock ns per engine, and engines are independent HW that can run in parallel, so total adapter compute time is additive.resolve_adapter_luid) is untouched; this only changes how counters are registered and aggregated for the resolved adapter.🤖 Generated with Claude Code