Task processing method and device, many-core system, and computer-readable medium

By mapping the task blocks of the calculation graph to multiple processing cores and training the calculation graph, the problem of poor robustness of the many-core system in dealing with core failures is solved, and the availability and redundancy of the calculation graph in the event of a failure are improved.

CN112835718BActive Publication Date: 2024-08-27LYNXI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110184918.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-10
Publication Date
2024-08-27
Estimated Expiration
2041-02-10

AI Technical Summary

Technical Problem

When many-core systems deal with core failures, all tasks in one layer of the calculation graph cannot be processed. The system has poor robustness and cannot obtain usable processing results.

Method used

By dividing each layer of the computational graph into multiple task blocks and mapping these task blocks to multiple processing cores, ensuring that all task blocks of the same layer are mapped to at least two different processing cores, training and expansion are used The computational graph method improves its redundancy performance so that the computational graph can still produce usable results when dealing with core failures.

Benefits of technology

Improved the robustness of the calculation graph to ensure that when any processing core is invalid, only the tasks of some layers will be invalid, instead of causing all the tasks of the entire layer to be invalid, so that the overall calculation graph can still produce a certain degree of usable processing results. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112835718B
    Figure CN112835718B
Patent Text Reader

Abstract

The present disclosure provides a method for task processing, the method comprising: obtaining a computational graph of a problem to be processed; the computational graph comprises a plurality of layers arranged in sequence, each layer comprises a plurality of tasks, tasks in any layer are not performed based on the results of tasks in the current layer or in the subsequent layers, and at least some tasks in at least some layers are performed based on the results of tasks in the previous layers; each layer of the computational graph is divided into a plurality of task blocks; each task block comprises at least one task; a mapping relationship between each task block and a plurality of processing cores of a many-core system is determined; according to the mapping relationship, each of the task blocks is mapped to a processing core, and a plurality of task blocks are mapped to each of the processing cores, and all the task blocks of any layer are mapped to at least two different processing cores. The present disclosure also provides a task processing device, a many-core system, and a computer-readable medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of many-core technology, and more particularly to a method and device for task processing, a many-core system, and a computer-readable medium. Background Art

[0002] To solve a problem through electronic computing is essentially to process multiple tasks (or operations) corresponding to it.

[0003] The above processing can be performed using a many-core system. A many-core system includes multiple processing cores (or kernels, processing engines) that can interact with each other, and multiple tasks corresponding to the problem to be processed can be mapped (or assigned) to different processing cores and processed by each processing core.

[0004] Obviously, the processing cores of the many-core system may inevitably become invalid (eg due to failure), so it is very important to ensure that a certain degree of usable processing results can still be obtained when some processing cores of the many-core system are invalid. Summary of the invention

[0005] Embodiments of the present disclosure provide a method and apparatus for task processing, a many-core system, and a computer-readable medium.

[0006] In a first aspect, an embodiment of the present disclosure provides a method for task processing, including:

[0007] Obtain a computational graph of the problem to be processed; the computational graph includes a plurality of layers arranged in sequence, each layer includes a plurality of tasks, tasks in any layer are not performed based on results of tasks in the layer or in subsequent layers, and at least some tasks in at least some layers are performed based on results of tasks in previous layers;

[0008] Divide each layer of the computational graph into a plurality of task blocks; each task block includes at least one task;

[0009] Determine the mapping relationship between each task block and multiple processing cores of the many-core system; according to the mapping relationship, each task block is mapped to a processing core, multiple task blocks are mapped to each processing core, and all the task blocks of any layer are mapped to at least two different processing cores.

[0010] In some embodiments, between obtaining a computational graph of the problem to be processed and dividing each layer of the computational graph into a plurality of task blocks, the process further includes:

[0011] The computation graph is trained to improve redundancy performance of the computation graph.

[0012] In some embodiments, the training the computation graph includes at least one of the following:

[0013] Invalidate some tasks in the computation graph to train the computation graph;

[0014] invalidating a region of the computation graph to train the computation graph; the region comprising a plurality of tasks;

[0015] The computation graph is trained by adversarial sample defense.

[0016] In some embodiments, dividing each layer of the computation graph into a plurality of task blocks comprises:

[0017] The computation graph is expanded, and each layer of the expanded computation graph is divided into a plurality of task blocks; the expansion includes adding redundant tasks in at least some layers of the computation graph.

