-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce optional profiling option for SPIRVRunner #2566
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Anatoly Myachev <[email protected]>
Signed-off-by: Anatoly Myachev <[email protected]>
cb857a5
to
ee96555
Compare
@@ -352,8 +364,14 @@ at::Tensor launchKernel(sycl::queue stream, sycl::kernel kernel, | |||
} | |||
} | |||
|
|||
if (!triton_args.host_outbuffer.defined()) { |
There was a problem hiding this comment.
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.
@@ -372,22 +390,43 @@ at::Tensor launchKernel(sycl::queue stream, sycl::kernel kernel, | |||
return triton_args.host_outbuffer; | |||
} | |||
|
|||
bool check_option_amoung_argv(int argc, char **argv, std::string option) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe passing argc/argv to another function this way may not be a good idea.
we could use a parsing library to avoid this manual processing of various options, just as an example something like this (my past work).
https://github.com/Xilinx/Vitis_Libraries/blob/3c8a3d59fe76157ffa0b31fb267961bea2e148f5/data_compression/L3/demos/libzso/src/host.cpp#L271
we could use std::find instead of loop to search for the option
bool get_kernel_time = | ||
check_option_amoung_argv(argc, argv, enable_profiling); | ||
sycl::queue q; | ||
if (get_kernel_time) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as get_kernel_time is passed across launch(), sycl_launch_kernel() would it be possible to set it as part of constructor of struct ?
@@ -352,8 +364,14 @@ at::Tensor launchKernel(sycl::queue stream, sycl::kernel kernel, | |||
} | |||
} | |||
|
|||
if (!triton_args.host_outbuffer.defined()) { | |||
std::string message = "Output tensor isn't configurated; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
message typo (NITS)
Closes #2565
Usage:
./build/SPIRVRunner tensor_2 --enable-profiling
Output example:
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