Extraction#

Extraction utilities for analyzing NVIDIA Nsight Compute profiling data.

This module provides functionality to load .ncu-rep reports, extract performance data, and transform it into structured pandas DataFrames for further analysis.

Functions:
extract_ncu_action_data(action, metric):

Extracts performance data for a specific kernel action from an NVIDIA Nsight Compute report.

extract_df_from_report(metric, configs, iterations, func, derive_metric, ignore_kernel_list, verbose, combine_kernel_metrics=None):

Processes the full NVIDIA Nsight Compute report and returns a pandas DataFrame containing performance metrics.

nsight.extraction.extract_df_from_report(
report_path: str,
metric: str,
configs: List[Tuple[Any, ...]],
iterations: int,
func: Callable[[...], Any],
derive_metric: Callable[[...], Any] | None,
ignore_kernel_list: List[str] | None,
output_progress: bool,
combine_kernel_metrics: Callable[[float, float], float] | None = None,
)#

Extracts and aggregates profiling results from an NVIDIA Nsight Compute report.

Parameters:
  • report_path (str) – Path to the report file.

  • metric (str) – The NVIDIA Nsight Compute metric to extract.

  • configs (List[Tuple[Any, ...]]) – Configuration settings used during profiling runs.

  • iterations (int) – Number of times each configuration was run.

  • func (Callable[..., Any]) – Function representing the kernel launch with parameter signature.

  • derive_metric (Callable[..., Any] | None) – Function to transform the raw metric value with config values.

  • ignore_kernel_list (Optional[List[str]]) – Kernel names to ignore in the analysis.

  • combine_kernel_metrics (Optional[Callable[[float, float], float]]) – Function to merge multiple kernel metrics.

  • verbose – Toggles the printing of extraction progress

  • output_progress (bool)

Return type:

DataFrame

Returns:

A DataFrame containing the extracted and transformed performance data.

Raises:
  • RuntimeError – If multiple kernels are detected per config without a combining function.

  • exceptions.ProfilerException – If profiling results are missing or incomplete.

nsight.extraction.extract_ncu_action_data(action: Any, metric: str)#

Extracts performance data from an NVIDIA Nsight Compute kernel action.

Parameters:
  • action (Any) – The NVIDIA Nsight Compute action object.

  • metric (str) – The metric name to extract from the action.

Return type:

NCUActionData

Returns:

A data container with extracted metric, clock rates, and GPU name.