Skip to content

[UR][L0v2][SYCL] Avoid redundant global timestamp query for profiling tag events - #22810

Open
againull wants to merge 5 commits into
syclfrom
fix/fix-profiling-tag-latency
Open

[UR][L0v2][SYCL] Avoid redundant global timestamp query for profiling tag events#22810
againull wants to merge 5 commits into
syclfrom
fix/fix-profiling-tag-latency

Conversation

@againull

@againull againull commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Specification change: #22847

submit_profiling_tag and enqueue_signal_event already record a GPU-written global timestamp via zeCommandListAppendWriteGlobalTimestamp. The additional urDeviceGetGlobalTimestamps call used to capture the submission and start times adds no value, since users only rely on the end timestamp.

Change implementation so that a tag event carries a single timestamp, reported alike for command_submit, command_start and command_end.

Assisted-By: Claude

… tag events

submit_profiling_tag and enqueue_signal_event already record a GPU-written
global timestamp via zeCommandListAppendWriteGlobalTimestamp. The additional
urDeviceGetGlobalTimestamps call used to capture the submission and start times
adds no value, since users only rely on the end timestamp.

Change the specification and implementation so that a tag event carries a
single timestamp, reported alike for command_submit, command_start and
command_end.

This drops the call in both the UR L0 v2 adapter and the SYCL RT, removes the
now-unused start-timestamp machinery.
Tests updated accordingly (the three fields are now equal for tag operations).

Assisted-By: Claude
@againull
againull requested review from a team as code owners July 30, 2026 06:30
@againull
againull requested a review from uditagarwal97 July 30, 2026 06:30

@gmlueck gmlueck left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

removes the now-unused start-timestamp machinery

Just checking ... we still set the start timestamp for other events, right? For example, events returned from queue::submit.

Comment thread sycl/doc/extensions/experimental/sycl_ext_oneapi_reusable_events.asciidoc Outdated
againull added 3 commits July 31, 2026 10:23
The follow-up commits keep command_submit <= command_start <= command_end for
tag events (immediate queues report a single timestamp for all three; batched
queues still record a distinct submission time). The observable semantics thus
match the original specification, so the spec wording and ProfilingTag test
assertions are restored to their pre-change form.

Assisted-By: Claude
…tags

The initial version reported command_submit == command_start == command_end for
all tag events and dropped the urDeviceGetGlobalTimestamps query. That query is
only redundant for immediate queues, where the tag is submitted right away.

Reintroduce the query for batched queues (ur_queue_batched_t), where submission
is deferred and command_submit meaningfully precedes execution, while keeping
immediate queues on the fast path (no query; the GPU-written timestamp is
reported for all fields). appendTimestampRecordingExp gains a recordSubmit flag
set by the queue. The recorded submission timestamp is also the reference for
end-timestamp wrap-around correction.

The SYCL RT no longer records a host submission time for tag events, relying on
the adapter for command_submit.

Assisted-By: Claude
Apply the same optimization to the L0 v1 adapter: in
urEnqueueTimestampRecordingExp, query urDeviceGetGlobalTimestamps for
command_submit only for batched (non-immediate) queues, where submission is
deferred. Immediate queues report the GPU-written timestamp for command_submit
as well. The recorded submission timestamp, when present, is the reference for
end-timestamp wrap-around correction.

Assisted-By: Claude
@againull

Copy link
Copy Markdown
Contributor Author

removes the now-unused start-timestamp machinery

Just checking ... we still set the start timestamp for other events, right? For example, events returned from queue::submit.

Yes, that' correct.

@againull
againull requested a review from sergey-semenov July 31, 2026 18:11
Following the spec agreement, a tag operation (submit_profiling_tag /
enqueue_signal_event) is an empty command, so command_submit, command_start and
command_end all report the single GPU-written completion timestamp.
This removes the batched-queue special case added earlier (the extra
urDeviceGetGlobalTimestamps query for command_submit and the associated
wrap-around handling) from both the L0 v1 and v2 adapters.

Assisted-By: Claude
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.

3 participants