[0018] In some embodiments, the redundant tasks include at least one of the following:

[0019] A backup task; the backup task is the same as the task in the corresponding layer;

[0020] Empty task;

[0021] Invalid task.

[0022] In some embodiments, dividing each layer of the computation graph into a plurality of task blocks comprises any one of the following:

[0023] Randomly divide each layer of the computational graph into a plurality of task blocks;

[0024] Evenly divide each layer of the computational graph into multiple task blocks;

[0025] Divide each layer of the computation graph into a plurality of pre-task blocks, and merge all pre-task blocks that should be mapped to one processing core according to the mapping relationship into one task block;

[0026] Each layer of the computational graph is divided into a plurality of task blocks at least according to the hardware resources of each of the processing cores.

[0027] In some embodiments, between dividing each layer of the computation graph into a plurality of task blocks and determining a mapping relationship between each task block and a plurality of processing cores of the many-core system, the process further includes:

[0028] Some task blocks are invalidated to train each task block and improve the redundancy performance of the computation graph.

[0029] In some embodiments, the invalid part of the task block to train each task block includes at least one of the following:

[0030] Randomly invalidate some task blocks to train each task block;

[0031] A critical task block including a critical task is determined, and the critical task block is invalidated to train each task block.

[0032] In some embodiments, according to the mapping relationship, any two task blocks of any layer are mapped to two different processing cores.

[0033] In some embodiments, after determining the mapping relationship between each task block and multiple processing cores of the many-core system, the method further includes:

[0034] All task blocks mapped in the invalid part processing core are used to train each task block and improve the redundancy performance of the computation graph.

[0035] In some embodiments, the invalid portion processes all task blocks mapped in the core to train each task block including at least one of the following:

[0036] All task blocks mapped in the random invalid part processing core are used to train each task block;

[0037] Invalidate all task blocks mapped in each processing core in turn to train each task block;

[0038] A critical task block including a critical task is determined, and all task blocks mapped in a processing core to which the critical task block is mapped are invalidated to train each task block.

[0039] In some embodiments, the computational graph is a trainable computational graph; the trainable computational graph can solve the same problem to be processed when at least some of the tasks therein are different.

[0040] In some embodiments, the computational graph is a neural network.

[0041] In some embodiments, after determining the mapping relationship between each task block and multiple processing cores of the many-core system, the method further includes:

[0042] According to the mapping relationship, each task block is mapped to a plurality of processing cores;

[0043] Each processing core processes the tasks in the task blocks mapped thereto.

[0044] In a second aspect, an embodiment of the present disclosure provides a task processing device, including:

[0045] An acquisition module is configured to acquire a computational graph of a problem to be processed; the computational graph includes a plurality of layers arranged in sequence, each layer includes a plurality of tasks, tasks in any layer are not performed based on results of tasks in the layer or in subsequent layers, and at least some tasks in at least some layers are performed based on results of tasks in previous layers;

[0046] A block division module, configured to divide each layer of the computational graph into a plurality of task blocks; each task block includes at least one task;

[0047] A mapping module is configured to determine the mapping relationship between each task block and multiple processing cores of the many-core system; according to the mapping relationship, each task block is mapped to a processing core, multiple task blocks are mapped to each processing core, and all the task blocks of any layer are mapped to at least two different processing cores.

[0048] In a third aspect, an embodiment of the present disclosure provides a many-core system, including:

[0049] multiple processing cores; and

[0050] An on-chip network configured to exchange data between the plurality of processing cores and external data;

[0051] One or more instructions are stored in one or more of the processing cores, and one or more of the instructions are executed by one or more of the processing cores, so that one or more of the processing cores can execute the method for implementing any one of the above-mentioned task processing.

[0052] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein the computer program implements any one of the above-mentioned task processing methods when executed by a processing core.

[0053] In the disclosed embodiment, all tasks in the same layer of the computation graph are mapped to at least two different processing cores for processing. Thus, when any processing core is invalid (e.g., due to a failure), at most only a portion of a layer of the computation graph is “broken down”, and all tasks of a layer will not be invalid. This allows the computation graph as a whole to still produce processing results that are usable to a certain extent, greatly improving the robustness of the computation graph.

[0054] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:

[0056] Figure 1 A flowchart of a task processing method provided by an embodiment of the present disclosure;

