-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][XPTI] Add XPTI notifications for SYCL 2020 images #9770
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
Conversation
This commit adds XPTI notifications for SYCL 2020 image classes (`sampled_image` and `unsampled_image`) as well as for the associated accessor classes (`sampled_image_accessor`, `host_sampled_image_accessor`, `unsampled_image_accessor` and `host_unsampled_image_accessor`). Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
@@ -65,6 +69,9 @@ class XPTIRegistry { | |||
// SYCL buffer events | |||
GBufferStreamID = xptiRegisterStream(SYCL_BUFFER_STREAM_NAME); | |||
this->initializeStream(SYCL_BUFFER_STREAM_NAME, 0, 1, "0.1"); | |||
// SYCL image events |
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.
@steffenlarsen It is okay to have a new stream for experimental data, but once it is validated, please ensure that the data is emitted in the default "sycl" stream. Everything that is a part of SYCL spec needs to be in the "sycl" 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.
I tried to follow buffers/accessors as closely as possible. Is there some logic I missed that promotes buffers/accessors out the experimental stream or is that a TODO?
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.
@steffenlarsen Having separate streams with common tracepoint types is a reasonable way to do this and limit the explosion of trace point types. When done with validating and settling on the 2020 image implementation, consider moving from "sycl.experimental.image" to "sycl.image"
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
xpti/include/xpti/xpti_data_types.h
Outdated
/// Used to notify that offload buffer will be destructed | ||
offload_alloc_destruct = XPTI_TRACE_POINT_BEGIN(22), | ||
offload_alloc_buffer_destruct = XPTI_TRACE_POINT_BEGIN(22), |
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.
Since we are in an ABI breakage window, can you change this to:
offload_alloc_buffer_destruct = XPTI_TRACE_POINT_END(20),
All pairs, such as [*_begin, _end], [_construct, *_destruct] etc should use XPTI_TRACE_POINT_BEGIN(X)/XPTI_TRACE_POINT_END(X) pairs where the same ID is used for the pair - in this case X.
We have 64 trace _BEGIN/_END pairs we can define here as default. We can extend it with user defined trace types (see documentation). So, we need to be careful about assigning trace_type IDs. If they are truly not scoped pair of trace types, then we may run out of IDs and may have to extend it to use more bits.
So, please consider:
offload_alloc_buffer_associate = XPTI_TRACE_POINT_BEGIN(21),
offload_alloc_buffer_release = XPTI_TRACE_POINT_END(21),
xpti/include/xpti/xpti_data_types.h
Outdated
/// handle of the offload sampled image | ||
offload_alloc_sampled_image_associate = XPTI_TRACE_POINT_BEGIN(27), | ||
/// Used to notify that offload sampled image will be destructed | ||
offload_alloc_sampled_image_destruct = XPTI_TRACE_POINT_BEGIN(28), |
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.
offload_alloc_sampled_image_destruct = XPTI_TRACE_POINT_END(26),
xpti/include/xpti/xpti_data_types.h
Outdated
/// Used to notify that offload sampled image will be destructed | ||
offload_alloc_sampled_image_destruct = XPTI_TRACE_POINT_BEGIN(28), | ||
/// Used to notify about releasing internal handle for offload sampled image | ||
offload_alloc_sampled_image_release = XPTI_TRACE_POINT_BEGIN(29), |
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.
Similarly, _associate/_release should be XPTI_TRACE_POINT_BEGIN(X)/_END(X) if they are semantically efer to the begin and end of the association.
offload_alloc_sampled_image_release = XPTI_TRACE_POINT_BEGIN(27)
xpti/include/xpti/xpti_data_types.h
Outdated
offload_alloc_unsampled_image_construct = XPTI_TRACE_POINT_BEGIN(30), | ||
/// Used to notify about association between user and internal | ||
/// handle of the offload unsampled image | ||
offload_alloc_unsampled_image_associate = XPTI_TRACE_POINT_BEGIN(31), | ||
/// Used to notify that offload unsampled image will be destructed | ||
offload_alloc_unsampled_image_destruct = XPTI_TRACE_POINT_BEGIN(32), | ||
/// Used to notify about releasing internal handle for offload unsampled image | ||
offload_alloc_unsampled_image_release = XPTI_TRACE_POINT_BEGIN(33), |
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.
Please consider making the same changes as indicated in previous comments.
xpti/include/xpti/xpti_data_types.h
Outdated
/// Indicates that the current event is an offload sampled image related | ||
offload_sampled_image = XPTI_EVENT(11), | ||
/// Indicates that the current event is an offload unsampled image related | ||
offload_unsampled_image = XPTI_EVENT(12), | ||
/// Indicates that the current event is an offload sampled image accessor | ||
/// related | ||
offload_sampled_image_accessor = XPTI_EVENT(13), | ||
/// Indicates that the current event is an offload sampled image host accessor | ||
/// related | ||
offload_host_sampled_image_accessor = XPTI_EVENT(14), | ||
/// Indicates that the current event is an offload unsampled image accessor | ||
/// related | ||
offload_unsampled_image_accessor = XPTI_EVENT(15), | ||
/// Indicates that the current event is an offload unsampled image host | ||
/// accessor related | ||
offload_host_unsampled_image_accessor = XPTI_EVENT(16), |
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.
The Event types are primarily used to indicate if the "busy" time is attributed to the scheduler, a barrier or an algorithm. For memory operations, this would be "algorithm" as it is needed by an algorithm or we can have a new category called "memory_operation". We don't anything more fine grain than that.
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
@tovinkere - As discussed a couple weeks ago, I have tried to consolidate the memory-object and accessor enumerators as well as fix the begin and end traces. Please let me know if I missed something or misunderstood something our discussion. |
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.
Everything looks good, except the one change requested in xpti_data_types.h
Need to get this in during the ABI breakage window.
@@ -385,21 +386,21 @@ enum class trace_point_type_t : uint16_t { | |||
mem_release_begin = XPTI_TRACE_POINT_BEGIN(18), | |||
/// Used to notify that memory has been released. | |||
mem_release_end = XPTI_TRACE_POINT_END(19), | |||
/// Used to notify that offload buffer will be created | |||
offload_alloc_construct = XPTI_TRACE_POINT_BEGIN(20), | |||
/// Used to notify that offload memory object will be created |
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.
@steffenlarsen Since we are consolidating the trace types and fixing issues before the ABI breakage window, can you please also change:
mem_alloc_begin = XPTI_TRACE_POINT_BEGIN(16), mem_alloc_end = XPTI_TRACE_POINT_END(16), mem_release_begin = XPTI_TRACE_POINT_BEGIN(17), mem_release_end = XPTI_TRACE_POINT_END(17),
The rest here look good.
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.
@steffenlarsen Since the ABI breakage window closes today, any updates to this request?
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.
Apologies. It has been addressed now. @stdale-intel - Any chance we can get this in despite the window closing yesterday? It is an XPTI ABI break.
@@ -65,6 +69,9 @@ class XPTIRegistry { | |||
// SYCL buffer events | |||
GBufferStreamID = xptiRegisterStream(SYCL_BUFFER_STREAM_NAME); | |||
this->initializeStream(SYCL_BUFFER_STREAM_NAME, 0, 1, "0.1"); | |||
// SYCL image events |
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.
@steffenlarsen Having separate streams with common tracepoint types is a reasonable way to do this and limit the explosion of trace point types. When done with validating and settling on the 2020 image implementation, consider moving from "sycl.experimental.image" to "sycl.image"
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
@intel/llvm-reviewers-runtime | @KseniyaTikhomirova - Friendly ping. |
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
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.
Update in the Native CPU test looks good, just FYI #10282 will change the test again, removing the CHECKs that caused you errors
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
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
Spoke to @stdale-intel offline and it should still be fine to merge. Cached checkout issue for HIP in CI is a known problem. |
This commit adds XPTI notifications for SYCL 2020 image classes (
sampled_image
andunsampled_image
) as well as for the associated accessor classes (sampled_image_accessor
,host_sampled_image_accessor
,unsampled_image_accessor
andhost_unsampled_image_accessor
).