Skip to content

Conversation

@jandres742
Copy link
Contributor

Signed-off-by: Jaime Arteaga [email protected]

@jandres742 jandres742 requested a review from a team as a code owner May 8, 2022 21:32
case PI_PROFILING_INFO_COMMAND_START: {
ZE_CALL(zeEventQueryKernelTimestamp, (Event->ZeEvent, &tsResult));
uint64_t ContextStartTime =
(tsResult.context.kernelStart & TimestampMaxValue) * ZeTimerResolution;
Copy link
Contributor

Choose a reason for hiding this comment

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

any comments why using "context" is incorrect here? (the event being profiled belongs to a L0 context)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@smaslov-intel

from https://spec.oneapi.io/level-zero/latest/core/api.html?highlight=timestamp#ze-kernel-timestamp-result-t

global: [out] wall-clock data

context: [out] context-active data; only includes clocks while device context was actively executing.

So with global we get actual global time, including any time the workload has been preempted.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. I don't see SYCL spec saying anything about what the timestamp values should include: https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#_event_information_and_profiling_descriptors

So I guess it's OK to return either one. Just curious what was the problem while returning "context" timestamps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@smaslov-intel

Right, i didnt see anything in particular in SYCL specl.

Now, let's say we submit a kernel for execution, but because of scheduling and other hardware mechanisms, the kernel doesn't start execution right away. Now, it starts execution and gets preempted, and then resume again.

context timestamp would include only the time where the kernel was actively being executed, while the global timestamp would include even the times the kernel is waiting for active resources to execute. I would say that since SYCL is not clear which one is used, we could assume global is the one of importance here, as you said.

@againull againull merged commit 76a3898 into intel:sycl May 10, 2022
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