kernelfoundry.eval_pipeline.utils.performance_analysis

Helper functions for analyzing performance data from profilers like Unitrace

Functions

compute_arithmic_intensity(series[, ...])

Calculates the arithmetic intensity for a given series (row) of metrics.

get_median_row(df[, column])

Returns the median row based on the specified column.

get_roofline_points(max_mem_bw, max_compute)

Calculates the roofline points given max memory bandwidth and max compute.

get_roofs(worker_info)

Uses the cpu and gpu names of the eval worker to lookup the hardware roofs :param worker_info: The worker info dictionary.

get_row_with_closest_metric(df, target_value)

Returns the row with the closest value to the target_value in the specified column.

kernelfoundry.eval_pipeline.utils.performance_analysis.get_roofs(worker_info: dict) HardwareRoofs | None[source]

Uses the cpu and gpu names of the eval worker to lookup the hardware roofs :param worker_info: The worker info dictionary. With information about the cpu and gpu of the worker.

Returns:

The hardware roofs or None if not found.

Return type:

HardwareRoofs | None

kernelfoundry.eval_pipeline.utils.performance_analysis.compute_arithmic_intensity(series: Series, compute_metric='XVE_INST_EXECUTED_FP32[events]', mem_metrics: tuple[str, str] | None = None)[source]

Calculates the arithmetic intensity for a given series (row) of metrics. :param series: A row from the metrics DataFrame. :type series: pd.Series :param compute_metric: The compute metric to use. :type compute_metric: str

Returns:

The arithmetic intensity (compute / memory).

Return type:

float

kernelfoundry.eval_pipeline.utils.performance_analysis.get_roofline_points(max_mem_bw: float, max_compute: float, min_value: float = 0.001) tuple[tuple[float, float], tuple[float, float]][source]

Calculates the roofline points given max memory bandwidth and max compute. :param max_mem_bw: Maximum memory bandwidth. :type max_mem_bw: float :param max_compute: Maximum compute. :type max_compute: float :param min_value: Minimum value for the x-axis. Default is 0.001 to avoid log(0) issues. :type min_value: float

Returns:

Two tuples representing the start and end points of the diagonal part of the roofline.

Return type:

tuple

kernelfoundry.eval_pipeline.utils.performance_analysis.get_median_row(df: DataFrame, column: str = 'GpuTime[ns]') Series[source]

Returns the median row based on the specified column.

kernelfoundry.eval_pipeline.utils.performance_analysis.get_row_with_closest_metric(df: DataFrame, target_value: float, column: str = 'GpuTime[ns]') Series[source]

Returns the row with the closest value to the target_value in the specified column.