Conversation
Contributor
Author
|
@KornevNikita |
crystarm
force-pushed
the
profiling-tag-opencl-timestamp-recording-v2
branch
from
September 13, 2026 09:44
e514e9c to
cdbb9d7
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved event contract, argument-validation, and regression-test issues remain.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Fixes OpenCL GPU profiling-tag ordering and fallback timestamp handling.
Changes:
- Adds OpenCL timestamp recording via profiled buffer fills.
- Updates SYCL profiling and scheduler fallback behavior.
- Expands unit and end-to-end test coverage.
File summaries
| File | Summary |
|---|---|
unified-runtime/source/adapters/opencl/event.cpp |
Implements timestamp recording; event-type and argument-validation issues remain. |
unified-runtime/source/adapters/opencl/context.hpp |
Manages the internal timestamp buffer. |
sycl/unittests/Extensions/ProfilingTag.cpp |
Adds profiling timestamp and fallback coverage. |
sycl/test-e2e/ProfilingTag/profiling_queue.cpp |
Exercises OpenCL profiling queues. |
sycl/test-e2e/ProfilingTag/in_order_profiling_queue.cpp |
Exercises OpenCL in-order profiling queues. |
sycl/test-e2e/ProfilingTag/common.hpp |
Validates timestamp ordering; the original submit-time assertion should be retained. |
sycl/source/event.cpp |
Waits before profiling-tag submit-time queries. |
sycl/source/detail/scheduler/commands.cpp |
Adds timestamp-recording fallback behavior. |
sycl/source/detail/event_impl.cpp |
Uses completion timestamps for profiling tags. |
sycl/include/sycl/ext/oneapi/experimental/profiling_tag.hpp |
Routes supported fallback queues through the scheduler. |
Review details
Suppressed comments (2)
sycl/test-e2e/ProfilingTag/common.hpp:66
- The test no longer checks that
StartTagSubmitis non-zero: this line replaced the original assertion instead of adding the newEndTagEndcheck. A regression that returns zero for the first tag's submit timestamp would now pass the non-zero checks, so keep both assertions.
CHECK(Failures, EndTagEnd != 0)
unified-runtime/source/adapters/opencl/event.cpp:314
- The UR contract for
urEnqueueTimestampRecordingExprequires a non-nullphEventand specifiesUR_RESULT_ERROR_INVALID_NULL_POINTERotherwise (unified-runtime/include/unified-runtime/ur_api.h:11205). BecauseifUrEventtreats this pointer as optional, this implementation returns success without an event for that invalid call; validatephEventbefore querying the queue or enqueueing the fill.
const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) {
- Files reviewed: 10/10 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| cl_mem Buffer = nullptr; | ||
| UR_RETURN_ON_FAILURE(Queue->Context->getTimestampRecordingBuffer(&Buffer)); | ||
|
|
||
| std::vector<cl_event> CLWaitEvents(numEventsInWaitList); |
Comment on lines
+348
to
+351
| CL_RETURN_ON_FAILURE(clEnqueueFillBuffer( | ||
| Queue->CLQueue, Buffer, &Pattern, sizeof(Pattern), /*offset=*/0, | ||
| /*size=*/sizeof(Pattern), numEventsInWaitList, CLWaitList, | ||
| ifUrEvent(phEvent, Event))); |
Contributor
|
@crystarm looks like the pre-commit finally passes |
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.
Supersedes #22641.
Resolves #22229.
This PR reapplies the two previously reviewed OpenCL profiling tag changes on top of the current
syclbranch and adds a separate fix for profiling tag fallback timestamps.#22810 changed profiling tag timestamp handling so that
MSubmitTimeis no longer initialized for profiling tag events. The previous Native CPU fallback fix relied on that field, causingcommand_submitto remain zero when CI tested the change together with the currentsyclbranch.The new fix follows the timestamp model introduced by #22810: profiling tag events remain marked as tags and use their device-recorded completion timestamp for
command_submit,command_start, andcommand_end.Validation:
The Native CPU E2E was built locally with the existing diagnostic libspirv stub and
-O0; CI remains the authoritative full-toolchain validation.For the background on why this PR replaces #22641, see #22641 (comment).