torch.profiler

Note

若API“是否支持”为“是”,“限制与说明”为“-”,说明此API和原生API支持度保持一致。

在使用支持的profiler接口时,需要将API名称替换为NPU形式名称才能使用,已支持的NPU形式profiler接口如下表所示。

API名称 NPU形式名称 是否支持 限制与说明
torch.profiler._KinetoProfile torch_npu.profiler._KinetoProfile -
torch.profiler._KinetoProfile.add_metadata torch_npu.profiler.profile.add_metadata -
torch.profiler._KinetoProfile.add_metadata_json torch_npu.profiler.profile.add_metadata_json -
torch.profiler._KinetoProfile.events - -
torch.profiler._KinetoProfile.export_chrome_trace torch_npu.profiler.profile.export_chrome_trace -
torch.profiler._KinetoProfile.export_memory_timeline torch_npu.profiler.profile.export_memory_timeline -
torch.profiler._KinetoProfile.export_stacks torch_npu.profiler.profile.export_stacks -
torch.profiler._KinetoProfile.key_averages - -
torch.profiler.profile torch_npu.profiler.profile -
torch.profiler.profile.step torch_npu.profiler.profile.step -
torch.profiler.ProfilerAction torch_npu.profiler.ProfilerAction -
torch.profiler.ProfilerActivity torch_npu.profiler.ProfilerActivity -
torch.profiler.ProfilerActivity.name - -
torch.profiler.schedule torch_npu.profiler.schedule -
torch.profiler.tensorboard_trace_handler torch_npu.profiler.tensorboard_trace_handler -
torch.profiler.itt.is_available - -
torch.profiler.itt.mark - -
torch.profiler.itt.range_push - -
torch.profiler.itt.range_pop - -