From 8de5a7f0e56059268577c4bf311c1bd918cce0b4 Mon Sep 17 00:00:00 2001 From: Jaime Arteaga Date: Wed, 1 Nov 2023 15:07:16 -0700 Subject: [PATCH 1/2] [UR][L0] Correctly wait on barrier on urEnqueueEventsWaitWithBarrier When event list is null, a barrier is still needed for all previous commands if profiling is enabled, so fix it. Signed-off-by: Jaime Arteaga --- sycl/plugins/unified_runtime/CMakeLists.txt | 4 +-- .../level_zero_barrier_optimization.cpp | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index 1d4d0c52caa19..4cd0ba7bb0e92 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -53,14 +53,14 @@ endif() if(SYCL_PI_UR_USE_FETCH_CONTENT) include(FetchContent) - set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") + set(UNIFIED_RUNTIME_REPO "https://github.com/jandres742/unified-runtime.git") # commit ec7982bac6cb3a6b9ed610cd6b7cb41fcbc780dc # Merge: 62e6d2f9 5fb82924 # Author: Kenneth Benzie (Benie) # Date: Wed Nov 8 13:32:46 2023 +0000 # Merge pull request #1022 from 0x12CC/l0_usm_error_checking_2 # [UR][L0] Propagate OOM errors from `USMAllocationMakeResident` - set(UNIFIED_RUNTIME_TAG ec7982bac6cb3a6b9ed610cd6b7cb41fcbc780dc) + set(UNIFIED_RUNTIME_TAG 60a09f65c7dafc7f21927b46cf31f617b55d5d59) if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO) set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}") diff --git a/sycl/test-e2e/Plugin/level_zero_barrier_optimization.cpp b/sycl/test-e2e/Plugin/level_zero_barrier_optimization.cpp index a77e15007b7c4..6daca2cedbe83 100644 --- a/sycl/test-e2e/Plugin/level_zero_barrier_optimization.cpp +++ b/sycl/test-e2e/Plugin/level_zero_barrier_optimization.cpp @@ -10,6 +10,8 @@ int main() { sycl::queue Q1({sycl::property::queue::in_order{}}); sycl::queue Q2({sycl::property::queue::in_order{}}); + sycl::queue Q3({sycl::property::queue::in_order{}, + sycl::property::queue::enable_profiling{}}); // Test case 1 - events in the barrier's waitlist are from different queues. std::cout << "Test1" << std::endl; @@ -126,5 +128,30 @@ int main() { assert(Event11.get_info() == sycl::info::event_command_status::complete); + // Test case 6 - submit barrier after queue sync with profiling enabled, i.e. + // last event = nullptr. + std::cout << "Test3" << std::endl; + auto Event12 = Q3.submit( + [&](sycl::handler &cgh) { cgh.single_task([]() {}); }); + auto Event13 = Q3.submit( + [&](sycl::handler &cgh) { cgh.single_task([]() {}); }); + Q3.wait(); + + // CHECK: Test3 + // CHECK: ---> piEnqueueEventsWaitWithBarrier( + // CHECK: ZE ---> zeEventCreate + // CHECK-NOT: ZE ---> zeCommandListAppendWaitOnEvents + // CHECK-NOT: ZE ---> zeCommandListAppendSignalEvent + // CHECK: ZE ---> zeCommandListAppendBarrier + // CHECK: ) ---> pi_result : PI_SUCCESS + auto BarrierEvent6 = Q3.ext_oneapi_submit_barrier({Event12, Event13}); + BarrierEvent6.wait(); + + // Check that kernel events are completed after waiting for barrier event. + assert(Event12.get_info() == + sycl::info::event_command_status::complete); + assert(Event13.get_info() == + sycl::info::event_command_status::complete); + return 0; } From 632349299f4c87e7e80af411fc3f1e6cb100da84 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Fri, 8 Dec 2023 12:21:21 +0000 Subject: [PATCH 2/2] [UR] Bump tag to e69ed214 --- sycl/plugins/unified_runtime/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index 196f69c795289..167d5d8c77695 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -56,14 +56,14 @@ endif() if(SYCL_PI_UR_USE_FETCH_CONTENT) include(FetchContent) - set(UNIFIED_RUNTIME_REPO "https://github.com/jandres742/unified-runtime.git") - # commit ec7982bac6cb3a6b9ed610cd6b7cb41fcbc780dc - # Merge: 62e6d2f9 5fb82924 + set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") + # commit e69ed21468e04ed6e832accf162422ed11736446 + # Merge: 20fa0b5f 7fd9dafd # Author: Kenneth Benzie (Benie) - # Date: Wed Nov 8 13:32:46 2023 +0000 - # Merge pull request #1022 from 0x12CC/l0_usm_error_checking_2 - # [UR][L0] Propagate OOM errors from `USMAllocationMakeResident` - set(UNIFIED_RUNTIME_TAG 60a09f65c7dafc7f21927b46cf31f617b55d5d59) + # Date: Fri Dec 8 12:18:51 2023 +0000 + # Merge pull request #962 from jandres742/fixwaitbarrierwithevent + # [UR][L0] Correctly wait on barrier on urEnqueueEventsWaitWithBarrier + set(UNIFIED_RUNTIME_TAG e69ed21468e04ed6e832accf162422ed11736446) if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO) set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")