Skip to content

Commit abde7db

Browse files
committed
feature: events deadlock detection in validation layer
Related-To: NEO-12810 Signed-off-by: Chandio, Bibrak Qamar <[email protected]>
1 parent 3091196 commit abde7db

File tree

8 files changed

+13
-744
lines changed

8 files changed

+13
-744
lines changed

source/layers/validation/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ By default, no validation modes will be enabled. The individual validation modes
1818

1919
- `ZE_ENABLE_PARAMETER_VALIDATION`
2020
- `ZE_ENABLE_HANDLE_LIFETIME`
21-
- `ZEL_ENABLE_EVENTSDEADLOCK_CHECKER`
21+
- `ZEL_ENABLE_EVENTS_CHECKER`
2222
- `ZE_ENABLE_MEMORY_TRACKER` (Not yet Implemeneted)
2323
- `ZE_ENABLE_THREADING_VALIDATION` (Not yet Implemeneted)
2424

@@ -49,9 +49,11 @@ This mode maintains an internal mapping of each handle type to a state structure
4949
- Additional per handle state checks added as needed
5050
- Example - Check ze_cmdlist_handle_t open or closed
5151

52-
### `ZEL_ENABLE_EVENTSDEADLOCK_CHECKER`
52+
### `ZEL_ENABLE_EVENTS_CHECKER`
5353

54-
The Events Deadlock Checker is designed to detect potential deadlocks that might occur due to improper event usage in the Level Zero API. It prints out wairning messages for user when it detects a potential deadlock.
54+
The Events Checker validates usage of events.
55+
- It is designed to detect potential deadlocks that might occur due to improper event usage in the Level Zero API. It prints out warning messages for user when it detects a potential deadlock.
56+
- In some cases it may also detect whether an event is being used more than once without being reset. Consider a case in which a single event is signaled from twice.
5557

5658
### `ZE_ENABLE_THREADING_VALIDATION` (Not yet Implemeneted)
5759

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
add_subdirectory(events_deadlock)
1+
add_subdirectory(events_checker)
22
add_subdirectory(parameter_validation)
33
add_subdirectory(template)

source/layers/validation/checkers/events_deadlock/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

source/layers/validation/checkers/events_deadlock/DESIGN.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

source/layers/validation/checkers/events_deadlock/zel_events_deadlock_checker.cpp

Lines changed: 0 additions & 587 deletions
This file was deleted.

source/layers/validation/checkers/events_deadlock/zel_events_deadlock_checker.h

Lines changed: 0 additions & 94 deletions
This file was deleted.

test/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ set_property(TEST tests_both_gpu PROPERTY ENVIRONMENT "ZE_ENABLE_NULL_DRIVER=1")
4040
add_test(NAME tests_both_npu COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingzeInitThenZeInitDriversThenBothCallsSucceedWithNPUTypes*)
4141
set_property(TEST tests_both_npu PROPERTY ENVIRONMENT "ZE_ENABLE_NULL_DRIVER=1")
4242
add_test(NAME tests_event_deadlock COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingzeCommandListAppendMemoryCopyWithCircularDependencyOnEventsThenValidationLayerPrintsWarningOfDeadlock*)
43-
set_property(TEST tests_event_deadlock PROPERTY ENVIRONMENT "ZE_ENABLE_NULL_DRIVER=1;ZE_ENABLE_VALIDATION_LAYER=1;ZEL_ENABLE_EVENTSDEADLOCK_CHECKER=1")
43+
set_property(TEST tests_event_deadlock PROPERTY ENVIRONMENT "ZE_ENABLE_NULL_DRIVER=1;ZE_ENABLE_VALIDATION_LAYER=1;ZEL_ENABLE_EVENTS_CHECKER=1")
4444
add_test(NAME tests_event_deadlock_reset COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingzeCommandListAppendMemoryCopyWithCircularDependencyOnEventsAndExplicitCallzeEventHostSignalThenValidationLayerPrintsWarningOfIllegalUsage*)
45-
set_property(TEST tests_event_deadlock_reset PROPERTY ENVIRONMENT "ZE_ENABLE_NULL_DRIVER=1;ZE_ENABLE_VALIDATION_LAYER=1;ZEL_ENABLE_EVENTSDEADLOCK_CHECKER=1")
45+
set_property(TEST tests_event_deadlock_reset PROPERTY ENVIRONMENT "ZE_ENABLE_NULL_DRIVER=1;ZE_ENABLE_VALIDATION_LAYER=1;ZEL_ENABLE_EVENTS_CHECKER=1")
4646
add_test(NAME tests_event_reset_reuse COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingzeEventHostResetWithAlreadySignaledEventThenUsingEventAgainThenValidationLayerDoesNotPrintsWarningOfIllegalUsage*)
47-
set_property(TEST tests_event_reset_reuse PROPERTY ENVIRONMENT "ZE_ENABLE_NULL_DRIVER=1;ZE_ENABLE_VALIDATION_LAYER=1;ZEL_ENABLE_EVENTSDEADLOCK_CHECKER=1")
47+
set_property(TEST tests_event_reset_reuse PROPERTY ENVIRONMENT "ZE_ENABLE_NULL_DRIVER=1;ZE_ENABLE_VALIDATION_LAYER=1;ZEL_ENABLE_EVENTS_CHECKER=1")

third_party/xla/graphcycles.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ int32_t GraphCycles::NewNode() {
142142
if (rep_->free_nodes_.empty()) {
143143
Node n;
144144
n.visited = false;
145-
n.rank = rep_->nodes_.size();
145+
n.rank = static_cast<int32_t>(rep_->nodes_.size());
146146
rep_->nodes_.emplace_back(n);
147147
rep_->node_io_.emplace_back();
148148
rep_->node_data_.push_back(nullptr);
@@ -522,8 +522,9 @@ std::vector<int32_t> GraphCycles::AllNodesInPostOrder() const {
522522
all_nodes.reserve(rep_->nodes_.size() - free_nodes_set.size());
523523

524524
for (int64_t i = 0, e = rep_->nodes_.size(); i < e; i++) {
525-
if (!contains(free_nodes_set, i)) {
526-
all_nodes.push_back(i);
525+
int32_t index = static_cast<int32_t>(i);
526+
if (!contains(free_nodes_set, index)) {
527+
all_nodes.push_back(index);
527528
}
528529
}
529530

0 commit comments

Comments
 (0)