Skip to content

Commit

Permalink
feature: events deadlock detection in validation layer
Browse files Browse the repository at this point in the history
Related-To: NEO-12810

Signed-off-by: Chandio, Bibrak Qamar <[email protected]>
  • Loading branch information
bibrak committed Nov 12, 2024
1 parent abde7db commit c7ea2dc
Show file tree
Hide file tree
Showing 4 changed files with 739 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/layers/validation/checkers/events_checker/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
target_sources(${TARGET_NAME}
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/zel_events_checker.h
${CMAKE_CURRENT_LIST_DIR}/zel_events_checker.cpp

${CMAKE_SOURCE_DIR}/third_party/xla/graphcycles.cc
)

target_include_directories(${TARGET_NAME}
PRIVATE
${CMAKE_SOURCE_DIR}/third_party
)
44 changes: 44 additions & 0 deletions source/layers/validation/checkers/events_checker/DESIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Events Deadlock Checker Design Document
This document outlines the design and implementation details of the events checker.

## Introduction
The Events Checker validates usage of events.
- 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.
- 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.

## Objectives
- Detect potential deadlocks caused by event usage.
- Provide detailed information to help developers identify and resolve deadlock issues.

## Design Overview
The checker creates an internal Directed Acyclic Graph (DAG) of dependencies between API calls (the actions that are nodes in the graph) and events (the edges in the graph). It also maintains a topological sort and when an attempt is made to insert an edge that causes a cycle in the graph it warns the user of a potential deadlock and returns without inserting that edge.

## API Implemented
### zeEventCreate
### zeEventDestroy
### zeCommandListAppendMemoryCopy
### zeCommandListAppendWriteGlobalTimestamp
### zeCommandListAppendBarrier
### zeCommandListAppendMemoryRangesBarrier
### zeCommandListAppendMemoryFill
### zeCommandListAppendMemoryCopyRegion
### zeCommandListAppendMemoryCopyFromContext
### zeCommandListAppendImageCopy
### zeCommandListAppendImageCopyRegion
### zeCommandListAppendImageCopyToMemory
### zeCommandListAppendImageCopyFromMemory
### zeCommandListAppendSignalEvent
### zeCommandListAppendWaitOnEvents
### zeEventHostSignal
### zeCommandListAppendEventReset
### zeEventHostReset
### zeCommandListAppendQueryKernelTimestamp
### zeCommandListAppendLaunchKernel
### zeCommandListAppendLaunchCooperativeKernel
### zeCommandListAppendLaunchKernelIndirect
### zeCommandListAppendLaunchMultipleKernelsIndirect
### zeCommandListUpdateMutableCommandSignalEventExp
### zeCommandListUpdateMutableCommandWaitEventsExp
### zeCommandListAppendImageCopyToMemoryExt
### zeCommandListAppendImageCopyFromMemoryExt
### zeCommandListImmediateAppendCommandListsExp
Loading

0 comments on commit c7ea2dc

Please sign in to comment.