[0057] Figure 2 A flowchart of another task processing method provided by an embodiment of the present disclosure;

[0058] Figure 3 A schematic diagram of a process in which a computation graph is processed in a method for processing a task provided by an embodiment of the present disclosure;

[0059] Figure 4 A block diagram of a task processing device provided by an embodiment of the present disclosure;

[0060] Figure 5 A block diagram of a multi-core system provided in an embodiment of the present disclosure;

[0061] Figure 6 A block diagram of a computer-readable medium provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0062] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0063] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0064] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0065] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.

[0066] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.

[0067] The actual work to be done in many problems (such as image processing, speech recognition, etc.) can be expressed in the form of a "computational graph (or task graph, logic graph)". That is, all the operations required to solve the problem are divided into multiple "tasks (or nodes)", each task includes certain operations, and there is a certain order between different tasks. For example, if the operation of a task requires the operation results of other tasks, then the task is said to be based on the results of other tasks; in other words, the task is the subsequent task of other tasks, and other tasks are the previous tasks of the task.

[0068] Since there are the above relationships between tasks, refer to Figure 3 , the computational graph can be divided into multiple "layers", each layer includes multiple tasks, and the tasks in any layer are not based on the tasks in the current layer or the subsequent layer, and at least some of the tasks in at least some layers are based on the results of the tasks in the previous layer. That is, if the tasks in the previous layer are not completed, it may cause the tasks in the next layer to be unable to proceed, because the calculation results of the tasks in the previous layer may be used in the calculation process of the tasks in the next layer; but if the tasks in the next layer cannot be performed, it will not affect the previous layer, because the calculation of the tasks in the previous layer will not use the calculation results of the tasks in the next layer; and there is no relationship between tasks in the same layer, because if there is, the corresponding tasks should belong to two different layers.

[0069] For example, in Figure 3 In the figure, differently filled boxes represent tasks of different layers (layer 0 to layer 3), the horizontal size of the filled boxes represents the number of tasks therein, and blank boxes represent different processing cores (processing core 0 to processing core 3).

[0070] Among them, for example, "neural network (NN)" is a form of computational graph. The neural network is divided into multiple layers, each layer includes multiple nodes, certain operations need to be performed in each node, and the nodes of different layers are connected with certain relationships (such as the output of one node is used as the input of the node of the next layer); thus, each layer of the neural network can be regarded as a layer of the computational graph, and each node of the neural network can be regarded as a task of the computational graph.

[0071] Exemplarily, the neural network in the embodiments of the present disclosure can be used for image processing, speech recognition, etc., and can specifically be in the form of a convolutional neural network (CNN), a spiking neural network (SNN), a recurrent neural network (RNN), etc.

[0072] For example, some problems may correspond to multiple different computation graphs. That is, the number of tasks in the computation graph, the layers where the tasks are located, the relationship between tasks, the specific operations of each task, etc. may be different, but these different computation graphs can all solve the problem (but the effect of solving the problem may not be the same).

[0073] The above computational graphs that may have multiple forms are called "trainable computational graphs". That is, for a computational graph that can solve a problem, the tasks in it can be adjusted through training, so that the trained computational graph can solve the problem differently.

[0074] For example, a neural network is a form of trainable computational graph. For example, a neural network that processes a problem (such as image classification) is usually trained, that is, the nodes in it are adjusted (such as adjusting the weights of the nodes) according to the current neural network's problem-solving effect (such as the accuracy of image classification), thereby changing the neural network (computational graph) and improving its problem-solving effect (such as improving the accuracy of image classification).

[0075] In some related technologies, when a problem is to be processed by a many-core system, the tasks of each layer of the corresponding computational graph can be mapped (assigned) to a processing core, and tasks of different layers are mapped to different processing cores.

[0076] However, according to the above method, once a processing core of the many-core system is invalid (for example, due to a failure), it is equivalent to that all tasks of one layer of the computational graph cannot be processed, and thus all tasks after this layer cannot actually be performed. Therefore, it is inevitable that the entire problem cannot be solved at all (that is, no processing results can be obtained), and the robustness of the system is very poor.

[0077] First, refer to Figures 1 to 3 , an embodiment of the present disclosure provides a method for task processing.

[0078] The task processing method of the embodiment of the present disclosure is based on a many-core system, which includes how to map the tasks of a computation graph to each processing core of the many-core system.

