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

[Draft][XLA:GPU] Add sycl runtime #9042

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ShengYang1
Copy link
Contributor

@ShengYang1 ShengYang1 commented Feb 1, 2024

This PR aims to add sycl runtime support, we can run basic JAX GPU UTs with it. It includes:

  1. sycl runtime crosstool build
  2. sycl stream executor
  3. spirv-llvm-translator
  4. registration of spir_compiler/computation placer/transfer manager
  5. refine build file to remove cuda specific changes(especially those cuda kernels)
  6. fix CudaCubin to load spirv binary
  7. fix metadata

This is a draft PR to show what is needed to run JAX on sycl runtime.

@github-actions github-actions bot added the kokoro:force-run Forces CI to rerun label Feb 1, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Forces CI to rerun label Feb 1, 2024
@ShengYang1 ShengYang1 marked this pull request as draft February 1, 2024 06:54
@Zantares
Copy link
Contributor

Zantares commented Feb 1, 2024

Hi @penpornk , this is the big SYCL runtime PR for preview and CI test, we will continue to split it into small PRs.

Next work:

We still need some JAX work to enable Intel public CI for this PR. Will share CI result to this PR after it's done

@penpornk penpornk self-assigned this Feb 1, 2024
@penpornk penpornk added the kokoro:force-run Forces CI to rerun label Feb 8, 2024
Copy link
Member

@penpornk penpornk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! Could you please help make it buildable when SYCL is not configured? (All presubmit CIs are failing. I'm not sure why all their error logs aren't viewable though.)

The Intel Extension for OpenXLA plug-in requires oneAPI Base Toolkit installation for DPC++, oneMKL, and oneTBB. I don't see their headers in this PR. Does this mean we can build this PR with SYCL without installing the oneAPI Base Toolkit?

xla/pjrt/pjrt_compiler.h Outdated Show resolved Hide resolved
#include "xla/stream_executor/platform/port.h"
#include "xla/stream_executor/sycl/sycl_gpu_runtime.h"

#include <level_zero/ze_api.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the user need to install Level Zero driver (intel-level-zero-gpu and level-zero) to build this file, or is the headers package (level-zero-dev) enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

level-zero-dev is enough for building.

@ShengYang1
Copy link
Contributor Author

ShengYang1 commented Feb 18, 2024

Thank you for the PR! Could you please help make it buildable when SYCL is not configured? (All presubmit CIs are failing. I'm not sure why all their error logs aren't viewable though.)

Sorry for the late reply. I have rebased the code and now it should work.

The Intel Extension for OpenXLA plug-in requires oneAPI Base Toolkit installation for DPC++, oneMKL, and oneTBB. I don't see their headers in this PR. Does this mean we can build this PR with SYCL without installing the oneAPI Base Toolkit?

oneAPI Base Toolkit is needed for the headers, for example sycl.hpp is included here.

@penpornk penpornk added the kokoro:force-run Forces CI to rerun label Feb 19, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Forces CI to rerun label Feb 19, 2024
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 12, 2024
Imported from GitHub PR openxla/xla#10244

It is a sub PR of openxla/xla#9042.
Then we can build xla with sycl support like: `bazel build --config=sycl xxx`
Copybara import of the project:

--
e1bc7ac90f3403a477ba14533dea972de6a2c262 by Sheng, Yang <yang.sheng@intel.com>:

Add sycl build target

Merging this change closes #10244

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10244 from Intel-tensorflow:yang/syclbuild e1bc7ac90f3403a477ba14533dea972de6a2c262
PiperOrigin-RevId: 615176784
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 15, 2024
Imported from GitHub PR openxla/xla#10247

It is a sub PR of openxla/xla#9042.

Copybara import of the project:

--
c2f60c318aebfe4e64bf3becfd40d04949c50b41 by Sheng, Yang <yang.sheng@intel.com>:

Add sycl name in se_gpu_pjrt_client

Merging this change closes #10247

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10247 from Intel-tensorflow:yang/pjrt c2f60c318aebfe4e64bf3becfd40d04949c50b41
PiperOrigin-RevId: 615176920
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 15, 2024
Imported from GitHub PR openxla/xla#10247

It is a sub PR of openxla/xla#9042.

Copybara import of the project:

