PyTorch Profiler

Resources

activities - a list of activities to profile:

  • ProfilerActivity.CPU - PyTorch operators, TorchScript functions and user-defined code labels (see record_function below);
  • ProfilerActivity.CUDA - on-device CUDA kernels;
  • ProfilerActivity.XPU - on-device XPU kernels;

record_shapes - whether to record shapes of the operator inputs; profile_memory - whether to report amount of memory consumed by model’s Tensors;