-
Notifications
You must be signed in to change notification settings - Fork 340
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
base: main
Are you sure you want to change the base?
[XLA:GPU] Add sycl platform #11425
Conversation
c809f0d
to
9aae8eb
Compare
@golechwierowicz friendly ping! |
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.
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.
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.
So sorry for the delay! I have minor comments.
xla/stream_executor/sycl/BUILD
Outdated
@@ -0,0 +1,86 @@ | |||
# Description: | |||
# SYCL-platform specific StreamExecutor support code. | |||
# buildifier: disable=out-of-order-load |
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.
Nit: This line is duplicated. Please remove.
xla/stream_executor/sycl/BUILD
Outdated
|
||
cc_library( | ||
name = "sycl_rpath", | ||
data = [], |
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.
Nit: This line can be removed.
xla/stream_executor/sycl/BUILD
Outdated
linkopts = select({ | ||
"//conditions:default": [ | ||
"-Wl,-rpath,../local_config_sycl/sycl/sycl/lib", | ||
], | ||
}), |
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.
This can be simplified to
linkopts = select({ | |
"//conditions:default": [ | |
"-Wl,-rpath,../local_config_sycl/sycl/sycl/lib", | |
], | |
}), | |
linkopts = ["-Wl,-rpath,../local_config_sycl/sycl/sycl/lib"], |
xla/stream_executor/sycl/BUILD
Outdated
"-Wl,-rpath,../local_config_sycl/sycl/sycl/lib", | ||
], | ||
}), | ||
deps = [], |
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.
Nit: This line can be removed.
xla/stream_executor/sycl/BUILD
Outdated
deps = if_sycl_is_configured([ | ||
":sycl_platform", | ||
]), |
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.
Nit: Let's make this more compact since there is only one dependency right now.
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 |
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.
Nit: Typo
// 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 |
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.
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() { |
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.
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./ |
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.
Nit: Extra character.
// 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 | ||
|
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.
Nit: Let's remove this extra blank line.
9aae8eb
to
7d0c370
Compare
Thanks:) I have addressed all of your comments. |
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.
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( |
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.
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.)
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.
Got it. Done.
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.
Thank you!
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
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
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
Hi @penpornk |
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
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
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
I'm looking into this, there's some google internal bits that we need to add on our end. |
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
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
@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. |
It is a sub PR of #9042 to add sycl platform