概述

本章节包含采集profiling相关的自定义接口,提供性能优化所需要的数据。

表1 torch_npu.profiler API

API名称

说明

torch_npu.profiler.profile

提供对训练过程数据的profiling功能。

torch_npu.profiler.ProfilerActivity

事件采集列表,枚举类。用于赋值给torch_npu.profiler.profile的activities参数。

torch_npu.profiler.supported_activities

事件采集列表,枚举类。用于赋值给torch_npu.profiler.profile的activities参数。

torch_npu.profiler.tensorboard_trace_handler

将采集到的性能数据导出为TensorBoard工具支持的格式。用于构造torch_npu.profiler.profile的on_trace_ready参数。

torch_npu.profiler.schedule

设置不同step的行为。用于构造torch_npu.profiler.profile的schedule参数。

torch_npu.profiler.ProfilerAction

Profiler状态,Enum类型。

torch_npu.profiler._ExperimentalConfig

Profiling扩展参数。用于构造torch_npu.profiler.profile的experimental_config参数。

torch_npu.profiler.supported_profiler_level

返回支持的AI Core的性能指标采集项,返回值等同torch_npu.profiler.ProfilerLevel枚举类的取值范围。

torch_npu.profiler.supported_ai_core_metrics

返回支持的采集等级,返回值等同torch_npu.profiler.AiCMetrics枚举类的取值范围。

torch_npu.profiler.ProfilerLevel

采集等级,用于作为 _ExperimentalConfig类的profiler_level参数。

torch_npu.profiler.AiCMetrics

AI Core的性能指标采集项,用于作为 _ExperimentalConfig类的aic_metrics参数。