From bccf836c8fcb6050d23fe17a07a3cd1696ce9196 Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Mon, 2 Dec 2024 09:01:16 -0800 Subject: [PATCH 1/4] [SYCL][UR][L0] Fix issue with event caching causing profiling tag conflicts 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 --- sycl/cmake/modules/FetchUnifiedRuntime.cmake | 2 +- sycl/cmake/modules/UnifiedRuntimeTag.cmake | 8 +---- .../profiling_tag_cached_conflicting.cpp | 32 +++++++++++++++++++ 3 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 sycl/test-e2e/Regression/profiling_tag_cached_conflicting.cpp diff --git a/sycl/cmake/modules/FetchUnifiedRuntime.cmake b/sycl/cmake/modules/FetchUnifiedRuntime.cmake index e9d52c5b23dac..fb418d1772342 100644 --- a/sycl/cmake/modules/FetchUnifiedRuntime.cmake +++ b/sycl/cmake/modules/FetchUnifiedRuntime.cmake @@ -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/steffenlarsen/unified-runtime") include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/UnifiedRuntimeTag.cmake) set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES") diff --git a/sycl/cmake/modules/UnifiedRuntimeTag.cmake b/sycl/cmake/modules/UnifiedRuntimeTag.cmake index bd50587d7a105..e6070ada9c4aa 100644 --- a/sycl/cmake/modules/UnifiedRuntimeTag.cmake +++ b/sycl/cmake/modules/UnifiedRuntimeTag.cmake @@ -1,7 +1 @@ -# commit eb076da108a49ef1426f38690547a71905f58015 -# Merge: d8d8ee90 46832dfd -# Author: Callum Fare -# Date: Fri Nov 29 15:54:31 2024 +0000 -# Merge pull request #2396 from kswiecicki/init-results-fix -# [L0] Add nullopt check before init results access -set(UNIFIED_RUNTIME_TAG eb076da108a49ef1426f38690547a71905f58015) +set(UNIFIED_RUNTIME_TAG b7b6b55769c2f4e8ffb077a9f945e371232148f2) diff --git a/sycl/test-e2e/Regression/profiling_tag_cached_conflicting.cpp b/sycl/test-e2e/Regression/profiling_tag_cached_conflicting.cpp new file mode 100644 index 0000000000000..5f23d73cd6fdc --- /dev/null +++ b/sycl/test-e2e/Regression/profiling_tag_cached_conflicting.cpp @@ -0,0 +1,32 @@ +// 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 + +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(); + assert(T1 < T2); + std::swap(T1, T2); + } + + return 0; +} From eadbee384983e4001dea9761b33e84a59ef83228 Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Mon, 2 Dec 2024 22:39:49 -0800 Subject: [PATCH 2/4] Fix illegal includes Signed-off-by: Larsen, Steffen --- sycl/test-e2e/Regression/profiling_tag_cached_conflicting.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sycl/test-e2e/Regression/profiling_tag_cached_conflicting.cpp b/sycl/test-e2e/Regression/profiling_tag_cached_conflicting.cpp index 5f23d73cd6fdc..11064d4290182 100644 --- a/sycl/test-e2e/Regression/profiling_tag_cached_conflicting.cpp +++ b/sycl/test-e2e/Regression/profiling_tag_cached_conflicting.cpp @@ -14,7 +14,8 @@ // UNSUPPORTED: cuda // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/14053 -#include +#include +#include int main() { sycl::queue Q{sycl::property::queue::in_order()}; From d98db0df87f23bae8385bd11fab93ffe86f632bf Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Mon, 9 Dec 2024 15:00:56 +0000 Subject: [PATCH 3/4] [UR] Bump main tag to 5c10466f --- sycl/cmake/modules/UnifiedRuntimeTag.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sycl/cmake/modules/UnifiedRuntimeTag.cmake b/sycl/cmake/modules/UnifiedRuntimeTag.cmake index e6070ada9c4aa..92074cc6ed478 100644 --- a/sycl/cmake/modules/UnifiedRuntimeTag.cmake +++ b/sycl/cmake/modules/UnifiedRuntimeTag.cmake @@ -1 +1,7 @@ -set(UNIFIED_RUNTIME_TAG b7b6b55769c2f4e8ffb077a9f945e371232148f2) +# commit 5c10466f349b0ff303bd14b015f64bbcd0b78d7d +# Merge: ffcc53b6 b7b6b557 +# Author: Kenneth Benzie (Benie) +# 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) From 30cf8b999462718fe5b8512bcd4ada883c8f6741 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Mon, 9 Dec 2024 15:02:53 +0000 Subject: [PATCH 4/4] [UR] Reset repo URL --- sycl/cmake/modules/FetchUnifiedRuntime.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/cmake/modules/FetchUnifiedRuntime.cmake b/sycl/cmake/modules/FetchUnifiedRuntime.cmake index fb418d1772342..72841724fa01d 100644 --- a/sycl/cmake/modules/FetchUnifiedRuntime.cmake +++ b/sycl/cmake/modules/FetchUnifiedRuntime.cmake @@ -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/steffenlarsen/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")