--
c2f60c318aebfe4e64bf3becfd40d04949c50b41 by Sheng, Yang <yang.sheng@intel.com>:

Add sycl name in se_gpu_pjrt_client

Merging this change closes #10247

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10247 from Intel-tensorflow:yang/pjrt c2f60c318aebfe4e64bf3becfd40d04949c50b41
PiperOrigin-RevId: 615176920
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 15, 2024
Imported from GitHub PR openxla/xla#10247

It is a sub PR of openxla/xla#9042.

Copybara import of the project:

--
c2f60c318aebfe4e64bf3becfd40d04949c50b41 by Sheng, Yang <yang.sheng@intel.com>:

Add sycl name in se_gpu_pjrt_client

Merging this change closes #10247

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10247 from Intel-tensorflow:yang/pjrt c2f60c318aebfe4e64bf3becfd40d04949c50b41
PiperOrigin-RevId: 615176920
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 18, 2024
Imported from GitHub PR openxla/xla#10247

It is a sub PR of openxla/xla#9042.

Copybara import of the project:

--
c2f60c318aebfe4e64bf3becfd40d04949c50b41 by Sheng, Yang <yang.sheng@intel.com>:

Add sycl name in se_gpu_pjrt_client

Merging this change closes #10247

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10247 from Intel-tensorflow:yang/pjrt c2f60c318aebfe4e64bf3becfd40d04949c50b41
PiperOrigin-RevId: 615176920
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 19, 2024
Imported from GitHub PR openxla/xla#10247

It is a sub PR of openxla/xla#9042.

Copybara import of the project:

--
c2f60c318aebfe4e64bf3becfd40d04949c50b41 by Sheng, Yang <yang.sheng@intel.com>:

Add sycl name in se_gpu_pjrt_client

Merging this change closes #10247

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10247 from Intel-tensorflow:yang/pjrt c2f60c318aebfe4e64bf3becfd40d04949c50b41
PiperOrigin-RevId: 615176920
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 19, 2024
Imported from GitHub PR openxla/xla#10247

It is a sub PR of openxla/xla#9042.

Copybara import of the project:

--
c2f60c318aebfe4e64bf3becfd40d04949c50b41 by Sheng, Yang <yang.sheng@intel.com>:

Add sycl name in se_gpu_pjrt_client

Merging this change closes #10247

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10247 from Intel-tensorflow:yang/pjrt c2f60c318aebfe4e64bf3becfd40d04949c50b41
PiperOrigin-RevId: 615176920
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 19, 2024
Imported from GitHub PR openxla/xla#10247

It is a sub PR of openxla/xla#9042.

Copybara import of the project:

--
c2f60c318aebfe4e64bf3becfd40d04949c50b41 by Sheng, Yang <yang.sheng@intel.com>:

Add sycl name in se_gpu_pjrt_client

Merging this change closes #10247

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10247 from Intel-tensorflow:yang/pjrt c2f60c318aebfe4e64bf3becfd40d04949c50b41
PiperOrigin-RevId: 615176920
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 19, 2024
Imported from GitHub PR openxla/xla#10247

It is a sub PR of openxla/xla#9042.

Copybara import of the project:

--
c2f60c318aebfe4e64bf3becfd40d04949c50b41 by Sheng, Yang <yang.sheng@intel.com>:

Add sycl name in se_gpu_pjrt_client

Merging this change closes #10247

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10247 from Intel-tensorflow:yang/pjrt c2f60c318aebfe4e64bf3becfd40d04949c50b41
PiperOrigin-RevId: 615176920
copybara-service bot pushed a commit that referenced this pull request Mar 19, 2024
Imported from GitHub PR #10247

It is a sub PR of #9042.

Copybara import of the project:

--
c2f60c3 by Sheng, Yang <yang.sheng@intel.com>:

Add sycl name in se_gpu_pjrt_client

Merging this change closes #10247

COPYBARA_INTEGRATE_REVIEW=#10247 from Intel-tensorflow:yang/pjrt c2f60c3
PiperOrigin-RevId: 617141542
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 19, 2024
Imported from GitHub PR openxla/xla#10247

It is a sub PR of openxla/xla#9042.

Copybara import of the project:

--
c2f60c318aebfe4e64bf3becfd40d04949c50b41 by Sheng, Yang <yang.sheng@intel.com>:

