-
Notifications
You must be signed in to change notification settings - Fork 233
Add sycl examples #114
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
base: master
Are you sure you want to change the base?
Add sycl examples #114
Conversation
Co-authored-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
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.
LGTM
Hi @goldsborough @zou3519 , could you help review this PR? Thank you! |
What is Sycl? |
Sycl is a C++ abstraction for heterogeneous programming allowing to write and execute code (kernels) on GPU devices. That's the way Intel uses to wrote kernels for Intel GPUs. A number of PyTorch aten operators are written using Sycl. And writing Sycl kernels is exposed to PyTorch users thru CPP Extension API. We are trying to update PyTorch tutorials/examples to demonstrate and encourage users to use Sycl to write custom kernels. See https://www.khronos.org/sycl/. Should we add a note on what is SYCL in the project readme? |
@@ -1,11 +1,11 @@ | |||
# C++/CUDA Extensions in PyTorch | |||
|
|||
An example of writing a C++/CUDA extension for PyTorch. See | |||
An example of writing a C++/CUDA/Sycl extension for PyTorch. See |
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.
@ZhaoqiongZ : change a title, it reads "C++/CUDA" only.
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.
done
update title with SYCL
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.
extension-cpp is supposed to be the "base repository" that people clone to do C++/CUDA extensions. Any special hardwares (or other workflows) is out of scope
@zou3519, xpu is now one of the official backends included in pytorch. It's backed by SYCL to generate device specific code and pytorch API to allow users create custom operators. Further, pytorch tutorial educates on usage of this API for C++ and CUDA (https://github.com/pytorch/tutorials/blob/main/advanced_source/cpp_custom_ops.rst). The SYCL cpp extension API we've added to pytorch extends this functionality adding SYCL into existing landscape. Obvious step to consider is to extend existing C++ and CUDA tutorial and example to also cover SYCL. It seems you are against this proposal. Can you, please, provide your reasoning to avoid adding SYCL in this tutorial and example and suggest alternative approach which will help to extend pytorch ecosystem to cover devices other than CUDA and other vendors? fyi, proposal to change tutorial is here: It's currently draft as it depends on this PR in extension-cpp repository. |
Add the example to implement muladd op with SyclExtension