-
Notifications
You must be signed in to change notification settings - Fork 6
gpu memory check #295
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
base: development
Are you sure you want to change the base?
gpu memory check #295
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -441,6 +441,73 @@ def check_amdsmi_metric_ecc_totals(self, amdsmi_metric_data: list[AmdSmiMetric]) | |
| console_log=True, | ||
| ) | ||
|
|
||
| def check_gpu_memory( | ||
| self, | ||
| amdsmi_metric_data: list[AmdSmiMetric], | ||
| minimum_available_percent: float, | ||
| ) -> None: | ||
| """Check the minimum free VRAM percentage for each GPU.""" | ||
| for metric in amdsmi_metric_data: | ||
| memory = metric.mem_usage | ||
| total_vram = memory.total_vram if memory is not None else None | ||
| free_vram = memory.free_vram if memory is not None else None | ||
| values = { | ||
| "gpu": metric.gpu, | ||
| "total_vram": total_vram.value if total_vram is not None else None, | ||
| "free_vram": free_vram.value if free_vram is not None else None, | ||
| "unit": total_vram.unit if total_vram is not None else None, | ||
| "minimum_available_percent": minimum_available_percent, | ||
| } | ||
|
|
||
| if total_vram is None or free_vram is None: | ||
| self._log_event( | ||
| category=EventCategory.PLATFORM, | ||
| description=f"GPU {metric.gpu} VRAM availability is not available", | ||
| priority=EventPriority.WARNING, | ||
| data=values, | ||
| console_log=True, | ||
| ) | ||
| continue | ||
|
|
||
| try: | ||
| total_value = float(total_vram.value) | ||
| free_value = float(free_vram.value) | ||
| except (TypeError, ValueError): | ||
| self._log_event( | ||
| category=EventCategory.PLATFORM, | ||
| description=f"GPU {metric.gpu} VRAM availability is invalid", | ||
|
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. make this more descriptive, like "was not able to parse available blabla form blabla" |
||
| priority=EventPriority.WARNING, | ||
| data=values, | ||
| console_log=True, | ||
| ) | ||
| continue | ||
|
|
||
| if total_value <= 0: | ||
|
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. how is this ever going to happen? this seems like something we should check for before we try and compute it in such a way that it gives negative values |
||
| self._log_event( | ||
| category=EventCategory.PLATFORM, | ||
| description=f"GPU {metric.gpu} total VRAM is invalid", | ||
| priority=EventPriority.WARNING, | ||
| data=values, | ||
| console_log=True, | ||
| ) | ||
| continue | ||
|
|
||
| available_percent = free_value / total_value * 100 | ||
| if available_percent < minimum_available_percent: | ||
| self._log_event( | ||
| category=EventCategory.PLATFORM, | ||
| description=( | ||
| f"GPU {metric.gpu} free VRAM is {available_percent:.2f}% " | ||
| f"(minimum {minimum_available_percent:.2f}%)" | ||
| ), | ||
| priority=EventPriority.WARNING, | ||
| data={ | ||
| **values, | ||
| "available_percent": available_percent, | ||
| }, | ||
| console_log=True, | ||
| ) | ||
|
|
||
| def check_amdsmi_metric_ecc(self, amdsmi_metric_data: list[AmdSmiMetric]): | ||
| """Check ECC counts in all blocks for all GPUs | ||
|
|
||
|
|
@@ -959,6 +1026,11 @@ def analyze_data( | |
| args.l0_to_recovery_count_error_threshold, | ||
| args.l0_to_recovery_count_warning_threshold or 1, | ||
| ) | ||
| if args.gpu_memory: | ||
| self.check_gpu_memory( | ||
| data.metric, | ||
| args.gpu_memory.minimum_available_percent, | ||
| ) | ||
| self.check_amdsmi_metric_ecc_totals(data.metric) | ||
| self.check_amdsmi_metric_ecc(data.metric) | ||
|
|
||
|
|
||
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 sounds odd "availability is not available" :)