Skip to content

Conversation

@Solaryee
Copy link
Contributor

It is a sub PR of #9042 to add sycl platform

@Solaryee Solaryee changed the title Add sycl platform [XLA:GPU] Add sycl platform Apr 11, 2024
@github-actions github-actions bot added the kokoro:force-run Forces CI to rerun label Apr 11, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Forces CI to rerun label Apr 11, 2024
@Solaryee Solaryee force-pushed the yang/sycl-platform branch from c809f0d to 9aae8eb Compare April 11, 2024 03:46
@github-actions github-actions bot added the kokoro:force-run Forces CI to rerun label Apr 11, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Forces CI to rerun label Apr 11, 2024
@thomasjoerg
Copy link
Member

@golechwierowicz friendly ping!

Copy link
Member

@golechwierowicz golechwierowicz left a comment

Choose a reason for hiding this comment

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

LGTM, but I might be lacking some context. @penpornk could you take a look, I see you were a reviewer of the bigger PR stream.

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.

So sorry for the delay! I have minor comments.

@@ -0,0 +1,86 @@
# Description:
# SYCL-platform specific StreamExecutor support code.
# buildifier: disable=out-of-order-load
Copy link
Member

Choose a reason for hiding this comment

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

Nit: This line is duplicated. Please remove.


cc_library(
name = "sycl_rpath",
data = [],
Copy link
Member

Choose a reason for hiding this comment

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

Nit: This line can be removed.

Comment on lines 70 to 74
linkopts = select({
"//conditions:default": [
"-Wl,-rpath,../local_config_sycl/sycl/sycl/lib",
],
}),
Copy link
Member

Choose a reason for hiding this comment

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

This can be simplified to

Suggested change
linkopts = select({
"//conditions:default": [
"-Wl,-rpath,../local_config_sycl/sycl/sycl/lib",
],
}),
linkopts = ["-Wl,-rpath,../local_config_sycl/sycl/sycl/lib"],

"-Wl,-rpath,../local_config_sycl/sycl/sycl/lib",
],
}),
deps = [],
Copy link
Member

Choose a reason for hiding this comment

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

Nit: This line can be removed.

Comment on lines 61 to 63
deps = if_sycl_is_configured([
":sycl_platform",
]),
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Let's make this more compact since there is only one dependency right now.

Suggested change
deps = if_sycl_is_configured([
":sycl_platform",
]),
deps = if_sycl_is_configured([":sycl_platform"]),


SyclPlatform::~SyclPlatform() {}

// Due to legacy issues in user code, we can't currently call InpectNumaNodes
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Typo

Suggested change
// Due to legacy issues in user code, we can't currently call InpectNumaNodes
// Due to legacy issues in user code, we can't currently call InspectNumaNodes


SyclPlatform::~SyclPlatform() {}

// Due to legacy issues in user code, we can't currently call InpectNumaNodes
Copy link
Member

Choose a reason for hiding this comment

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

Could you please explain more about these legacy issues? Are they the same as CUDA and ROCm?

// Due to legacy issues in user code, we can't currently call InpectNumaNodes
// at module initialization time, because non-GPU programs still include this
// plugin via various methods, so instead, it has to be init-on-reference.
void SyclPlatform::InspectNumaNodes() {
Copy link
Member

Choose a reason for hiding this comment

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

InspectNumaNodes, BusCount, DeviceToBus, FirstExecutorForBus, DescriptionForDevice, ExecutorForDevice, GetExecutor, and GetUncachedExecutor seem pretty similar across CUDA/ROCm/SYCL platforms. Just a heads up that I will refactor them to a base class later.


// The smallest NUMA node value for any device managed by this machine
// manager. Used, along with limit_numa_node_, to convert NUMA nodes into bus
// ordinals. The NUMA node space occupied by GPUs is assumed to be dense./
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Extra character.

Suggested change
// ordinals. The NUMA node space occupied by GPUs is assumed to be dense./
// ordinals. The NUMA node space occupied by GPUs is assumed to be dense.

using SyclPlatform = gpu::SyclPlatform;

} // namespace sycl