Add sycl name in se_gpu_pjrt_client

Merging this change closes #10247

PiperOrigin-RevId: 617141542
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 8, 2024
Imported from GitHub PR openxla/xla#11425

It is a sub PR of openxla/xla#9042 to add sycl platform
Copybara import of the project:

--
7d0c37057c673f784089ce961d24276a496d43bd by Sheng, Yang <yang.sheng@intel.com>:

Add sycl platform

--
8d1196831a20f69ba8880d8549007358928f6be1 by Sheng, Yang <yang.sheng@intel.com>:

Add comments back

Merging this change closes #11425

Reverts f5ff233

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform 8d1196831a20f69ba8880d8549007358928f6be1
PiperOrigin-RevId: 631712809
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 8, 2024
Imported from GitHub PR openxla/xla#11425

It is a sub PR of openxla/xla#9042 to add sycl platform
Copybara import of the project:

--
7d0c37057c673f784089ce961d24276a496d43bd by Sheng, Yang <yang.sheng@intel.com>:

Add sycl platform

--
8d1196831a20f69ba8880d8549007358928f6be1 by Sheng, Yang <yang.sheng@intel.com>:

Add comments back

Merging this change closes #11425

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform 8d1196831a20f69ba8880d8549007358928f6be1
PiperOrigin-RevId: 631712809
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 8, 2024
Imported from GitHub PR openxla/xla#11425

It is a sub PR of openxla/xla#9042 to add sycl platform
Copybara import of the project:

--
7d0c37057c673f784089ce961d24276a496d43bd by Sheng, Yang <yang.sheng@intel.com>:

Add sycl platform

--
8d1196831a20f69ba8880d8549007358928f6be1 by Sheng, Yang <yang.sheng@intel.com>:

Add comments back

Merging this change closes #11425

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform 8d1196831a20f69ba8880d8549007358928f6be1
PiperOrigin-RevId: 631712809
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 16, 2024
Imported from GitHub PR openxla/xla#11425

It is a sub PR of openxla/xla#9042 to add sycl platform
Copybara import of the project:

--
7d0c37057c673f784089ce961d24276a496d43bd by Sheng, Yang <yang.sheng@intel.com>:

Add sycl platform

--
8d1196831a20f69ba8880d8549007358928f6be1 by Sheng, Yang <yang.sheng@intel.com>:

Add comments back

Merging this change closes #11425

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform 8d1196831a20f69ba8880d8549007358928f6be1
PiperOrigin-RevId: 634288679
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 16, 2024
Imported from GitHub PR openxla/xla#11425

It is a sub PR of openxla/xla#9042 to add sycl platform
Copybara import of the project:

--
7d0c37057c673f784089ce961d24276a496d43bd by Sheng, Yang <yang.sheng@intel.com>:

Add sycl platform

--
8d1196831a20f69ba8880d8549007358928f6be1 by Sheng, Yang <yang.sheng@intel.com>:

Add comments back

Merging this change closes #11425

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform 8d1196831a20f69ba8880d8549007358928f6be1
PiperOrigin-RevId: 634288679
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 16, 2024
Imported from GitHub PR openxla/xla#11425

It is a sub PR of openxla/xla#9042 to add sycl platform
Copybara import of the project:

--
7d0c37057c673f784089ce961d24276a496d43bd by Sheng, Yang <yang.sheng@intel.com>:

Add sycl platform

--
8d1196831a20f69ba8880d8549007358928f6be1 by Sheng, Yang <yang.sheng@intel.com>:

Add comments back

Merging this change closes #11425

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform 8d1196831a20f69ba8880d8549007358928f6be1
PiperOrigin-RevId: 634288679
copybara-service bot pushed a commit that referenced this pull request May 17, 2024
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 <yang.sheng@intel.com>:

Add SYCL build script

--
0c2500b by Sheng, Yang <yang.sheng@intel.com>:

change path

Merging this change closes #11767

FUTURE_COPYBARA_INTEGRATE_REVIEW=#11767 from Intel-tensorflow:yang/ci 0c2500b
PiperOrigin-RevId: 634661773
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
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 <yang.sheng@intel.com>:

Add SYCL build script

--
0c2500b703b73bc340ccc9e3817c7ce54cc8d718 by Sheng, Yang <yang.sheng@intel.com>:

