mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
This patch adds support for sycl kernels build via `torch.utils.cpp_extension.load`, `torch.utils.cpp_extension.load_inline` and (new) `class SyclExtension` APIs. Files having `.sycl` extension are considered to have sycl kernels and are compiled with `icpx` (dpc++ sycl compiler from Intel). Files with other extensions, `.cpp`, `.cu`, are handled as before. API supports building sycl along with other file types into single extension. Note that `.sycl` file extension is a PyTorch convention for files containing sycl code which I propose to adopt. We did follow up with compiler team to introduce such file extension in the compiler, but they are opposed to this. At the same time discussion around sycl file extension and adding sycl language support into such tools as cmake is ongoing. Eventually cmake also considers to introduce some file extension convention for sycl. I hope we can further influence cmake and compiler communities to broader adopt `.sycl` file extension. By default SYCL kernels are compiled for all Intel GPU devices for which pytorch native aten SYCL kernels are compiled. At the moment `pvc,xe-lpg`. This behavior can be overridden by setting `TORCH_XPU_ARCH_LIST` environment variables to the comma separated list of desired devices to compile for. Fixes: #132944 CC: @gujinghui @EikanWang @fengyuan14 @guangyey @jgong5 Pull Request resolved: https://github.com/pytorch/pytorch/pull/132945 Approved by: https://github.com/albanD, https://github.com/guangyey, https://github.com/malfet Co-authored-by: Nikita Shulga <2453524+malfet@users.noreply.github.com>
15 lines
453 B
ReStructuredText
15 lines
453 B
ReStructuredText
torch.utils.cpp_extension
|
|
=========================
|
|
|
|
.. currentmodule:: torch.utils.cpp_extension
|
|
.. autofunction:: CppExtension
|
|
.. autofunction:: CUDAExtension
|
|
.. autofunction:: SyclExtension
|
|
.. autofunction:: BuildExtension
|
|
.. autofunction:: load
|
|
.. autofunction:: load_inline
|
|
.. autofunction:: include_paths
|
|
.. autofunction:: get_compiler_abi_compatibility_and_version
|
|
.. autofunction:: verify_ninja_availability
|
|
.. autofunction:: is_ninja_available
|