[0079] Reference Figure 1 , the task processing method of the embodiment of the present disclosure includes:

[0080] S101. Obtain a computational graph for the problem to be processed.

[0081] The computational graph includes a plurality of layers arranged in sequence, each layer includes a plurality of tasks, tasks in any layer are not performed based on the results of tasks in the current layer or its subsequent layers, and at least some tasks in at least some layers are performed based on the results of tasks in the previous layer.

[0082] When a problem to be processed (such as image processing, speech recognition, etc.) is to be processed using a many-core system, its corresponding computational graph is obtained. The computational graph that has been preset can be obtained; or the computational graph can be generated according to a predetermined rule based on the specific problem to be processed.

[0083] S103. Divide each layer of the computation graph into multiple task blocks.

[0084] Each task block includes at least one task.

[0085] Reference Figure 3 , the tasks in each layer of the computational graph are divided into multiple "groups", that is, each layer is divided into multiple "task blocks", each task block includes one or more tasks in the layer.

[0086] The number of task blocks divided into each layer may be preset, such as presetting each layer to be divided into a number of task blocks.

[0087] Alternatively, the “blocking” may be performed according to a determined method, with the actual number of task blocks obtained being the basis.

[0088] S105: Determine a mapping relationship between each task block and multiple processing cores of the many-core system.

[0089] According to the mapping relationship, each task block is mapped to one processing core, multiple task blocks are mapped to each processing core, and all task blocks of any layer are mapped to at least two different processing cores.

[0090] Reference Figure 3 After obtaining multiple task blocks, it can be determined to which processing core of the many-core system each task block should be mapped, that is, the mapping relationship (not necessarily the actual mapping).

[0091] According to the mapping relationship of the embodiment of the present disclosure, the mapping is "dispersed", that is, all task blocks in the same layer should be "separately" mapped to different processing cores as much as possible, at least to ensure that they are not all mapped to the same processing core. Since each task block includes tasks in the same layer, and each task block in the same layer is mapped to different processing cores, the above mapping relationship ensures that all tasks in the same layer are mapped to at least two different processing cores.

[0092] In the disclosed embodiment, all tasks in the same layer of the computation graph are mapped to at least two different processing cores for processing. Thus, when any processing core is invalid (e.g., due to a failure), at most only a portion of a layer of the computation graph is “broken down”, and all tasks of a layer will not be invalid. This allows the computation graph as a whole to still produce processing results that are usable to a certain extent, greatly improving the robustness of the computation graph.

[0093] In some embodiments, the computation graph is a trainable computation graph.

[0094] Among them, the trainable computational graph can solve the same problem to be processed when at least some of the tasks are different.

[0095] In some embodiments, the computational graph is a neural network (NN).

[0096] As one mode of an embodiment of the present disclosure, the above computational graph is a trainable computational graph, and further is a neural network, such as a convolutional neural network (CNN), a spiking neural network (SNN), a recurrent neural network (RNN), etc.; thus, the redundancy performance thereof can be further improved by training the computational graph.

[0097] Of course, the embodiments of the present disclosure are not limited to trainable computational graphs (such as neural networks), but can also be used for other computational graphs.

[0098] In some embodiments, according to the mapping relationship, any two task blocks of any layer are respectively mapped to two different processing cores.

[0099] Further, see Figure 3 , which can achieve maximum dispersed mapping (or "mutually exclusive" mapping), that is, ensuring that no task blocks from the same layer are mapped to the same processing core.

[0100] In some embodiments, reference Figure 2 , Figure 3 , between obtaining the computational graph of the problem to be processed (S101) and dividing each layer of the computational graph into a plurality of task blocks (S103), it also includes:

[0101] S102: Train the computation graph to improve the redundancy performance of the computation graph.

[0102] Before the computational graph is “chunked”, it can also be trained to improve its redundancy performance.

[0103] In some embodiments, the training computation graph (S102) includes at least one of the following:

[0104] (1) Invalidate some tasks in the computation graph to train the computation graph.

[0105] As one method of an embodiment of the present disclosure, the Dropout method can be used to invalidate some tasks in the computation graph (such as making the weights of some nodes in the neural network 0), and adjust other tasks so that the computation graph can produce results that are usable to a certain extent when these tasks are invalid, thereby improving its robustness.

[0106] (2) A region of the invalid computation graph to train the computation graph.