change path

Merging this change closes #11767

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11767 from Intel-tensorflow:yang/ci 0c2500b703b73bc340ccc9e3817c7ce54cc8d718
PiperOrigin-RevId: 634661773
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
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 <yang.sheng@intel.com>:

Add SYCL build script

--
0c2500b703b73bc340ccc9e3817c7ce54cc8d718 by Sheng, Yang <yang.sheng@intel.com>:

change path

Merging this change closes #11767

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11767 from Intel-tensorflow:yang/ci 0c2500b703b73bc340ccc9e3817c7ce54cc8d718
PiperOrigin-RevId: 634661773
copybara-service bot pushed a commit that referenced this pull request May 17, 2024
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 <yang.sheng@intel.com>:

Add SYCL build script

--
0c2500b by Sheng, Yang <yang.sheng@intel.com>:

change path

Merging this change closes #11767

COPYBARA_INTEGRATE_REVIEW=#11767 from Intel-tensorflow:yang/ci 0c2500b
PiperOrigin-RevId: 634676627
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
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 <yang.sheng@intel.com>:

Add SYCL build script

--
0c2500b703b73bc340ccc9e3817c7ce54cc8d718 by Sheng, Yang <yang.sheng@intel.com>:

change path

Merging this change closes #11767

PiperOrigin-RevId: 634676627
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
Imported from GitHub PR openxla/xla#11425

It is a sub PR of openxla/xla#9042 to add sycl platform
Copybara import of the project:

--
7d0c37057c673f784089ce961d24276a496d43bd by Sheng, Yang <yang.sheng@intel.com>:

Add sycl platform

--
8d1196831a20f69ba8880d8549007358928f6be1 by Sheng, Yang <yang.sheng@intel.com>:

Add comments back

Merging this change closes #11425

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform 8d1196831a20f69ba8880d8549007358928f6be1
PiperOrigin-RevId: 634288679
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
Imported from GitHub PR openxla/xla#11425

It is a sub PR of openxla/xla#9042 to add sycl platform
Copybara import of the project:

--
7d0c37057c673f784089ce961d24276a496d43bd by Sheng, Yang <yang.sheng@intel.com>:

Add sycl platform

--
8d1196831a20f69ba8880d8549007358928f6be1 by Sheng, Yang <yang.sheng@intel.com>:

Add comments back

Merging this change closes #11425

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform 8d1196831a20f69ba8880d8549007358928f6be1
PiperOrigin-RevId: 634288679
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jun 6, 2024
Imported from GitHub PR openxla/xla#11425

It is a sub PR of openxla/xla#9042 to add sycl platform
Copybara import of the project:

--
7d0c37057c673f784089ce961d24276a496d43bd by Sheng, Yang <yang.sheng@intel.com>:

Add sycl platform

--
8d1196831a20f69ba8880d8549007358928f6be1 by Sheng, Yang <yang.sheng@intel.com>:

Add comments back

Merging this change closes #11425

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform 8d1196831a20f69ba8880d8549007358928f6be1
PiperOrigin-RevId: 640626910
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jun 6, 2024
Imported from GitHub PR openxla/xla#11425

It is a sub PR of openxla/xla#9042 to add sycl platform
Copybara import of the project:

--
7d0c37057c673f784089ce961d24276a496d43bd by Sheng, Yang <yang.sheng@intel.com>:

Add sycl platform

--
8d1196831a20f69ba8880d8549007358928f6be1 by Sheng, Yang <yang.sheng@intel.com>:

Add comments back

Merging this change closes #11425

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform 8d1196831a20f69ba8880d8549007358928f6be1
PiperOrigin-RevId: 640626910
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jun 6, 2024
Imported from GitHub PR openxla/xla#11425

It is a sub PR of openxla/xla#9042 to add sycl platform
Copybara import of the project:

--
7d0c37057c673f784089ce961d24276a496d43bd by Sheng, Yang <yang.sheng@intel.com>:

Add sycl platform

--
8d1196831a20f69ba8880d8549007358928f6be1 by Sheng, Yang <yang.sheng@intel.com>:

Add comments back

Merging this change closes #11425

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform 8d1196831a20f69ba8880d8549007358928f6be1
PiperOrigin-RevId: 640626910
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.

None yet

7 participants