-
Notifications
You must be signed in to change notification settings - Fork 6
AmdSmi gpu power mismatch check #298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jaspals3123
wants to merge
1
commit into
development
Choose a base branch
from
jaspal_powerchecks
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+125
−3
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,7 @@ | |
| Processes, | ||
| XgmiMetrics, | ||
| ) | ||
| from .analyzer_args import AmdSmiAnalyzerArgs | ||
| from .analyzer_args import AmdSmiAnalyzerArgs, PowerConfig | ||
| from .cper import CperAnalysisTaskMixin | ||
|
|
||
|
|
||
|
|
@@ -235,6 +235,54 @@ def check_expected_max_power( | |
| console_log=True, | ||
| ) | ||
|
|
||
| def check_power_cap_consistency( | ||
| self, | ||
| amdsmi_static_data: list[AmdSmiStatic], | ||
| power_config: PowerConfig, | ||
| ) -> None: | ||
| """Check that all GPUs have the same resolved maximum power cap.""" | ||
| if power_config.power_cap_mismatch_allowed: | ||
| return | ||
|
|
||
| power_caps: dict[int, float] = {} | ||
| for gpu in amdsmi_static_data: | ||
| limit = gpu.limit | ||
| max_power_vu = limit.resolved_max_power() if limit is not None else None | ||
| if max_power_vu is None or max_power_vu.value is None: | ||
| self._log_event( | ||
| category=EventCategory.PLATFORM, | ||
| description=f"GPU {gpu.gpu}: power cap is not available", | ||
| priority=EventPriority.WARNING, | ||
| data={"gpu": gpu.gpu}, | ||
| console_log=True, | ||
| ) | ||
| continue | ||
|
|
||
| try: | ||
| power_caps[gpu.gpu] = float(max_power_vu.value) | ||
| except (TypeError, ValueError): | ||
| self._log_event( | ||
| category=EventCategory.PLATFORM, | ||
| description=f"GPU {gpu.gpu}: power cap is invalid", | ||
| priority=EventPriority.WARNING, | ||
| data={"gpu": gpu.gpu, "power_cap": max_power_vu.value}, | ||
| console_log=True, | ||
| ) | ||
|
|
||
| if len(power_caps) < 2: | ||
| return | ||
|
|
||
| expected_power_cap = next(iter(power_caps.values())) | ||
| for gpu, power_cap in power_caps.items(): | ||
| if power_cap != expected_power_cap: | ||
| self._log_event( | ||
| category=EventCategory.PLATFORM, | ||
| description=f"Power cap inconsistency for gpu {gpu}", | ||
| priority=EventPriority.ERROR, | ||
| data={"power_caps": list(power_caps.values())}, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be better to pass in power_caps itself as a dict to the data, otherwise end user will just see a list of power cap values and not the corresponding GPU. |
||
| console_log=True, | ||
| ) | ||
|
|
||
| def check_expected_driver_version( | ||
| self, | ||
| amdsmi_static_data: list[AmdSmiStatic], | ||
|
|
@@ -975,6 +1023,8 @@ def analyze_data( | |
| else: | ||
| if args.expected_max_power: | ||
| self.check_expected_max_power(data.static, args.expected_max_power) | ||
| if args.power: | ||
| self.check_power_cap_consistency(data.static, args.power) | ||
| if args.expected_driver_version: | ||
| self.check_expected_driver_version(data.static, args.expected_driver_version) | ||
|
|
||
|
|
||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will log every time we have a mismatched value. If a node has i.e 8 GPUs and all 8 have different power cap values we'll get this event logged 8 times. Would be more clear if we keep track of all mismatched values and log one event at the end highlighting all mismatches.