Skip to content

Conversation

@anmyachev
Copy link
Contributor

@anmyachev anmyachev commented Oct 24, 2024

Closes #2565

Usage: ./build/SPIRVRunner tensor_2 --enable-profiling

Output example:

...
Tensor output: [8192, 8192], Float (268435456 bytes)
Kernel execution time: 4.81872 ms
...

Profiling ref: https://github.com/intel/pti-gpu/blob/master/chapters/device_activity_tracing/DPCXX.md#how-to-use
Profiling ref with Kineto: pytorch/pytorch#52936 (comment)

Example with Kineto
  #include <torch/csrc/autograd/profiler_kineto.h>
  using namespace torch::autograd::profiler;
  ProfilerConfig cfg{
    ProfilerState::KINETO,
      false,
      false,
      false,
      false,
      false
  };
  std::set<torch::autograd::profiler::ActivityType> activities{torch::autograd::profiler::ActivityType::CPU, torch::autograd::profiler::ActivityType::XPU};
  prepareProfiler(cfg, activities);
  enableProfiler(cfg, activities);

  sycl_kernel_launch(stream, kernel, triton_args);

  auto result = disableProfiler();
  result->save("./some_local_file2.json");

}
}

if (!triton_args.host_outbuffer.defined()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid getting an incomprehensible error.

@anmyachev anmyachev marked this pull request as ready for review October 24, 2024 17:08
Signed-off-by: Anatoly Myachev <[email protected]>
Signed-off-by: Anatoly Myachev <[email protected]>
@anmyachev anmyachev merged commit e6df65e into main Oct 28, 2024
4 checks passed
@anmyachev anmyachev deleted the amyachev/profiling branch October 28, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce optional profiling option for SPIRVRunner

3 participants