[0107] Among them, an area includes multiple tasks.

[0108] As one method of an embodiment of the present disclosure, a Dropblock method may be used to invalidate all tasks in an area (which may include a portion of a layer, or corresponding portions of multiple layers) in the computation graph, and adjust other tasks so that the computation graph can produce results that are usable to a certain extent when the tasks in the area are invalid, thereby improving its robustness.

[0109] In each "area" of the above method, usually more tasks are finally mapped to one processing core, so it can better improve the redundancy performance of the computational graph.

[0110] (3) Train the computational graph through adversarial sample defense.

[0111] As one method of an embodiment of the present disclosure, a computational graph may be trained using an “adversarial sample defense” method.

[0112] In the disclosed embodiments, all computational graphs to be trained must be trainable computational graphs (such as neural networks).

[0113] In the disclosed embodiment, each type of training may be performed only once, or may be performed multiple times in a cycle.

[0114] In the disclosed embodiment, when multiple trainings are performed, the specific methods used in each training may be the same or different.

[0115] In the disclosed embodiment, when multiple trainings are performed, the training may be terminated when a preset termination criterion is reached. The termination criterion may include convergence of the computation graph, reaching a predetermined number of trainings, reaching a predetermined redundancy performance, etc.

[0116] All training in the embodiments of the present disclosure can meet the above requirements and will not be described in detail later.

[0117] In some embodiments, reference Figure 2 , Figure 3 , each layer of the computational graph is divided into multiple task blocks (S103), including:

[0118] S1031. Expand the computation graph, and divide each layer of the expanded computation graph into multiple task blocks.

[0119] The expansion includes adding redundant tasks in at least some layers of the computation graph.

[0120] As one method of an embodiment of the present disclosure, it can be first "expanded" or "decompressed", that is, some tasks (redundant tasks) that were not originally there can be "added" to each layer of the computational graph, and then the decompressed computational graph can be divided into blocks, so that at least part of the resulting task blocks include the above "redundant tasks" to improve redundancy performance.

[0121] The specific "expansion amount" of each layer can be preset. For example, the redundancy coefficient b can be set to indicate the ratio of the amount of computation of the expanded task to the amount of computation of the original task: if the redundancy coefficient b = 0, it is equivalent to no expansion; if b = 1, it is equivalent to the amount of computation of the expanded task being the same as the amount of computation of the original task; generally speaking, b can be greater than 0 and less than or equal to 1 (if b is greater than 1, it is also feasible, such as having "multiple copies" of task backup).

[0122] Alternatively, each layer may be expanded according to a certain method, and the actual task volume obtained by expanding according to the method shall prevail.

[0123] In some embodiments, the redundant tasks include at least one of the following:

[0124] (1) Backup task.

[0125] The backup tasks are the same as the tasks in the corresponding layer.

[0126] As one method of the embodiment of the present disclosure, each extended task can be an original task in the corresponding layer, so that there are actually "multiple copies" of the corresponding task, so they can serve as "backups" for each other. That is, when a task is not completed (such as a failure of the processing core), subsequent tasks can use the backup calculation results to improve robustness.

[0127] Of course, the “backup task” and the “original task” should generally be divided into different task blocks, and these task blocks should be mapped to different processing cores.

[0128] (2) Empty task.

[0129] As one method of the embodiment of the present disclosure, empty tasks that do not perform actual operations (or perform empty operations) can be expanded.

[0130] (3) Invalid tasks.

[0131] As one method of an embodiment of the present disclosure, some tasks that require calculations but are not required in the original calculation graph, that is, invalid tasks, can be expanded.

[0132] The invalid tasks may be generated randomly or through other specific anti-compression technologies.

[0133] The expansion modes of different layers may be the same or different.

[0134] In some embodiments, dividing each layer of the computation graph into a plurality of task blocks (S103) includes any of the following:

[0135] (1) Each layer of the computational graph is randomly divided into multiple task blocks.

[0136] As one method of an embodiment of the present disclosure, the tasks in each layer may be randomly “divided into blocks”, that is, the number of tasks and specific tasks in each task block are random.

[0137] (2) Divide each layer of the computational graph evenly into multiple task blocks.

[0138] As one method of an embodiment of the present disclosure, each layer may be evenly divided into multiple task blocks, that is, the number of tasks in each task block of the same layer is equal or substantially equal (for example, among all task blocks of the same layer, if the number of tasks in the task block with the least tasks is 100%, the number of tasks in the task block with the most tasks shall not exceed 110%).

