DAG Node Sorting With Global Depth for AI Memory Efficiency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional sorting algorithms for Directed Acyclic Graphs (DAGs) in AI network models fail to account for interdependence across the entire computation graph, leading to inefficient data retention and increased resource overhead due to large 'edge' spans between adjacent nodes, which can decrease operation efficiency.
Innovation Solution
A sorting method that determines a global depth of each node in the DAG based on input-output relationships, generates a global depth table, and uses this table to establish a node sorting order, with optional updates based on heuristic sorting sets to ensure consistent execution order and reduce data dependency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If conventional sorting algorithms (DFS/BFS) are used that only consider local edge dependencies, then the sorting process is simple, but the edge span between adjacent nodes becomes large and data correlation decreases
Solution Approach 1:
The patent changes the sorting parameter from local edge dependency consideration to global depth consideration. By calculating the global depth of each node (distance from root to the node) and using it as the sorting criterion, the method achieves better data correlation and reduces edge spans between adjacent nodes in the sorted sequence, thereby improving operation efficiency without significantly complicating the sorting process.
2Device complexity
If conventional sorting algorithms are used, then the algorithm complexity is low, but hardware memory usage increases due to data retention requirements
Solution Approach 1:
The patent introduces global depth as a new sorting parameter that enables better data locality. By sorting nodes according to their global depth values, the method ensures that nodes with similar depth levels are processed together, reducing the need to retain data in hardware memory across different depth levels, thus decreasing overall memory usage while maintaining relatively simple algorithm complexity.
3Loss of time
If sorting is performed without considering global depth, then the sorting process is fast, but memory transfers increase and operation efficiency decreases
Solution Approach 1:
The patent performs preliminary calculation of global depth for each node before the actual sorting operation. By pre-computing these depth values and storing them, the sorting process itself remains efficient while the resulting sorted order optimizes data locality and reduces memory transfers during network operations, thereby improving overall operation efficiency without significant time penalty.
Data Source
AI summary
A sorting method, a storage medium and an electronic device. The sorting method includes acquiring a directed acyclic graph to be sorted, and recording input nodes and output nodes of each node in the directed acyclic graph; obtaining a global depth of each node based on input-output relationships among nodes in the directed acyclic graph, thereby generating a global depth table, wherein the global depth of each node is defined as a number of nodes involved from said node in the directed acyclic graph along directed edges to a corresponding output of said node; and determining an execution order of each node based on the global depth of each node and a total number of the nodes in the directed acyclic graph, and generating a node sorting table. The sorting method can improve computational efficiency.


