Skip to content

[SYCL] Profile host events only if the submitted queue has profiling enabled #18982

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

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from

Conversation

againull
Copy link
Contributor

Currently profiling for host tasks is always enabled. Track profiling info only if the submitted queue (where host task is submitted) has profiling enabled.

…ng enabled

Currently profiling for host tasks is tracked no matter what. Track it
only if the queue, where host task is submitted, has profiling enabled.
@againull againull marked this pull request as ready for review June 13, 2025 22:17
@againull againull requested a review from a team as a code owner June 13, 2025 22:17
@againull againull requested a review from aelovikov-intel June 13, 2025 22:17
Copy link
Contributor

@aelovikov-intel aelovikov-intel left a comment

Choose a reason for hiding this comment

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

Do you know if this was a bug or a case of changing requirements/design decisions?

@@ -214,8 +200,22 @@ void event_impl::setQueue(queue_impl &Queue) {

void event_impl::setSubmittedQueue(std::weak_ptr<queue_impl> SubmittedQueue) {
MSubmittedQueue = std::move(SubmittedQueue);
if (MHostProfilingInfo) {
if (isHost()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Early returns for both ifs would help readability here.

Comment on lines +208 to +210
if (!MIsProfilingEnabled || MState == HES_Discarded ||
MState == HES_Complete)
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks sketchy. Can we assert that event is incomplete?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, what would "profiling enabled" even mean for the discarded events?

@againull
Copy link
Contributor Author

Do you know if this was a bug or a case of changing requirements/design decisions?

I believe this is a bug, according to spec 4.6.6. Event class:

Calls to get_profiling_info must throw an exception with the errc::invalid error code if the SYCL queue which submitted the command group this SYCL event is associated with was not constructed with the property::queue::enable_profiling property.

Also this can be considered as performance bug as well.

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.

2 participants