[0139] (3) Each layer of the computation graph is divided into multiple pre-task blocks, and all pre-task blocks that should be mapped to one processing core according to the mapping relationship are merged into one task block.

[0140] As a method of an embodiment of the present disclosure, the subsequent "mapping" can be taken into consideration when dividing the blocks, that is, each layer is first divided into multiple "blocks (pre-task blocks)", and if multiple pre-task blocks are subsequently mapped to one processing core, they can be directly merged into one task block.

[0141] (4) Divide each layer of the computational graph into multiple task blocks at least based on the hardware resources of each processing core.

[0142] As one method of an embodiment of the present disclosure, when performing "block division", the actual hardware resources of the processing core (such as cache, etc.) and the subsequent "mapping" can also be considered, so as to decide which tasks should be divided into the task block based on the hardware resources of the processing core to which each task block is mapped.

[0143] The hardware resources of different processing cores may be the same or different.

[0144] The block division methods of different layers may be the same or different.

[0145] In some embodiments, reference Figure 2 , Figure 3, between dividing each layer of the computation graph into a plurality of task blocks (S103) and determining a mapping relationship between each task block and a plurality of processing cores of the many-core system (S105), further comprising:

[0146] S104. Invalidate some task blocks to train each task block and improve the redundancy performance of the computation graph.

[0147] After "block splitting", one or more (but not all) task blocks can be invalidated (that is, all tasks in them are invalidated), and the tasks in other task blocks can be adjusted so that the remaining task blocks can still produce results that are usable to a certain extent (that is, training task blocks), thereby improving robustness.

[0148] Of course, the above training is essentially training of the "computational graph".

[0149] The above training is performed after block division (also after expansion or decompression), which is equivalent to improving the robustness of the "block level".

[0150] In some embodiments, invalidating some task blocks to train each task block (S104) includes at least one of the following:

[0151] (1) Randomly invalidate some task blocks to train each task block.

[0152] As one method of the embodiment of the present disclosure, some of the task blocks may be randomly invalidated to train the remaining task blocks.

[0153] (2) Determine the key task blocks including the key tasks and the invalid key task blocks to train each task block.

[0154] As one method of an embodiment of the present disclosure, a "key task" that plays a key role in the computation graph may be determined according to the structural characteristics of the computation graph, and the key task block where the key task is located may be invalidated to train the task block.

[0155] In some embodiments, reference Figure 2 , Figure 3 After determining the mapping relationship between each task block and the multiple processing cores of the many-core system (S105), the method further includes:

[0156] S106. All task blocks mapped in the invalid part processing core are trained to improve the redundancy performance of the computation graph.

[0157] After the mapping relationship is determined (including after the actual mapping is performed), all tasks mapped in some processing cores can be invalidated (equivalent to invalidating some processing cores), and other tasks can be adjusted so that the remaining tasks can still produce results that are usable to a certain extent (i.e., training task blocks), thereby improving robustness.

[0158] Of course, the above training is essentially training of the "computational graph".

[0159] The above training is equivalent to simulating the situation where some processing cores are invalid due to failures, etc., so it can improve the robustness of the "core level" from the perspective of final practical application.

[0160] In some embodiments, invalidating all task blocks mapped in the partial processing core to train each task block (S106) includes at least one of the following:

[0161] (1) All task blocks mapped in the random invalid part processing core are trained to train each task block.

[0162] As one method of an embodiment of the present disclosure, all tasks mapped to one or more (but not all) processing cores may be invalidated (ie, one or more processing cores may be invalidated) to train each task block.

[0163] (2) Invalidate all task blocks mapped in each processing core in turn to train each task block.

[0164] As one method of the embodiment of the present disclosure, each processing core may be invalidated in sequence, that is, only one processing core is invalidated each time, but all processing cores are invalidated.

[0165] (3) Determine all task blocks mapped in the processing cores including the critical task blocks and the invalid critical task blocks to train each task block.

[0166] As one method of an embodiment of the present disclosure, the key task may be determined according to the structure of the computational graph, and then the key task block where the key task is located may be determined, and the processing core corresponding to the key task block may be invalidated to train each task block.

