SYSTEMS AND METHODS FOR DEADLOCK MITIGATION
A method includes generating configuration data for a computing apparatus having a plurality of processing units with associated memory. The configuration data defines (i) a plurality of nodes corresponding to the processing units, and (ii) a plurality of buffers connecting respective pairs of the nodes, each buffer having a storage capacity. The method further includes executing a dataflow simulation using the configuration data, and in response to detecting a deadlock in the simulation, determining a candidate buffer associated with the deadlock. The method includes updating the configuration data to increase a storage capacity of the candidate buffer, and deploying the updated configuration data to the computing apparatus.
1 . A method, comprising:
generating configuration data for a computing apparatus having a plurality of processing units with associated memory, the configuration data defining (i) a plurality of nodes corresponding to the processing units, and (ii) a plurality of buffers connecting respective pairs of the nodes, each buffer having a storage capacity;
executing a dataflow simulation using the configuration data;
in response to detecting a deadlock in the simulation, determining a candidate buffer among the buffers, the candidate buffer associated with the deadlock;
updating the configuration data to increase a storage capacity of the candidate buffer; and
deploying the updated configuration data to the computing apparatus.
2 . The method of claim 1 , wherein deploying the updated configuration data to the computing apparatus includes allocating portions of the memory according to the buffers defined in the updated configuration data.
3 . The method of claim 1 , wherein the configuration data includes a cyclo-static dataflow graph including a plurality of actor nodes corresponding to respective processing units, and a plurality of edges corresponding to respective buffers.
4 . The method of claim 1 , wherein the configuration data includes:
for each buffer, (i) a first endpoint node identifier and (ii) a second endpoint node identifier; and
for each node, a set of phase data corresponding to each buffer for which the node is an endpoint.
5 . The method of claim 4 , wherein executing the simulation includes:
determining whether any nodes can be activated; and
when the determination is affirmative, activating the identified nodes and updating contents associated with the buffers.
6 . The method of claim 5 , wherein detecting the deadlock includes:
determining that no nodes can be activated, and that the simulation is incomplete.
7 . The method of claim 1 , wherein determining the candidate buffer includes:
selecting a subset of the buffers;
selecting a portion of the configuration data corresponding to blocked nodes and the buffers blocking the blocked nodes; and
traversing the portion of the configuration data, beginning at one of the subset of buffers, to detect a circular dependency.
8 . The method of claim 7 , wherein selecting a given buffer for the subset of buffers is based on selection criteria including:
(i) the given buffer is at capacity;
(ii) the given buffer is blocking an upstream one of the nodes from outputting data;
(iii) the given buffer is connected as an input to a downstream one of the nodes with multiple inputs; and
(iv) the downstream node is not blocked by a further downstream buffer.
9 . A computing device, comprising:
an interface connected with a computing apparatus having a plurality of processing units with associated memory; and
a processor configured to:
generate configuration data for the computing apparatus, the configuration data defining (i) a plurality of nodes corresponding to the processing units, and (ii) a plurality of buffers connecting respective pairs of the nodes, each buffer having a storage capacity;
execute a dataflow simulation using the configuration data;
in response to detecting a deadlock in the simulation, determine a candidate buffer among the buffers, the candidate buffer associated with the deadlock;
update the configuration data to increase a storage capacity of the candidate buffer; and
deploy the updated configuration data to the computing apparatus via the interface.
10 . The computing device of claim 9 , wherein the processor is configured to deploy the updated configuration data to the computing apparatus by allocating portions of the memory according to the buffers defined in the updated configuration data.
11 . The computing device of claim 9 , wherein the configuration data includes a cyclo-static dataflow graph including a plurality of actor nodes corresponding to respective processing units, and a plurality of edges corresponding to respective buffers.
12 . The computing device of claim 9 , wherein the configuration data includes:
for each buffer, (i) a first endpoint node identifier and (ii) a second endpoint node identifier; and
for each node, a set of phase data corresponding to each buffer for which the node is an endpoint.
13 . The computing device of claim 12 , wherein the processor is configured to execute the simulation by:
determining whether any nodes can be activated; and
when the determination is affirmative, activating the identified nodes and updating contents associated with the buffers.
14 . The computing device of claim 13 , wherein the processor is configured to detect the deadlock by:
determining that no nodes can be activated, and that the simulation is incomplete.
15 . The computing device of claim 9 , wherein the processor is configured to determine the candidate buffer by:
selecting a subset of the buffers;
selecting a portion of the configuration data corresponding to blocked nodes and the buffers blocking the blocked nodes; and
traversing the portion of the configuration data, beginning at one of the subset of buffers, to detect a circular dependency.
16 . The computing device of claim 15 , wherein the processor is configured to select a given buffer for the subset of buffers based on selection criteria including:
(i) the given buffer is at capacity;
(ii) the given buffer is blocking an upstream one of the nodes from outputting data;
(iii) the given buffer is connected as an input to a downstream one of the nodes with multiple inputs; and
(iv) the downstream node is not blocked by a further downstream buffer.