-
Notifications
You must be signed in to change notification settings - Fork 8k
Add option to disable gpu metrics collection #65809
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: master
Are you sure you want to change the base?
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 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -526,14 +526,18 @@ def get_gpu_utilization(self) -> List[GpuUtilizationInfo]: | |||||||||||||||||||
| class GpuMetricProvider: | ||||||||||||||||||||
| """Provider class for GPU metrics collection.""" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| def __init__(self): | ||||||||||||||||||||
| def __init__(self, enable_metric_report: bool = True): | ||||||||||||||||||||
| self._provider: Optional[GpuProvider] = None | ||||||||||||||||||||
| self._enable_metric_report = True | ||||||||||||||||||||
| self._enable_metric_report = enable_metric_report | ||||||||||||||||||||
| self._providers = [NvidiaGpuProvider(), AmdGpuProvider()] | ||||||||||||||||||||
|
Comment on lines
+529
to
532
Contributor
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. When We can optimize this by only instantiating the providers when
Suggested change
|
||||||||||||||||||||
| self._initialized = False | ||||||||||||||||||||
|
|
||||||||||||||||||||
| def initialize(self) -> bool: | ||||||||||||||||||||
| """Initialize the GPU metric provider by detecting available GPU providers.""" | ||||||||||||||||||||
| if not self._enable_metric_report: | ||||||||||||||||||||
| self._initialized = True | ||||||||||||||||||||
| return False | ||||||||||||||||||||
|
|
||||||||||||||||||||
| if self._initialized: | ||||||||||||||||||||
| return True | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -578,7 +578,9 @@ def __init__(self, dashboard_agent, raylet_client=None): | |||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
| # Create GPU metric provider instance | ||||||||||||||
| self._gpu_metric_provider = GpuMetricProvider() | ||||||||||||||
| self._gpu_metric_provider = GpuMetricProvider( | ||||||||||||||
| enable_metric_report=dashboard_agent.gpu_metrics_enabled | ||||||||||||||
| ) | ||||||||||||||
|
Comment on lines
+581
to
+583
Contributor
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. Directly accessing Using
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| if raylet_client: | ||||||||||||||
| self._raylet_client = raylet_client | ||||||||||||||
|
|
||||||||||||||
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.
Adding
disable_gpu_metricsbeforeis_headchanges the positional argument order ofDashboardAgent.__init__. If any callers or tests instantiateDashboardAgentusing positional arguments (e.g., passingis_headpositionally), this change will silently break backward compatibility by misaligning the arguments.To maintain backward compatibility, please place
disable_gpu_metricsafteris_head(right before the*keyword-only argument marker).