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

[XLA:GPU] Add sycl platform #11425

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

Conversation

ShengYang1
Copy link
Contributor

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

@ShengYang1 ShengYang1 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
@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.

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

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 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
@dimitar-asenov
Copy link
Member

I'm looking into this, there's some google internal bits that we need to add on our end.

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
@dimitar-asenov
Copy link
Member

@ddunl, could you please take a look at the internal errors? I think we need to adjust the copybara config, but I'm not sure what's the right tweak.

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

9 participants