Copy link
Member

Choose a reason for hiding this comment

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

Nit: Let's remove this extra blank line.

@Solaryee Solaryee force-pushed the yang/sycl-platform branch from 9aae8eb to 7d0c370 Compare May 8, 2024 01:52
@github-actions github-actions bot added the kokoro:force-run Forces CI to rerun label May 8, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Forces CI to rerun label May 8, 2024
@Solaryee
Copy link
Contributor Author

Solaryee commented May 8, 2024

So sorry for the delay! I have minor comments.

Thanks:) I have addressed all of your comments.

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! One more nit please. :)

P.S. In the future, could you please avoid force-pushing (i.e., replacing the original commit with a new one)? Committing new changes as new commits on top of the original one helps Github highlight changes since my last review for me.

@@ -0,0 +1,70 @@
load(
Copy link
Member

Choose a reason for hiding this comment

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

When I said that the line is duplicated, I only meant the # buildifier: disable=out-of-order-load line. (There were two of them.) Please add this back:

# Description:
#   SYCL-platform specific StreamExecutor support code.

(We can remove the buildifier tag if it isn't needed.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Done.

@github-actions github-actions bot added the kokoro:force-run Forces CI to rerun label May 8, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Forces CI to rerun label May 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!

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
@NaiyerRizz
Copy link

Hi @penpornk
This PR has been approved but not yet merged, Can you please look into this.

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 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
@Solaryee
Copy link
Contributor Author

Solaryee commented Jun 7, 2024

There's a new policy requiring all new PRs adding new functionality to provide tests. Could you please add a test that creates a mock SYCL device and test the SYCL platform functionalities added in this PR? Thank you very much!

I've been working on the tests but encountered a challenge due to the dependencies of this PR. Currently, the code can only be built but not fully run since it relies on symbols(GpuDriver/GpuExecutor) which should be covered in other PRs. Is it possible to add those tests when SYCL stream-executor PRs are fully merged?

@dimitar-asenov
Copy link
Member

I'm working on merging this internally.

@NaiyerRizz NaiyerRizz self-assigned this Jul 10, 2024
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jul 10, 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

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

Add UTs

Merging this change closes #11425

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#11425 from Intel-tensorflow:yang/sycl-platform fca9eb26139b8a2494820a02b555d2746b74f21c
PiperOrigin-RevId: 650955380
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jul 12, 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 Jul 12, 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 Jul 12, 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 Jul 12, 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 Jul 12, 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 Jul 12, 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 Jul 13, 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 Jul 13, 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 Jul 13, 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

PiperOrigin-RevId: 652040832
copybara-service bot pushed a commit that referenced this pull request Jul 15, 2024
This is needed for path transformations.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#11425 from Intel-tensorflow:yang/sycl-platform 8d11968
PiperOrigin-RevId: 652385439
copybara-service bot pushed a commit that referenced this pull request Jul 15, 2024
FUTURE_COPYBARA_INTEGRATE_REVIEW=#11425 from Intel-tensorflow:yang/sycl-platform 8d11968
PiperOrigin-RevId: 652385439
copybara-service bot pushed a commit that referenced this pull request Jul 15, 2024
XLA should not include any platform specific headers in XLA header files.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#11425 from Intel-tensorflow:yang/sycl-platform 8d11968
PiperOrigin-RevId: 650340235
copybara-service bot pushed a commit that referenced this pull request Jul 15, 2024
Removing a constraint on a dimension is invalid, even if the
dimension is unused in the affine map. The constraint still
restricts the domain of the map.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#11425 from Intel-tensorflow:yang/sycl-platform 8d11968
PiperOrigin-RevId: 652413273
copybara-service bot pushed a commit that referenced this pull request Jul 15, 2024
@dimitar-asenov
Copy link
Member

This was merged by c781e75

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.

10 participants