[UR][L0v2][SYCL] Avoid redundant global timestamp query for profiling tag events - #22810
Open
againull wants to merge 5 commits into
Open
[UR][L0v2][SYCL] Avoid redundant global timestamp query for profiling tag events#22810againull wants to merge 5 commits into
againull wants to merge 5 commits into
Conversation
… 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
gmlueck
reviewed
Jul 30, 2026
gmlueck
left a comment
Contributor
There was a problem hiding this comment.
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.
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
Contributor
Author
Yes, that' correct. |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Specification change: #22847
submit_profiling_tagandenqueue_signal_eventalready record a GPU-written global timestamp viazeCommandListAppendWriteGlobalTimestamp. The additionalurDeviceGetGlobalTimestampscall 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_startandcommand_end.Assisted-By: Claude