Skip to navigation

aitune.utils.monitoring.parse_metrics

View as Markdown

Hardware metrics parsing and summary.

Module Contents

Functions

NameDescription
_format_label_recursiveRecursively format a backend label with per-level indentation.
_split_top_level_paramsSplit a params string on commas at the top nesting level only.
format_backend_label_for_displayFormat a compact backend label for multi-line table display.
get_metrics_summaryGet a formatted summary of hardware metrics (memory, utilization, power) per module and backend.
parse_memory_metricsExtract memory usage summary per module and backend (max values in GB).
parse_power_metricsExtract power usage summary per module and backend (mean and max in W).
parse_utilization_metricsExtract utilization summary per module and backend (mean and max in %).

API

aitune.utils.monitoring.parse_metrics._format_label_recursive(
label: str,
indent: str
) -> str

Recursively format a backend label with per-level indentation.

aitune.utils.monitoring.parse_metrics._split_top_level_params(
params: str
) -> list[str]

Split a params string on commas at the top nesting level only.

aitune.utils.monitoring.parse_metrics.format_backend_label_for_display(
label: str
) -> str

Format a compact backend label for multi-line table display.

Each top-level parameter is placed on its own indented line. Nested config objects are formatted recursively with increased indentation.

Example::

TensorRTBackend(use_dynamo=False,quantization_config=ONNXQuantizationConfig(precision=‘int8’)) -> TensorRTBackend( use_dynamo=False, quantization_config=ONNXQuantizationConfig( precision=‘int8’ ) )

Labels with no parameters (e.g. TorchEagerBackend()) or without parentheses are returned unchanged.

aitune.utils.monitoring.parse_metrics.get_metrics_summary(
df: pandas.DataFrame
) -> pandas.DataFrame | None

Get a formatted summary of hardware metrics (memory, utilization, power) per module and backend.

aitune.utils.monitoring.parse_metrics.parse_memory_metrics(
df: pandas.DataFrame
) -> pandas.DataFrame

Extract memory usage summary per module and backend (max values in GB).

aitune.utils.monitoring.parse_metrics.parse_power_metrics(
df: pandas.DataFrame
) -> pandas.DataFrame

Extract power usage summary per module and backend (mean and max in W).

aitune.utils.monitoring.parse_metrics.parse_utilization_metrics(
df: pandas.DataFrame
) -> pandas.DataFrame

Extract utilization summary per module and backend (mean and max in %).