Deadlock-free scheduling of task graphs on multi-core processor
By representing the neural network as a task graph and using the priority sorting method to allocate the nodes and edges of the task graph, combined with buffer scheduling, the deadlock problem in the execution of asynchronous neural networks on multi-core processors is solved, and efficient utilization of resources is achieved. and reasonable buffer settings.
Patent Information
- Application Number
- CN202280084546.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2021-12-23
- Filing Date
- 2022-12-22
- Publication Date
- 2024-10-01
AI Technical Summary
On multi-core processors, the execution of asynchronous neural networks leads to irregular inter-core communication patterns and limited resource availability, leading to the risk of deadlock, and the setting of the buffer capacity is difficult to avoid the problem of being too small or too large at both ends.
By representing the neural network as a task graph, a prioritization method is used to allocate nodes and edges to processor cores and NoC links of multi-core processors, combined with input buffer size scheduling, to avoid deadlocks and optimize buffer usage.
It effectively avoids the risk of deadlock, optimizes the buffer size, and improves the execution efficiency and resource utilization of neural networks on multi-core processors.
Smart Images

Figure CN118742890A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a method for mapping a task graph representing a neural network on a multi-core processor.
[0002] The present application also relates to a method of executing a neural network represented by a mapped task graph on a multi-core processor.
[0003] The present application also relates to a multi-core processor configured to execute a neural network represented by a task graph mapped thereon. Background Art
[0004] The neural network processor executes an artificial neural network defined by a set of interdependent neurons. Neurons may be able to receive event messages from corresponding subsets of one or more source neurons. Neurons may also be able to send event messages to corresponding subsets of one or more destination neurons. In some examples, represented as stateful, neurons maintain neural states, which update the neural states in response to received input messages and send event messages based on their neural states. In other examples, represented as stateless, neurons do not maintain internal states. For example, it can randomly generate output messages or directly respond to input messages. The sending of event messages through neurons is somewhat similar to the firing or pulsing of biological neurons. Neurons can include themselves in their own subsets of one or more source neurons. In this case, the neuron is also included in its own subset of one or more destination neurons. In principle, the behavior of neurons is asynchronous. Their operation is not necessarily controlled by a central clock, but by incoming event messages.
[0005] While in theory each neuron can be implemented as a separate data processing element, in practice the neural network processor is provided as a set of processing cores that are interconnected via an on-chip message switching network (NoC) comprising NoC routers interconnected via NoC links. Wherein the corresponding neuron has a corresponding storage location. However, resources such as computation and control logic and the message switching network capacity for exchanging messages are shared by multiple neurons.
[0006] The asynchronous behavior of neurons of a neural network on a multi-core processor results in irregular execution and inter-core communication patterns. Due to the limited availability of resources, it is necessary to provide a message buffer in which event messages for destination neurons can be buffered. The message buffer may include: an output buffer for buffering event messages waiting to be sent to the destination core; and an input buffer for buffering event messages waiting to be executed by the destination core. On the one hand, the buffer capacity should not be too small to avoid the risk of deadlock. On the other hand, too large a buffer capacity should be avoided to avoid excessive buffer costs. Summary of the invention
[0007] In view of the above, an object of the present invention is to provide an improved method for mapping asynchronous neural networks on a multi-core processor, wherein an appropriate amount of storage space is used to avoid deadlock.
[0008] In the improved method described below, it is assumed that a neural network executed by a multi-core processor is represented as a task graph, which includes nodes and edges connecting the nodes. The nodes represent corresponding computing tasks to be performed in the process of executing the neural network. Each edge pointing from a source node to a destination node represents the dependency of the computing task represented by the destination node on the event message from the computing task represented by the source node. The computing task represented by the node can be a single operation, such as executing an instruction in an instruction set, but it can also alternatively execute a series of such operations or execute a complete program module. For clarity, it is initially assumed that the task graph is non-cyclic. However, as further disclosed in this document, the method can be easily extended to cyclic graphs.
[0009] The improved method maps a task graph onto a multi-core processor, the multi-core processor including a plurality of processor cores configured to exchange messages in an on-chip message exchange network (NoC), the on-chip message exchange network including NoC routers interconnected by NoC links. In one example of a multi-core processor, each processor core (except those at the edge of the multi-core processor) is connected to an appropriate router, the router being connected to an adjacent router in a first direction and at mutually opposite sides by a first pair of NoC links, and being connected to an adjacent router in a second direction transverse to the first direction and at mutually opposite sides by a second pair of NoC links. This architecture is well suited for general applications. However, various other message exchange network architectures are possible, and the architecture can be specifically designed for executing a specific class of neural networks. For example, a multi-core processor having a NoC providing unidirectional links along one or two axes is particularly suitable for implementing a feedforward hierarchical neural network. In another example, a multi-core processor is organized in three dimensions, with processor cores and their associated routers arranged in a three-dimensional grid. In the exemplary embodiment, each router is connected to an adjacent router at mutually opposite sides in a first direction through a first pair of NoC links, is connected to an adjacent router at mutually opposite sides in a second direction transverse to the first direction through a second pair of NoC links, and is connected to an adjacent router at mutually opposite sides in a third direction transverse to the first direction and the second direction through a third pair of NoC links.
[0010] Regardless of the architecture used by the NoC, the improved method is configured to implement the above method by prioritizing the nodes and edges of the task graph and assigning the prioritized nodes and edges to the processor cores of the multi-core processor and the NoC links, respectively. Therefore, the priority assigned to each node is the highest one of the priorities of the incoming edges assigned to each node, and the priority assigned to each edge exceeds the priority of the node derived from each edge. For the proposed priority setting, there is always a core or router that can make progress, that is, a core or router with the highest overall "system-wide" priority. Priority is indicated, for example, by ranking, where a smaller priority value indicates a higher priority and vice versa. The ranking can be indicated by any type of number, but integers are preferred for more efficient comparison. To indicate the difference in priority, simply assign different priority values. For example, as long as the order of the priority values is consistent, priority values 1, 2, 3, 4, 5 or 3, 30, 32, 48, 70 can be assigned to five tasks with increasing priorities.
[0011] As mentioned above, the above method can also be extended to apply to cyclic task graphs.
[0012] Edges that start and end at the same node are examples of cycles, in particular examples of autocycles in task graphs. Task graphs can also include longer cycles, i.e. cycles where the number N of nodes and edges involved is greater than 1. Cyclic task graphs are necessary to specify recurrent neural networks.
[0013] In an embodiment of the method, a pre-processing step is applied to convert the cyclic task graph into an acyclic task graph, which can then be mapped using the improved method as described above.
[0014] It is important to note in this regard that a back edge is an edge that, when removed from a task graph, would reduce the number of cycles. The set of back edges is complete when removing the back edges results in a connected but acyclic graph. In general, the complete set of back edges is not unique, e.g., a task graph with a first node having a first incoming edge from a second node having a second incoming edge from the first node can be converted to an acyclic task graph by removing the first incoming edge or by removing the second incoming edge. One option may be more attractive than the other.
[0015] It is important to note that event message generation and event message consumption on the back edge must eventually be periodic. That is, after a finite sequence of generation bursts and consumption bursts, a strict periodic generation-consumption pattern must be established. Therefore, a finite number of edge states need to be considered. Typically, there are only a few such edge states.
[0016] Assume that the sizes of the production and consumption bursts are controlled by the protocol. For example, each consumption burst matches the previous production burst. The production-consumption protocol is bounded when the consumption gap in each edge state is bounded by a number (e.g., B). Therefore, for a given bounded production-consumption protocol, each subsequent edge has a bound limit B.
[0017] Based on the above observations, an improved method for mapping a cyclic task graph that specifies a neural network for execution by a multi-core processor is as follows. Similar to the case specified above, the cyclic task graph includes a plurality of nodes interconnected by directed edges. Each node represents a computational task to be performed in the process of executing the neural network, and each edge pointing from a source node to a destination node represents a dependency of the computational task represented by the destination node on an event message from the computational task represented by the source node. However, in addition to the method specified for the non-cyclic case, the method also includes a preliminary step of specifying a complete set of back edges for the cyclic task graph.
[0018] When parts of consecutive neural network layers of a neural network are mapped onto the same kernel, local buffers are needed to store intermediate results. The size of the buffer must be sufficient to accommodate the maximum possible number of messages from a first neural network layer for consumption by a subsequent second neural network layer mapped onto the same kernel. In the case of pipelined execution, one may consider accommodating multiple firings so that the pipeline can flush its results in the buffer. (Otherwise, some partially completed calculations must be flushed and recalculated later.) In the non-cyclic case, one may consider limiting the number of firings in order to limit the buffer size requirements. In the cyclic case, the situation is different, because mutually consecutive neural network layers can be part of a cycle, where not only the operations of the second neural network layer depend on messages from the first neural network layer, but also the operations of the first neural network layer depend directly or indirectly on messages from the second neural network layer.
[0019] In this regard, it is further observed that for cyclic graphs, it is not possible to assign edge and node priorities in the same manner as for acyclic graphs. In particular, this applies to the requirement for acyclic graphs that the priority assigned to each edge exceeds the priority of the node from which each edge is derived. This problem is solved by introducing priority reduction in the priority of the node that generates the message of the subsequent edge.
[0020] As mentioned above, it is assumed that for each back edge, the produce-consume behavior is ultimately periodic and there exists a bounded produce-consume protocol with a corresponding back edge limit B. The method comprises a scheduler that combines the assignment of priorities of tasks with the calculation of input buffer sizes.
[0021] As a further preliminary step, an implicit acyclic task graph is constructed from the cyclic task graph by removing the complete set of back edges from the cyclic task graph.
[0022] Subsequently, using the method of the acyclic task graph already described above, priorities are assigned to the edges and nodes of the constructed implicit acyclic task graph.
[0023] As an additional step, a capacity is allocated for each input buffer, which exceeds the sum of the back-end limits of all back edges mapped to the input buffer. In practical applications, it is the case that the generation and consumption of messages at the node before the back edge exhibit periodic behavior together. In the simplest case, the number of messages generated in each cycle is constant, that is, N messages are generated and N messages are consumed per cycle, where N is a fixed number. In other cases, the number of tokens may be different for each cycle, but has an upper limit N. More complex periodic behaviors can be envisioned, in which the buffer content after each cycle can vary. The key point is that for a given periodic generation-consumption pattern (which may involve multiple generation and multiple consumption), an upper limit N of the difference between generation and consumption at any point in time can be given. The upper limit then specifies the buffer length. When such a buffer is introduced for each back edge, deadlock is avoided.
[0024] The present invention relates to a method for mapping a task graph representing a neural network for execution by a multi-core processor.
[0025] More specifically, the method assigns each task in the task graph to a processor core of a multi-core processor, and assigns each task dependency to a (non-cyclic) NoC path of a NoC link. Thus, each NoC link is assigned a finite number of priority numbers. If the number of assigned priority numbers does not exceed the number of priority numbers supported by each link and each core, the mapping is considered valid.
[0026] Note that two dependent (connected) tasks can be mapped to the same kernel. The edge connecting these two tasks is considered to be a local edge of the kernel.
[0027] An embodiment of the method further comprises executing an artificial neural network specified by an acyclic task graph mapped onto a multi-core processor. The execution comprises:
[0028] A processor core of the multi-core processor executes a first task assigned to the processor core;
[0029] The processor core receives an input message from the second task;
[0030] The processor core compares the priority of the second task with the priority of the first task;
[0031] After determining that the priority of the second task exceeds the priority of the first task, the processor core:
[0032] Suspend the execution of the first task;
[0033] performing a second task; and
[0034] After completing the second task, execution of the first task is resumed.
[0035] An improved multi-core processor as disclosed herein comprises a plurality of processor cores configured to exchange messages in an on-chip message exchange network comprising NoC routers interconnected by NoC links. The multi-core processor is configured to execute a neural network specified as a task graph comprising a plurality of nodes interconnected by directed edges. Each node represents a computational task to be performed during the execution of the neural network, and each edge pointing from a source node to a destination node represents a dependency of the computational task represented by the destination node on an event message from the computational task represented by the source node. Each task of the task graph is assigned to a processor core of the multi-core processor, and each task dependency is mapped to a (non-cyclic) NoC path of the NoC link. A processor core of the multi-core processor (comprising an input buffer for receiving input messages, and the processor core is configured to:
[0036] executing a first task assigned to the processor core;
[0037] receiving an input message of a second task;
[0038] comparing the priority of the second task to the priority of the first task;
[0039] The processor core is further configured to, upon determining that the priority of the second task exceeds the priority of the first task:
[0040] Suspend the execution of the first task;
[0041] performing a second task; and
[0042] After completing the second task, execution of the first task is resumed. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] These and other aspects are disclosed in more detail with reference to the accompanying drawings, in which:
[0044] Figure 1A schematically illustrates an exemplary acyclic task graph of a neural network;
[0045] Figure 1B A multi-core processor is schematically shown;
[0046] Figure 2 A method for mapping acyclic task graphs onto multi-core processors is shown;
[0047] Figure 3 Shown in more detail Figure 2 the steps of the method;
[0048] FIG. 4A to FIG. 4G Shows the Figure 2, Figure 3 The method is applied to Figure 1A The subsequent operation phase of the exemplary acyclic task graph of;
[0049] Figure 5 A method for mapping a cyclic task graph onto a multi-core processor is shown;
[0050] Figure 6 A method for executing a neural network represented by a mapped task graph on a multi-core processor is presented. DETAILED DESCRIPTION
[0051] Figure 1A An exemplary acyclic task graph of a neural network is schematically shown, the neural network comprising a set of nodes N1, N2, N3 and N4 and edges E01, E02, E13, E23, E24, E34 and E40. The nodes represent respective computational tasks to be performed during the execution of the neural network. Each edge pointing from a source node to a destination node represents a dependency of the computational task represented by the destination node on an event message from the computational task represented by the source node. For illustration, Figure 1A A very simple task graph is shown in . In practice, a task graph can have a fairly large number of nodes and edges. In general, a task graph is defined by its set of nodes {N1, ..., Nn} and directed edges Eij, where:
[0052] If i>0 and j>0, then Eij is a directed edge from source node Ni to destination node Nj;
[0053] If j>0, then E0j is a directed edge from the input to the destination node Nj;
[0054] If i>0, then Ei0 is a directed edge from the source node Ni to the output.
[0055] Figure 1A The task graph of (in this example acyclic) will be mapped onto a multicore processor, for example onto Figure 1B On the multi-core processor 100 shown. Figure 1B In the example shown, a multi-core processor (100) has processor cores 1, 1a, ... 1o and a message exchange network (7). The message exchange network (7) includes a plurality of network interfaces (71) connected via a network link (72). In the example, each processor core (1) is associated with an appropriate network interface (71), and the network interfaces (71) are connected via a network link (72).
[0056] The message exchange network 7 enables the neural network devices 1, 1a, ..., 1o to exchange messages. An example of such a message is an event message indicating that a neural network element of a neural network device has "fired". The message serves as input to one or more addressed neural network elements of a receiving neural network device in the network. Event messages directed to neural network elements of the same neural network device can be processed by the neural network device, thereby bypassing the message exchange network 7. Alternatively, processing these messages can involve the message exchange network 7, for example using facilities provided by the message exchange network 7, such as buffering and controllable delays. Other message exchange network architectures are also contemplated, including corresponding clusters of neural network devices. Message exchange network architectures are also conceivable, in which the neural network devices are clustered in layers, in which each neural network device except the last neural network device can send messages to the neural network devices in the next layer in sequence.
[0057] In a multicore processor, each core can execute the tasks of the task graph sequentially and can submit output messages to tasks running on the same core or other cores. Each task of the task graph is assigned a priority number. When multiple tasks are ready to be executed by a core, the core selects the task with the highest priority, as shown in the reference Figure 6 Described in more detail.
[0058] Likewise, each event message is assigned a priority number. When multiple messages are ready to be forwarded, the NoC router selects the message with the highest priority. In addition, each link between two NoC routers can only carry event messages with a limited set of priority numbers. In other words, it has only a limited number of virtual channels. It should be noted that such virtual channels can be implemented in various ways. Examples are described in the conference paper "Virtual Channels in On-Chip Networks: Implementation and Evaluation on Hermes NoC" by Mello et al. (January 2005, DOI:10.1145 / 1081081.1081128, Source: DBLP).
[0059] Each NoC link has a bounded capacity for lossless messaging of each supported priority number. Therefore, if the available capacity is exhausted, so-called backpressure can limit the progress of individual NoC routers, and thus individual processor cores. Deadlock occurs when no router or core can proceed.
[0060] According to the present disclosure, acyclic networks are mapped to a multi-core processor (100) according to the following criteria.
[0061] A priority is assigned to each node of the task graph, and the prioritized nodes are assigned to processor cores of a multi-core processor.
[0062] Each edge is also assigned a priority, and the prioritized edges are assigned to (acyclic) paths of message switching network links.
[0063] Additionally, priorities are assigned according to the following rules:
[0064] a) the priority assigned to each node is the highest priority among the priorities assigned to the incoming edges to that node, and
[0065] b) The priority assigned to each edge exceeds the priority of the node from which each edge leads.
[0066] Figure 2 and Figure 3 An exemplary method for performing mapping based on these rules is shown in FIG. Figure 3 Two steps of the method are shown in more detail.
[0067] As shown therein, the exemplary method includes step S1, wherein a specification of an acyclic task graph representing a neural network is received, e.g. Figure 1A The task diagram shown in .
[0068] In step S2, a specification of a multi-core processor on which a neural network is to be mapped for execution is received, e.g. Figure 1B The multi-core processor (100) shown in FIG.
[0069] In step S3, an initial lowest priority value is assigned to each node and each edge, for example, a value of 0. For all i, Pni = 0, and for all ij, Peij = 0. Where Pni is the priority value of the node Ni, and Peij is the priority value of the edge Eij.
[0070] In step S4, the current subset of edges SBE is initialized to the edge set E0j. Figure 1A In the example of , the current subset SBE includes edges E01 and E02.
[0071] Then, the node prioritization step S5 is applied to the current subset of nodes and the edge prioritization step S6 is applied to the current subset of edges alternately.
[0072] In the first sub-step S51 of the node priority sorting step S5, the current subset SBN of the node Nj is initialized to an empty set, that is,
[0073] In a second sub-step S52, the destination nodes Nj of each edge Eij in the current subset of edges SBE are prioritized as follows.
[0074] Pnj=max(Pnj,Peij)
[0075] In this example, nodes N1 and N2 are assigned priority values Pn1=0 and Pn2=0.
[0076] It should be noted that a node can be visited multiple times because multiple edges can share a common destination node. If the visited node Nj is not yet a member node, it is added to the current subset SBN. After completing step S52, the nodes in the current subset SBN are Figure 4B Shown in hatched mode.
[0077] Since the subset of nodes SBN is not empty, the process continues with the edge prioritization step S6. The edge prioritization step S6 includes a first sub-step S61, in which the current set of edges SBE is initialized to an empty set. Then in a second sub-step S62, for each node Ni in the current set of nodes SBN, each of its outgoing edges Peij is prioritized as:
[0078] Peij=Pnj+1, the result is as follows Figure 4C shown.
[0079] It should be noted that the added priority weight does not have to be 1, but can have other values, such as 0.3 or 7, as long as the prioritization of the edges is performed consistently. Negative priority weights can also be added, where a lower priority value defines a higher priority for execution. The outgoing edges are each added to the current set of edges SBE. The outgoing edges in the prioritized set SBE in step S62 are Figure 4C Indicated by thick arrows.
[0080] The process continues again with sub-step S51, where the current set of nodes SBN is initialized to
[0081] In a second sub-step S52, the destination nodes N3 and N4 of each edge Eij in the current subset of edges SBE are prioritized as follows.
[0082] Pnj=max(Pnj,Peij)
[0083] Therefore, destination nodes N3 and N4 are both assigned a priority value of 1 and added to the current set of nodes SBN, as shown in FIG. Figure 4D shown.
[0084] Since the subset of nodes SBN is not empty, the process continues with the first sub-step S61 of step S6, in which the current set of edges SBE is initialized to an empty set. Then in sub-step S62, for each node Ni in the current set of nodes SBN, each of its outgoing edges Peij is prioritized as: Peij = Pnj + 1. In this example, this results in a priority assignment Pe34 = 2 and Pe40 = 2, as Figure 4E shown.
[0085] Execute step S5 again. Figure 4F As shown, due to the fact that the priority of the incoming edge Pe34 is higher than the current priority of the node N4, the node N4 is re-prioritized to a value of Pn4=2.
[0086] like Figure 4G As shown, step S6 may be performed again to re-prioritize edge E40 to a value of P40 = 3. However, this is not absolutely necessary unless edge E40 is an input to another task graph, where the priority of E40 needs to be compared with other priorities.
[0087] Due to the fact that the task graph is acyclic, if during the node prioritization step the current subset SBN of nodes remains empty, the prioritization process ends.
[0088] It is important to note that for a given task graph, the assigned priority levels are static. Furthermore, for any particular core (and router), only a limited subset of all priority levels need be considered for local implementation. In an exemplary embodiment of an improved neural network processor, 4 priority levels per core (per router) are sufficient, and the number of neural network layers is used as the priority level and is locally encoded by the numbers 0, 1, 2, 3.
[0089] Figure 5 An extended version of the method is shown, which makes it possible to provide mappings for cyclic graphs as well.
[0090] In step S1A, a specification of a recurrent task graph representing a neural network is received.
[0091] In step S1B, a complete set of back edges specified for the cyclic task graph is also received. The production-consumption behavior of each edge is ultimately cyclical, with a bounded production-consumption protocol and a corresponding back-bound limit B.
[0092] In step S1C, an implicit acyclic task graph is constructed by removing the complete set of back edges from the cyclic task graph. Subsequently, the process continues to execute steps S2 to S6, as shown in reference Figure 2 , Figure 3 and 4A to 4FHowever, after the process is completed in steps S2 to S6, a further step S7 is performed, in which a capacity is allocated for each input buffer, the capacity exceeding the sum of the trailing edge limits of all trailing edges mapped to the input buffer.
[0093] Figure 6 An embodiment of a method is schematically illustrated in which a neural network specified by an acyclic task graph mapped onto a multi-core processor is executed.
[0094] In step S10 , a processor core of the multi-core processor ( 100 ), for example, processor core ( 1 ) executes task A specified by a node in the task graph.
[0095] In step S11 , an input message of task B is received in an input buffer of the processor core.
[0096] In step S12, the priority value of the current task A is compared with the priority value of the task B that receives the input message.
[0097] Steps S11 and S12 may be performed when the processor core continues to execute task A.
[0098] If it is determined in step S13 that the priority value of task B receiving the input message is higher than the priority value of task A currently being executed, the process continues to step S14, where the execution of the current task A is suspended. Processor core resources (such as registers) can be freed by saving their contents in cache.
[0099] In step S14, the processor core executes the higher priority task B that receives the incoming message.
[0100] Once the higher priority task B is completed or needs to wait for further input messages, the processor core will continue to execute the task A it was executing in step S10.
[0101] If the priority value of task B receiving the input message does not exceed the priority value of the current task A in step S11 , the processor core continues to process task A.
[0102] While executing a higher priority task B, an input message might be received for a still higher ranked task C. In this case, task B is suspended in favor of task C, just as task A was suspended in favor of task B. Likewise, task C might be suspended in favor of a task with a still higher priority, and so on.
[0103] The method of mapping a cyclic task graph or acyclic task graph specifying a neural network for execution by a multi-core processor is a computer-implemented method. In one embodiment, the multi-core processor itself is configured to perform the mapping. In another embodiment, the mapping is performed by another data processor, such as a suitably programmed general-purpose processor.
Claims
1. A method for mapping an acyclic task graph, the acyclic task graph specifying a neural network for execution by a multi-core processor, the acyclic task graph comprising a plurality of nodes interconnected by directed edges, each node representing a computational task to be performed in the process of executing the neural network, each edge pointing from a source node to a destination node representing a dependency of the computational task represented by the destination node on an event message from the computational task represented by the source node, the multi-core processor comprising a plurality of processor cores, the plurality of processor cores being configured to exchange messages in an on-chip message switching network (NoC), the on-chip message switching network comprising NoC routers interconnected by NoC links, The method for mapping comprises: assigning (S52) a priority to each node of the task graph, and assigning the prioritized nodes to processor cores of the multi-core processor, and assigning ( S62 ) a priority to each edge and assigning the prioritized edges to (acyclic) NoC paths of the NoC links; where the priority assigned to each node is the highest priority among the priorities assigned to the incoming edges of each node, and The priority assigned to each edge exceeds the priority of the node from which each edge leads.
2. A method for mapping a cyclic task graph, the cyclic task graph specifying a neural network for execution by a multi-core processor, the cyclic task graph comprising a plurality of nodes interconnected by directed edges, each node representing a computational task to be performed in the process of executing the neural network, each edge pointing from a source node to a destination node representing a dependency of the computational task represented by the destination node on an event message from the computational task represented by the source node, the multi-core processor comprising a plurality of processor cores, the plurality of processor cores being configured to exchange messages in a network on chip (NoC), the network on chip comprising NoC routers interconnected by NoC links, a complete set of back edges being specified for the cyclic task graph, wherein for each back edge, a produce-consume behavior is ultimately periodic and there is a bounded produce-consume protocol, the bounded produce-consume protocol having a corresponding back edge limit B, the method comprising a scheduler that combines the assignment of priorities to tasks with the calculation of input buffer sizes, the scheduler comprising: - constructing (S1C) an implicit acyclic task graph by removing the complete set of back edges from the cyclic task graph; - assigning priorities to nodes and edges of the constructed implicit acyclic task graph using the method as claimed in claim 1; - allocating (S7) for each input buffer a capacity which exceeds the sum of the trailing edge limits of all trailing edges mapped to the input buffer.
3. The method according to claim 1 or 2, further comprising executing an artificial neural network specified by the acyclic task graph mapped onto the multi-core processor, the executing comprising: A processor core (1) of the multi-core processor executes (S10) a first task assigned to the processor core; The processor core (1) receives (S11) an input message of a second task; The processor core (1) compares the priority of the second task with the priority of the first task (S12); After determining (S13) that the priority of the second task exceeds the priority of the first task, the processor core (1) pausing (S14) the execution of the first task; executing (S15) the second task; and After completing the second task, execution of the first task is resumed (S16).
4. A multi-core processor (100) comprising a plurality of processor cores (1, 1a, ..., 1o), the plurality of processor cores being configured to exchange messages in an on-chip message exchange network (7) (NoC), the on-chip message exchange network comprising NoC routers (71) interconnected by NoC links (72), the multi-core processor (100) being configured to execute a neural network, the neural network being specified as a task graph comprising a plurality of nodes interconnected by directed edges, each node representing a computational task to be performed during the execution of the neural network, each edge from a source node to a destination node representing a dependency of the computational task represented by the destination node on an event message from the computational task represented by the source node, each task of the task graph being assigned to a processor core of the multi-core processor, and each task dependency being mapped to a (non-cyclic) NoC path of the NoC link (72), wherein the processor core of the multi-core processor (100) comprises an input buffer for receiving input messages, and the processor core is configured to: executing (S10) a first task assigned to the processor core; receiving (S11) an input message of a second task; comparing the priority of the second task with the priority of the first task (S12); After determining (S13) that the priority of the second task exceeds the priority of the first task: pausing (S14) the execution of the first task; executing (S15) the second task; and After completing the second task, execution of the first task is resumed (S16).
