-
Notifications
You must be signed in to change notification settings - Fork 510
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
Add SYCL build script #11767
Add SYCL build script #11767
Conversation
Hi @penpornk , any OpenXLA developer can use this script to check SYCL backend build if needed. It will automatically download the build environment including the necessary toolchain/lib, and clear it after build is done. |
Hi @penpornk , can you please look into this? Thanks. |
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software |
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'm not totally convinced that this should be separate from the build_tools/sycl dir. Do you have a strong preference?
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.
Actually I'm not sure where should I put all these scripts. I'll move this file to build_tools/sycl
if this is fine.
@ddunl Does the new file path look good to you? |
Imported from GitHub PR #11767 This is a sub PR of #9042, it adds a script to build xla with `--config=sycl`. Here is how to use: ```bash workspace=$1 xla_path=$workspace/xla cd $workspace git clone -b yang/ci https://github.com/Intel-tensorflow/xla xla bash $xla_path/build_tools/sycl/build.sh $workspace ``` Copybara import of the project: -- d811bba by Sheng, Yang <[email protected]>: Add SYCL build script -- 0c2500b by Sheng, Yang <[email protected]>: change path Merging this change closes #11767 FUTURE_COPYBARA_INTEGRATE_REVIEW=#11767 from Intel-tensorflow:yang/ci 0c2500b PiperOrigin-RevId: 634661773
Imported from GitHub PR openxla/xla#11767 This is a sub PR of openxla/xla#9042, it adds a script to build xla with `--config=sycl`. Here is how to use: ```bash workspace=$1 xla_path=$workspace/xla cd $workspace git clone -b yang/ci https://github.com/Intel-tensorflow/xla xla bash $xla_path/build_tools/sycl/build.sh $workspace ``` Copybara import of the project: -- d811bba1548f0c983da473a0940b1ea3d8b2c436 by Sheng, Yang <[email protected]>: Add SYCL build script -- 0c2500b703b73bc340ccc9e3817c7ce54cc8d718 by Sheng, Yang <[email protected]>: change path Merging this change closes #11767 FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11767 from Intel-tensorflow:yang/ci 0c2500b703b73bc340ccc9e3817c7ce54cc8d718 PiperOrigin-RevId: 634661773
Imported from GitHub PR openxla/xla#11767 This is a sub PR of openxla/xla#9042, it adds a script to build xla with `--config=sycl`. Here is how to use: ```bash workspace=$1 xla_path=$workspace/xla cd $workspace git clone -b yang/ci https://github.com/Intel-tensorflow/xla xla bash $xla_path/build_tools/sycl/build.sh $workspace ``` Copybara import of the project: -- d811bba1548f0c983da473a0940b1ea3d8b2c436 by Sheng, Yang <[email protected]>: Add SYCL build script -- 0c2500b703b73bc340ccc9e3817c7ce54cc8d718 by Sheng, Yang <[email protected]>: change path Merging this change closes #11767 FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11767 from Intel-tensorflow:yang/ci 0c2500b703b73bc340ccc9e3817c7ce54cc8d718 PiperOrigin-RevId: 634661773
- Adding namespace to `string` -> `std::string` (Not sure why this compiled in the first place) - Remove unused local variables - Avoid unintended fallthrough in switch statement - Fix member variable initialization order in a constructor - Avoid read of unintialized variable FUTURE_COPYBARA_INTEGRATE_REVIEW=#11767 from Intel-tensorflow:yang/ci 0c2500b PiperOrigin-RevId: 634669250
- Adding namespace to `string` -> `std::string` (Not sure why this compiled in the first place) - Remove unused local variables - Avoid unintended fallthrough in switch statement - Fix member variable initialization order in a constructor - Avoid read of unintialized variable FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11767 from Intel-tensorflow:yang/ci 0c2500b703b73bc340ccc9e3817c7ce54cc8d718 PiperOrigin-RevId: 634669250
A recent Triton integrate broke the ROCm code path of our Triton emitter. The values of the new pass parameters has been derived from the upstream change: triton-lang/triton@99fb876#diff-33c9a103282c05c9d9d213b94450ae7481b6db8c3c6d810f54f175b4735a3c72 FUTURE_COPYBARA_INTEGRATE_REVIEW=#11767 from Intel-tensorflow:yang/ci 0c2500b PiperOrigin-RevId: 634677074
FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11767 from Intel-tensorflow:yang/ci 0c2500b703b73bc340ccc9e3817c7ce54cc8d718 PiperOrigin-RevId: 633412483
A recent Triton integrate broke the ROCm code path of our Triton emitter. The values of the new pass parameters has been derived from the upstream change: triton-lang/triton@99fb876#diff-33c9a103282c05c9d9d213b94450ae7481b6db8c3c6d810f54f175b4735a3c72 FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11767 from Intel-tensorflow:yang/ci 0c2500b703b73bc340ccc9e3817c7ce54cc8d718 PiperOrigin-RevId: 634677074
Imported from GitHub PR openxla/xla#11767 This is a sub PR of openxla/xla#9042, it adds a script to build xla with `--config=sycl`. Here is how to use: ```bash workspace=$1 xla_path=$workspace/xla cd $workspace git clone -b yang/ci https://github.com/Intel-tensorflow/xla xla bash $xla_path/build_tools/sycl/build.sh $workspace ``` Copybara import of the project: -- d811bba1548f0c983da473a0940b1ea3d8b2c436 by Sheng, Yang <[email protected]>: Add SYCL build script -- 0c2500b703b73bc340ccc9e3817c7ce54cc8d718 by Sheng, Yang <[email protected]>: change path Merging this change closes #11767 PiperOrigin-RevId: 634676627
…ly). So far, we guard the dep with `#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM` and return an unimplemented error otherwise. However, having `"triton"` in the build graph makes no sense if neither CUDA nor ROCm toolkits are available at build time. This PR moves the `if_gpu_is_configured` branching upwards in the build graph to `"ir_emitter_unnested`". FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11767 from Intel-tensorflow:yang/ci 0c2500b703b73bc340ccc9e3817c7ce54cc8d718 PiperOrigin-RevId: 634338739
Unrelated, I'm a bit confused about how XLA Backend works, glad you all are working with the SYCL backend. Can you please point out where If I see the compiler file writing SYCL backend of XLA, I'll at least gather some idea about the modules and way or writing it. |
Hi @abhaskumarsinha , actually we are using SPIRV target + SYCL runtime. I suppose you are asking this spirv_compiler.cc. It's a part of our upstream work and under working. You can check the whole work by this preview PR: #9042 |
Thank you @Zantares . I'm a bit noob here, do ASICs/FPGA support OpenCL/SYCL, can they support SPRIV? |
It's up to your software stack. It usually needs 2 parts to support new hardware here:
So, you can choose the most suitable solution by combining these options. |
Hi @abhaskumarsinha , you can refer to the OpenXLA Arch Overview doc, especially the Compiler Backend section to understand it better. In addition, you can consult the community maintainer @penpornk or others for specific questions, since I'm also a hardware vendor developer and not clear about the roadmap or future tech design.
You can reuse most works of #9042 once it's merged, but you still need to reorganize the bazel build dependency since you plan to use LLVM + SYCL rather than the current SPIRV + SYCL. Another point is that we used level_zero as the underlayer of SYCL runtime, you may need to change it to your own HW Driver. |
This is a sub PR of #9042, it adds a script to build xla with
--config=sycl
.Here is how to use: