-
Notifications
You must be signed in to change notification settings - Fork 770
[SYCL] Deprecate discard_events queue prop, make impl no-op #18059
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
[SYCL] Deprecate discard_events queue prop, make impl no-op #18059
Conversation
Signed-off-by: JackAKirk <[email protected]>
Signed-off-by: JackAKirk <[email protected]>
Signed-off-by: JackAKirk <[email protected]>
@@ -9,8 +9,6 @@ | |||
__SYCL_DATA_LESS_PROP(property::queue, in_order, InOrder) | |||
__SYCL_DATA_LESS_PROP(property::queue, enable_profiling, QueueEnableProfiling) | |||
|
|||
__SYCL_DATA_LESS_PROP(ext::oneapi::property::queue, discard_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.
So I think we'd like to still have the property exist to avoid a breaking change, but when it's seen, it's just ignored.
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.
OK sure, I'll fix this. Thanks
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've now kept the property but made it a no-op. I've updated the PR description accordingly.
I've kept all discard events tests other than those which test that the underlying sycl::event
is nullptr
, this this PR makes those tests obsolete.
I've also updated to docs to mark sycl_ext_oneapi_discard_queue_events deprecated.
@JackAKirk can you also cleanup event_impl? I still see some references to discard events there. Or is this still needed for some paths? |
When we use the submit_without_event path the But I think you might be right that I can still remove some of the |
Signed-off-by: JackAKirk <[email protected]>
I've removed one case that is definitely safe to remove. However as discussed this doesn't seem worth it. |
- Make the prop no-op - add back full testing initially - deprecate discard_events extension Signed-off-by: JackAKirk <[email protected]>
Signed-off-by: JackAKirk <[email protected]>
I believe @KseniyaTikhomirova is working on a similar approach (having host task signal an event that we can pass to next enqueue function). However, there are some issues related to memory residence with this approach so this will probably happen as a next step. |
Conflicts resolved. The CI seems a bit flaky, Windows testing passed after a few reruns. Also friendly ping @intel/unified-runtime-reviewers-level-zero |
bool DiscardEvent = (MQueue->MDiscardEvents || !impl->MEventNeeded) && | ||
MQueue->supportsDiscardingPiEvents(); | ||
bool DiscardEvent = | ||
!impl->MEventNeeded && MQueue->supportsDiscardingPiEvents(); |
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.
MQueue->supportsDiscardingPiEvents() doesn't seem needed anymore
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.
Thanks, yeah I see this now: sycl_ext_oneapi_enqueue_functions.asciidoc doesn't require an in-order queue.
Fixed
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.
Although note that this change is technically out of the scope of just removing discard_events queue property functionality: The change on this line now makes more discarding of events in the impl for submit_without_event
on a sycl::queue without the in-order property. This seems to make some tests fail, despite it being allowed by the spec doc as I mention above. I will investigate.
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 it turns out that currently supportsDiscardingPiEvents
is still needed: see #18415
I've added it back.
@JackAKirk what's next with this PR? |
Signed-off-by: JackAKirk <[email protected]>
Signed-off-by: JackAKirk <[email protected]>
Failure due to deprecation warning, duplicate test case not necessary Signed-off-by: JackAKirk <[email protected]>
Turns out EnqueueFunctions submit_without_event still creates events for oo queue, and things break if supportsDiscardingPiEvents isn't used Signed-off-by: JackAKirk <[email protected]>
This should be ready to merge once tests pass. |
Test failures appear unrelated and occur in other PRs: see #18416 |
@intel/llvm-gatekeepers this is ready to be merged. Thanks |
Deprecates sycl_ext_oneapi_discard_queue_events in favour of the sycl_ext_oneapi_enqueue_functions extension.
In order to simplify/allow further simplifications to the handler/scheduler code the implementation of the
discard_events
queue property is also made a no-op immediately.The main consequence of this is that users of
discard_events
will have to ensure they use the newsubmit_without_event
/nd_launch
etc APIs from https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_enqueue_functions.asciidocsycl::event
is very lightweight already in the level_zero v2 adapter and discard_events already doesn't have a very big performance advantage for this case. Therefore the biggest consequence of this PR from a performance point of view is in the cuda/hip backends. Users of these backends need to be aware of the performance implications of making thediscard_events
no-op, and should ensure that they switch to using thesycl_ext_oneapi_enqueue_functions
.This PR leaves all other functionality working correctly.