[0167] In some embodiments, reference Figure 2 After determining the mapping relationship between each task block and the multiple processing cores of the many-core system (S105), the method further includes:

[0168] S107 . Map each task block to multiple processing cores according to the mapping relationship.

[0169] S108 . Each processing core processes the tasks in the task blocks mapped thereto.

[0170] After the mapping relationship is determined, each task block can be mapped (or allocated) to a processing core according to the mapping relationship, and processed by each processing core to realize the actual function of the calculation graph and solve the above-mentioned problems to be processed.

[0171] Of course, the above steps of determining the mapping relationship (S105) and performing mapping according to the mapping relationship (S107) can actually be integrated, that is, the mapping can be performed directly.

[0172] Of course, when the training of step S106 above is to be carried out, refer to Figure 2 , step S106 can be performed before step S107, that is, the task is not actually mapped to the processing core, but only the task corresponding to the processing core is invalidated according to the mapping relationship, and training is performed.

[0173] Alternatively, step S106 may be performed after step S107, that is, the tasks may be actually mapped to the processing cores, and the processing cores may be actually invalidated for training.

[0174] Second, refer to Figure 4 The present disclosure provides a task processing device 600, including:

[0175] An acquisition module 601 is configured to acquire a computation graph of a problem to be processed; the computation graph includes a plurality of layers arranged in sequence, each layer includes a plurality of tasks, tasks in any layer are not performed based on results of tasks in the layer or in subsequent layers, and at least some tasks in at least some layers are performed based on results of tasks in previous layers;

[0176] A block module 602 is configured to divide each layer of the computation graph into a plurality of task blocks; each task block includes at least one task;

[0177] The mapping module 603 is configured to determine the mapping relationship between each task block and multiple processing cores of the many-core system; according to the mapping relationship, each task block is mapped to one processing core, multiple task blocks are mapped to each processing core, and all task blocks of any layer are mapped to at least two different processing cores.

[0178] The task processing apparatus 600 of the embodiment of the present disclosure can implement the above-mentioned task processing method.

[0179] It should be understood that when the above-mentioned task processing method further includes other steps, the task processing apparatus 600 may also include other modules for implementing the corresponding steps.

[0180] Thirdly, refer to Figure 5 The embodiment of the present disclosure provides a many-core system 700, including:

[0181] Multiple processing cores 701; and

[0182] The on-chip network 702 is configured to exchange data between the plurality of processing cores 701 and external data;

[0183] One or more instructions are stored in one or more processing cores 701 , and the one or more instructions are executed by one or more processing cores 701 , so that one or more processing cores 701 can execute the method for implementing any one of the above-mentioned task processing.

[0184] The many-core system 700 of the embodiment of the present disclosure can implement the above-mentioned task processing method, including performing tasks in the calculation graph to obtain processing results for the problem to be processed.

[0185] Fourthly, refer to Figure 6 The embodiment of the present disclosure provides a computer-readable medium 800 on which a computer program is stored, wherein the computer program implements any of the above-mentioned task processing methods when executed by a processing core.

[0186] The embodiment of the present disclosure provides a method for implementing the above-mentioned task processing when a computer program is stored in a computer-readable medium 800 and then executed by a processing core.

[0187] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0188] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. A task processing method, comprising: Obtain a computational graph of the problem to be processed; the computational graph includes a plurality of layers arranged in sequence, each layer includes a plurality of tasks, tasks in any layer are not performed based on results of tasks in the layer or in subsequent layers, and at least some tasks in at least some layers are performed based on results of tasks in previous layers; Divide each layer of the computational graph into a plurality of task blocks; Each task block includes at least one task; wherein, dividing each layer of the computation graph into a plurality of task blocks comprises: using a set redundancy coefficient, expanding the computation graph, and dividing each layer of the expanded computation graph into a plurality of task blocks; the expansion comprises adding redundant tasks to at least part of the layers of the computation graph, and the redundancy coefficient represents the ratio of the computational amount of the expanded task to the computational amount of the original task; Determine a mapping relationship between each task block and multiple processing cores of the many-core system; according to the mapping relationship, each task block is mapped to one processing core, multiple task blocks are mapped to each processing core, and all the task blocks of any layer are mapped to at least two different processing cores; After determining the mapping relationship between each task block and multiple processing cores of the many-core system, it also includes: invalidating all task blocks mapped in some processing cores to train each task block and improve the redundancy performance of the calculation graph.

