From 4c6468ebd5b13f7f36cc5be93c92d7129e6b788e Mon Sep 17 00:00:00 2001 From: Pratik Bari Date: Mon, 8 Dec 2025 08:46:20 +0000 Subject: [PATCH 1/7] fix: Fix the Sysman Engine Test for the workload submission If engine utilization prior to workload submission is above 5%, the check for the utilization values before and after workload should be skipped. Related-To: NEO-16864 Signed-off-by: Pratik Bari --- .../sysman/test_sysman_engine/src/test_sysman_engine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp index c24147a7..517ed70a 100644 --- a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp +++ b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp @@ -320,6 +320,12 @@ LZT_TEST_F( static_cast(s1.timestamp)); } + if(pre_utilization > 0.05) { + LOG_INFO << "Pre-utilization is already high: " + << pre_utilization * 100 << "%, skipping workload test."; + continue; + } + // submit workload and measure utilization #ifdef USE_ZESINIT auto sysman_device_properties = From 8a7f650fad98ff575d4de284fbfcf7fe93935c34 Mon Sep 17 00:00:00 2001 From: Pratik Bari Date: Mon, 8 Dec 2025 09:01:55 +0000 Subject: [PATCH 2/7] fix: Fix the Sysman Engine Test for the workload submission If engine utilization prior to workload submission exceeds 5%, the check for the utilization values before and after workload should be skipped. Related-To: NEO-16864 Signed-off-by: Pratik Bari --- .../sysman/test_sysman_engine/src/test_sysman_engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp index 517ed70a..73ec4668 100644 --- a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp +++ b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp @@ -320,7 +320,7 @@ LZT_TEST_F( static_cast(s1.timestamp)); } - if(pre_utilization > 0.05) { + if (pre_utilization > 0.05) { LOG_INFO << "Pre-utilization is already high: " << pre_utilization * 100 << "%, skipping workload test."; continue; From 13af01eaca389b8fb91d7ec02e286608f4fdb0b2 Mon Sep 17 00:00:00 2001 From: Pratik Bari Date: Mon, 15 Dec 2025 10:30:50 +0530 Subject: [PATCH 3/7] fix: Fix the Sysman Engine Test for the workload submission Modified the engine workload test to poll pre-utilization for 5 seconds. The test now continuously measures utilization at 500ms intervals over a 5-second period and only skips the workload test if the final pre-utilization value exceeds 5%. Related-To: NEO-16864 Signed-off-by: Pratik Bari --- .../src/test_sysman_engine.cpp | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp index 73ec4668..3565159b 100644 --- a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp +++ b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp @@ -11,6 +11,7 @@ #include "logging/logging.hpp" #include "utils/utils.hpp" #include "test_harness/test_harness.hpp" +#include namespace lzt = level_zero_tests; #include @@ -309,15 +310,21 @@ LZT_TEST_F( ASSERT_NE(nullptr, engine_handle); auto properties = lzt::get_engine_properties(engine_handle); if (properties.type == ZES_ENGINE_GROUP_COMPUTE_ALL) { - // Get pre-workload utilization + // Poll pre-workload utilization for 5 seconds + auto start_time = std::chrono::steady_clock::now(); auto s1 = lzt::get_engine_activity(engine_handle); - auto s2 = lzt::get_engine_activity(engine_handle); double pre_utilization = 0.0; - if (s2.timestamp > s1.timestamp) { - pre_utilization = (static_cast(s2.activeTime) - - static_cast(s1.activeTime)) / - (static_cast(s2.timestamp) - - static_cast(s1.timestamp)); + + while (std::chrono::steady_clock::now() - start_time < std::chrono::seconds(5)) { + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + auto s2 = lzt::get_engine_activity(engine_handle); + if (s2.timestamp > s1.timestamp) { + pre_utilization = (static_cast(s2.activeTime) - + static_cast(s1.activeTime)) / + (static_cast(s2.timestamp) - + static_cast(s1.timestamp)); + } + s1 = s2; } if (pre_utilization > 0.05) { @@ -341,7 +348,7 @@ LZT_TEST_F( s1 = lzt::get_engine_activity(engine_handle); std::thread thread(workload_for_device, device); thread.join(); - s2 = lzt::get_engine_activity(engine_handle); + auto s2 = lzt::get_engine_activity(engine_handle); #endif // USE_ZESINIT EXPECT_NE(s2.timestamp, s1.timestamp); if (s2.timestamp > s1.timestamp) { From 17c69baa216ca8caf5e83318d93c1f7bbd912be4 Mon Sep 17 00:00:00 2001 From: Pratik Bari Date: Mon, 15 Dec 2025 10:40:49 +0530 Subject: [PATCH 4/7] fix: Fix the Sysman Engine Test for the workload submission Modified the engine workload test to poll pre-utilization for 5 seconds. The test now continuously measures utilization at 500ms intervals over a 5-second period and only skips the workload test if the final pre-utilization value exceeds 5%. Related-To: NEO-16864 Signed-off-by: Pratik Bari --- .../sysman/test_sysman_engine/src/test_sysman_engine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp index 3565159b..6b89c527 100644 --- a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp +++ b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp @@ -315,7 +315,8 @@ LZT_TEST_F( auto s1 = lzt::get_engine_activity(engine_handle); double pre_utilization = 0.0; - while (std::chrono::steady_clock::now() - start_time < std::chrono::seconds(5)) { + while (std::chrono::steady_clock::now() - start_time < + std::chrono::seconds(5)) { std::this_thread::sleep_for(std::chrono::milliseconds(500)); auto s2 = lzt::get_engine_activity(engine_handle); if (s2.timestamp > s1.timestamp) { @@ -343,7 +344,7 @@ LZT_TEST_F( s1 = lzt::get_engine_activity(engine_handle); std::thread thread(workload_for_device, core_device); thread.join(); - s2 = lzt::get_engine_activity(engine_handle); + auto s2 = lzt::get_engine_activity(engine_handle); #else // USE_ZESINIT s1 = lzt::get_engine_activity(engine_handle); std::thread thread(workload_for_device, device); From d31920f20cf08769af735be4317921f081f5c2b2 Mon Sep 17 00:00:00 2001 From: Pratik Bari Date: Mon, 15 Dec 2025 11:06:02 +0530 Subject: [PATCH 5/7] fix: Fix the Sysman Engine Test for the workload submission Modified the engine workload test to poll pre-utilization for 5 seconds. The test now continuously measures utilization at 500ms intervals over a 5-second period and only skips the workload test if the final pre-utilization value exceeds 5%. Related-To: NEO-16864 Signed-off-by: Pratik Bari --- .../sysman/test_sysman_engine/src/test_sysman_engine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp index 6b89c527..2d15d4e2 100644 --- a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp +++ b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp @@ -304,6 +304,7 @@ LZT_TEST_F( count = lzt::get_engine_handle_count(device); if (count > 0) { is_engine_supported = true; + constexpr double pre_utilization_threshold = 0.05; LOG_INFO << "Engine handles are available on this device! "; auto engine_handles = lzt::get_engine_handles(device, count); for (auto engine_handle : engine_handles) { @@ -328,7 +329,7 @@ LZT_TEST_F( s1 = s2; } - if (pre_utilization > 0.05) { + if (pre_utilization > pre_utilization_threshold) { LOG_INFO << "Pre-utilization is already high: " << pre_utilization * 100 << "%, skipping workload test."; continue; From 111c837132b4f03c1115df93046da1942e5f7ddb Mon Sep 17 00:00:00 2001 From: Pratik Bari Date: Mon, 15 Dec 2025 13:44:57 +0530 Subject: [PATCH 6/7] fix: Fix the Sysman Engine Test for the workload submission Modified the engine workload test to poll pre-utilization for 5 seconds. The test now continuously measures utilization at 500ms intervals over a 5-second period and only skips the workload test if the final pre-utilization value exceeds 5%. Related-To: NEO-16864 Signed-off-by: Pratik Bari --- .../sysman/test_sysman_engine/src/test_sysman_engine.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp index 2d15d4e2..2a3cbd2d 100644 --- a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp +++ b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp @@ -325,10 +325,17 @@ LZT_TEST_F( static_cast(s1.activeTime)) / (static_cast(s2.timestamp) - static_cast(s1.timestamp)); + + // If utilization falls below threshold, break and proceed with + // test + if (pre_utilization < pre_utilization_threshold) { + break; + } } s1 = s2; } + // Skip only if utilization remained high throughout the entire period if (pre_utilization > pre_utilization_threshold) { LOG_INFO << "Pre-utilization is already high: " << pre_utilization * 100 << "%, skipping workload test."; From 4c8ff881d8f0f371da7b43f8e67a70265c69fe38 Mon Sep 17 00:00:00 2001 From: Pratik Bari Date: Thu, 18 Dec 2025 13:26:55 +0530 Subject: [PATCH 7/7] fix: Fix the Sysman Engine Test for the workload submission Modified the engine workload test to poll pre-utilization for 5 seconds. The test now continuously measures utilization at 500ms intervals over a 5-second period and only skips the workload test if the final pre-utilization value exceeds 5%. Related-To: NEO-16864 Signed-off-by: Pratik Bari --- .../sysman/test_sysman_engine/src/test_sysman_engine.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp index 2a3cbd2d..a5984b68 100644 --- a/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp +++ b/conformance_tests/sysman/test_sysman_engine/src/test_sysman_engine.cpp @@ -299,6 +299,7 @@ static void workload_for_device(ze_device_handle_t device) { LZT_TEST_F( ENGINE_TEST, GivenValidEngineHandleWhenGpuWorkloadIsSubmittedThenEngineActivityMeasuredIsHigher) { + bool is_engine_workload_executed = false; for (auto device : devices) { uint32_t count = 0; count = lzt::get_engine_handle_count(device); @@ -352,13 +353,13 @@ LZT_TEST_F( s1 = lzt::get_engine_activity(engine_handle); std::thread thread(workload_for_device, core_device); thread.join(); - auto s2 = lzt::get_engine_activity(engine_handle); #else // USE_ZESINIT s1 = lzt::get_engine_activity(engine_handle); std::thread thread(workload_for_device, device); thread.join(); - auto s2 = lzt::get_engine_activity(engine_handle); #endif // USE_ZESINIT + is_engine_workload_executed = true; + auto s2 = lzt::get_engine_activity(engine_handle); EXPECT_NE(s2.timestamp, s1.timestamp); if (s2.timestamp > s1.timestamp) { double post_utilization = (static_cast(s2.activeTime) - @@ -377,6 +378,10 @@ LZT_TEST_F( LOG_INFO << "No engine handles found for this device! "; } } + if (!is_engine_workload_executed) { + GTEST_SKIP() << "All engines had high pre-utilization. No workload test " + "was executed."; + } if (!is_engine_supported) { FAIL() << "No engine handles found on any of the devices! "; }