intelligence.acuirt.utils.statistics
ConversionStatistics Objects
@dataclass
class ConversionStatistics()
Dataclass for statistics of conversion result
Attributes:
statusstr - Status of the conversion.module_class_namestr - Class name of the converted module.module_code_filenameOptional[str] - File name where the module is defined. None if cannot find filename (like built-in modules)module_code_lineOptional[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_totalint - total number of device eventscpu_events_totalint - total number of CPU events used_named_modules (List[str]) : list of names of modules that were actually used during forward passerrorOptional[str] - Error message if conversion failednum_errorsint - 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_reportAcuiRTBaseConversionReport - Conversion result of the model.profile_eventsEventList - The events captured during profiling.modelnn.Module - nn.Module object of the model being converted.loggerAcuiRTDefaultLogger - Logger instance for logging messages.