Skip to content

Commit

Permalink
[SYCL][UR][L0] Fix issue with event caching causing profiling tag con…
Browse files Browse the repository at this point in the history
…flicts (#16233)

This commit adds a test and changes to a UR version that fixes an issue
where the L0 would report old timestamp recordings for events produced
for profiling tags, due to reusing of dead events.

---------

Signed-off-by: Larsen, Steffen <[email protected]>
Co-authored-by: Kenneth Benzie (Benie) <[email protected]>
  • Loading branch information
2 people authored and KornevNikita committed Feb 24, 2025
1 parent 6778ab7 commit df7375d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sycl/cmake/modules/FetchUnifiedRuntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ if(SYCL_UR_USE_FETCH_CONTENT)
CACHE PATH "Path to external '${name}' adapter source dir" FORCE)
endfunction()

set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime")
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/UnifiedRuntimeTag.cmake)

set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
Expand Down
14 changes: 7 additions & 7 deletions sycl/cmake/modules/UnifiedRuntimeTag.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# commit e37f75ffad5ad22e96c46eb70ab1757be7cc5afc
# Merge: daa0b110464c 323b37c55504
# Author: Martin Grant <martin.morrisongrant@codeplay.com>
# Date: Fri Dec 6 18:03:11 2024 +0000
# Merge pull request #2379 from Bensuo/ben/coverity-fixes
# Fix command_buffer coverity issues
set(UNIFIED_RUNTIME_TAG e37f75ffad5ad22e96c46eb70ab1757be7cc5afc)
# commit 5c10466f349b0ff303bd14b015f64bbcd0b78d7d
# Merge: ffcc53b6 b7b6b557
# Author: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
# Date: Mon Dec 9 14:58:34 2024 +0000
# Merge pull request #2410 from steffenlarsen/steffen/fix_profiling_tag_eviction_and_caching
# [L0] Fix cached and evicted timestamp recordings
set(UNIFIED_RUNTIME_TAG 5c10466f349b0ff303bd14b015f64bbcd0b78d7d)
33 changes: 33 additions & 0 deletions sycl/test-e2e/Regression/profiling_tag_cached_conflicting.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// REQUIRES: aspect-ext_oneapi_queue_profiling_tag
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

// Regression test to ensure that the adapters do not tamper (e.g. through
// caching the events) the recordings.

// HIP backend currently returns invalid values for submission time queries.
// UNSUPPORTED: hip
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/12904

// CUDA backend seems to fail sporadically for expected profiling tag time
// query orderings.
// UNSUPPORTED: cuda
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/14053

#include <sycl/detail/core.hpp>
#include <sycl/ext/oneapi/experimental/profiling_tag.hpp>

int main() {
sycl::queue Q{sycl::property::queue::in_order()};

uint64_t T1 = 0;
for (size_t I = 0; I < 20; ++I) {
sycl::event E = sycl::ext::oneapi::experimental::submit_profiling_tag(Q);
uint64_t T2 =
E.get_profiling_info<sycl::info::event_profiling::command_end>();
assert(T1 < T2);
std::swap(T1, T2);
}

return 0;
}

0 comments on commit df7375d

Please sign in to comment.