2. The task processing method according to claim 1, wherein: Between obtaining the computation graph of the problem to be processed and dividing each layer of the computation graph into a plurality of task blocks, the method further includes: The computation graph is trained to improve redundancy performance of the computation graph.

3. The task processing method according to claim 2, wherein: The training of the computation graph includes at least one of the following: Invalidate some tasks in the computation graph to train the computation graph; invalidating a region of the computation graph to train the computation graph; the region comprising a plurality of tasks; The computation graph is trained by adversarial sample defense.

4. The task processing method according to claim 1, wherein: The redundant tasks include at least one of the following: A backup task; the backup task is the same as the task in the corresponding layer; Empty task; Invalid task.

5. The task processing method according to claim 1, wherein: Dividing each layer of the computation graph into multiple task blocks includes any of the following: Randomly divide each layer of the computational graph into a plurality of task blocks; Evenly divide each layer of the computational graph into multiple task blocks; Divide each layer of the computation graph into a plurality of pre-task blocks, and merge all pre-task blocks that should be mapped to one processing core according to the mapping relationship into one task block; Each layer of the computational graph is divided into a plurality of task blocks at least according to the hardware resources of each of the processing cores.

6. The task processing method according to claim 1, wherein: Between dividing each layer of the computation graph into a plurality of task blocks and determining a mapping relationship between each task block and a plurality of processing cores of the many-core system, the method further includes: Some task blocks are invalidated to train each task block and improve the redundancy performance of the computation graph.

7. The task processing method according to claim 6, wherein: The invalid part of the task block, so as to train each task block to include at least one of the following: Randomly invalidate some task blocks to train each task block; A critical task block including a critical task is determined, and the critical task block is invalidated to train each task block.

8. The task processing method according to claim 1, wherein: According to the mapping relationship, any two task blocks of any layer are mapped to two different processing cores.

9. The task processing method according to claim 1, wherein: The invalid part processes all task blocks mapped in the core to train each task block to include at least one of the following: All task blocks mapped in the random invalid part processing core are used to train each task block; Invalidate all task blocks mapped in each processing core in turn to train each task block; A critical task block including a critical task is determined, and all task blocks mapped in a processing core to which the critical task block is mapped are invalidated to train each task block.

10. The task processing method according to any one of claims 1 to 9, wherein: The computational graph is a trainable computational graph; the trainable computational graph can solve the same problem to be processed when at least some of the tasks therein are different.

11. The task processing method according to any one of claims 1 to 9, wherein: The computational graph is a neural network.

12. The task processing method according to any one of claims 1 to 9, wherein: After determining the mapping relationship between each task block and the multiple processing cores of the many-core system, the method further includes: According to the mapping relationship, each task block is mapped to a plurality of processing cores; Each processing core processes the tasks in the task blocks mapped thereto.

13. A task processing device, comprising: An acquisition module is configured to acquire a computational graph of a problem to be processed; the computational graph includes a plurality of layers arranged in sequence, each layer includes a plurality of tasks, tasks in any layer are not performed based on results of tasks in the layer or in subsequent layers, and at least some tasks in at least some layers are performed based on results of tasks in previous layers; The block division module is configured to expand the computation graph by setting a redundancy coefficient, and divide each layer of the expanded computation graph into a plurality of task blocks; the expansion includes adding redundant tasks to at least part of the layers of the computation graph, and the redundancy coefficient represents the ratio of the computation amount of the expanded task to the computation amount of the original task; each task block includes at least one task; A mapping module is configured to determine a mapping relationship between each task block and multiple processing cores of the many-core system; according to the mapping relationship, each task block is mapped to a processing core, multiple task blocks are mapped to each processing core, and all the task blocks of any layer are mapped to at least two different processing cores; The processing module is configured to invalidate all task blocks mapped in the partial processing core to train each task block and improve the redundancy performance of the computation graph.

14. A many-core system, comprising: Multiple processing cores; as well as An on-chip network configured to exchange data between the plurality of processing cores and external data; One or more instructions are stored in one or more of the processing cores, and one or more of the instructions are executed by one or more of the processing cores, so that one or more of the processing cores can perform the task processing method described in any one of claims 1 to 12.

15. A computer readable medium having a computer program stored thereon, wherein: The computer program implements the task processing method according to any one of claims 1 to 12 when executed by the processing core.