Skip to content
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

SYCL building system #2

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

fengyuan14
Copy link
Contributor

@fengyuan14 fengyuan14 commented Feb 24, 2024

Stack from ghstack (oldest at bottom):

Main parts of the PR include,

  1. Find SYCL compiler tool kit in cmake. (cmake/Module/FindSYCLToolkit.cmake)
  2. Setup cmake variables for SYCL compilation flags, includes and runtime library. (cmake/public/xpu.cmake, cmake/Dependencies.cmake)
  3. Implement two cmake custom target building helpers, sycl_add_library and sycl_add_executable. (cmake/Module/FindSYCL.cmake, cmake/Module/FindSYCL/run_sycl.cmake)
  4. Provide unit test cases to verify SYCL building system, since there is no SYCL kernel added in PyTorch. (test/cpp/sycl/CMakeLists.txt)

SYCL program building is similar as CUDA and HIP. SYCL program requires custom compilation and additional device object linkage steps. We implement sycl_add_library and sycl_add_excutable to introduce SYCL compiler,

  1. Introduce SYCL compiler to compile .cpp, in which we have SYCL kernels. As to "host only" .cpp, we use CXX compiler for compilation. So far, we only enable GCC compiler in SYCL separate compilation. Next step we will enable CLANG compiler to align with PyTorch building requirement.
  2. Introduce SYCL compiler to link device object and produce a host relocatable object which could be linked by host linker in subsequence.

Signed-off-by: Feng Yuan feng1.yuan@intel.com

fengyuan14 added a commit that referenced this pull request Feb 24, 2024
Main parts of the PR include,

1. Find SYCL compiler tool kit in cmake. (cmake/Module/FindSYCLToolkit.cmake)
2. Setup cmake variables for SYCL compilation flags, includes and runtime library. (cmake/public/xpu.cmake, cmake/Dependencies.cmake)
3. Implement two cmake custom target building helpers, sycl_add_library and sycl_add_executable. (cmake/Module/FindSYCL.cmake, cmake/Module/FindSYCL/run_sycl.cmake)
4. Provide unit test cases to verify SYCL building system, since there is no SYCL kernel added in PyTorch. (test/cpp/sycl/CMakeLists.txt)

SYCL program building is similar as CUDA and HIP. SYCL program requires custom compilation and additional device object linkage steps. We implement sycl_add_library and sycl_add_excutable to introduce SYCL compiler,

1. Introduce SYCL compiler to compile .cpp, in which we have SYCL kernels. As to "host only" .cpp, we use CXX compiler for compilation. So far, we only enable GCC compiler in SYCL separate compilation. Next step we will enable CLANG compiler to align with PyTorch building requirement.
2. Introduce SYCL compiler to link device object and produce a host relocatable object which could be linked by host linker in subsequence.

Signed-off-by: Feng Yuan <feng1.yuanintel.com>

ghstack-source-id: 949d9543cc2606ede94a08d5dd9427d23e058849
Pull Request resolved: #2
Main parts of the PR include,

1. Find SYCL compiler tool kit in cmake. (cmake/Module/FindSYCLToolkit.cmake)
2. Setup cmake variables for SYCL compilation flags, includes and runtime library. (cmake/public/xpu.cmake, cmake/Dependencies.cmake)
3. Implement two cmake custom target building helpers, sycl_add_library and sycl_add_executable. (cmake/Module/FindSYCL.cmake, cmake/Module/FindSYCL/run_sycl.cmake)
4. Provide unit test cases to verify SYCL building system, since there is no SYCL kernel added in PyTorch. (test/cpp/sycl/CMakeLists.txt)

SYCL program building is similar as CUDA and HIP. SYCL program requires custom compilation and additional device object linkage steps. We implement sycl_add_library and sycl_add_excutable to introduce SYCL compiler,

1. Introduce SYCL compiler to compile .cpp, in which we have SYCL kernels. As to "host only" .cpp, we use CXX compiler for compilation. So far, we only enable GCC compiler in SYCL separate compilation. Next step we will enable CLANG compiler to align with PyTorch building requirement.
2. Introduce SYCL compiler to link device object and produce a host relocatable object which could be linked by host linker in subsequence.

Signed-off-by: Feng Yuan <feng1.yuan@intel.com>

[ghstack-poisoned]
This was referenced Feb 25, 2024
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.

2 participants