メインコンテンツまでスキップ
バージョン: v2512

intelligence.acuirt.utils.statistics

ConversionStatistics Objects

@dataclass
class ConversionStatistics()

Dataclass for statistics of conversion result

Attributes:

  • status str - Status of the conversion.
  • module_class_name str - Class name of the converted module.
  • module_code_filename Optional[str] - File name where the module is defined. None if cannot find filename (like built-in modules)
  • module_code_line Optional[int] - Line number in the file where the module is defined. None if cannot find line number (like built-in modules)
  • device_time_total - (Optional[float]): total execution time on device (GPU/CUDA) in seconds. None if no device events found (e.g., when using CPU)
  • cpu_time_total - (Optional[float]): total execution time on CPU in seconds. None if no CPU events found (like when using GPU)
  • device_events_total int - total number of device events
  • cpu_events_total int - total number of CPU events used_named_modules (List[str]) : list of names of modules that were actually used during forward pass
  • error Optional[str] - Error message if conversion failed
  • num_errors int - Number of same errors that occurred during conversion process in same class

compute_conversion_statistics

def compute_conversion_statistics(
conversion_report: AcuiRTBaseConversionReport,
profile_events: EventList, model: nn.Module,
logger: AcuiRTDefaultLogger)

Calculate conversion statistics from a workflow report. This function returns a list of ConversionStatistics objects. statistics are grouped by module class name, status and error.

Arguments:

  • conversion_report AcuiRTBaseConversionReport - Conversion result of the model.
  • profile_events EventList - The events captured during profiling.
  • model nn.Module - nn.Module object of the model being converted.
  • logger AcuiRTDefaultLogger - Logger instance for logging messages.