Task scheduling method, execution terminal device, storage medium and program product

By judging and updating the task status of graph tasks in the execution end device, the problem of high communication overhead in graph task scheduling is solved, efficient graph task processing on the device side is realized, and task operation efficiency is improved.

CN115878272BActive Publication Date: 2024-10-29CAMBRICON TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111108264.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-22
Publication Date
2024-10-29
Estimated Expiration
2041-09-22

AI Technical Summary

Technical Problem

In the existing graph task scheduling method, frequent communication between the host and the execution device leads to low task processing efficiency. Especially when the number and complexity of tasks increase, the communication overhead and IO overhead increase significantly, affecting the overall processing efficiency.

Method used

By determining the task execution status of the predecessor task that has a dependency relationship with the current task in the execution end device, and judging whether to execute the current task based on the status of the predecessor task and the current task, if so, updating the task status after the task ends, realizing the device The on-side graph task scheduling processing reduces dependence on the host and reduces communication and IO overhead.

Benefits of technology

There is no need for task scheduling on the host side. The execution side device can manage task dependencies by itself and directly obtain the status of predecessor tasks, which improves task running efficiency, reduces communication overhead, and improves overall processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115878272B_ABST
    Figure CN115878272B_ABST
Patent Text Reader

Abstract

The graph task scheduling method, execution end device, storage medium and program product provided by the embodiments of the present invention determine the task execution status of a successor task that has a dependency relationship with the current task; judge whether to execute the current task based on the task execution status of the predecessor task and the task execution status of the current task; if so, update the task execution status of the current task after the execution of the current task is completed, so that the execution end device can directly obtain the task execution status of the successor task of the current task before executing the current task, thereby realizing the graph task scheduling processing of the execution end device, thereby eliminating the need for the host end device to perform task scheduling for the task execution of the execution end device, reducing communication overhead and improving task operation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to a graph task scheduling method, an execution end device, a storage medium, and a program product. Background Art

[0002] A graph task is a task represented by a graph structure. Each node in the graph structure corresponding to the graph task represents a task, and the directed edges formed between nodes represent the dependency relationship between tasks.

[0003] When processing graph tasks, each task is usually sent to the execution device (referred to as device) in sequence through the host device (referred to as host), and the processing unit of the execution device executes each task. Among them, the execution device will return the task execution result to the host device after completing the task, so that the host device can send the next task to the execution device.

[0004] However, with the increase in the number of tasks in the graph task and the complexity of the graph task itself, this task scheduling method requires a lot of time cost on the scheduling communication between the execution end device and the host end device, and its overall task processing efficiency is seriously affected. Summary of the invention

[0005] The embodiments of the present invention provide a graph task scheduling method, an execution end device, a storage medium and a program product, which are used to solve the problem in the existing graph task scheduling method that the communication overhead during the scheduling process is large, resulting in low task processing efficiency.

[0006] In a first aspect, an embodiment of the present invention provides a graph task scheduling method, comprising:

[0007] Determine the task execution status of the predecessor task that has a dependency relationship with the current task;

[0008] Determining whether to execute the current task according to the task execution status of the predecessor task and the task execution status of the current task;

[0009] If so, the task execution status of the current task is updated after the execution of the current task is completed.

[0010] In an optional embodiment,

[0011] The task execution status of different tasks is stored in different register bits of the register;

[0012] Wherein, when the register bit record is a first state value, the task execution state of the task corresponding to the register bit is a completed state;

[0013] When the register bit is recorded as the second state value, the task execution state of the task corresponding to the register bit is an unfinished state.

[0014] In an optional embodiment,

[0015] The determining whether to execute the current task according to the task execution status of the predecessor task and the task execution status of the current task includes:

[0016] Reading the register of the previous task and the current task in the register;

[0017] When the register bit of the predecessor task is recorded as the first state value and the register bit of the current task is recorded as the second state value, it is determined to execute the current task.

[0018] In an optional implementation manner, updating the task execution status of the current task after the current task is executed includes:

[0019] The register bit of the current task is updated to a first state value.

[0020] In an optional implementation manner, the method further comprises:

[0021] Obtaining an execution status update operation identifier in the task descriptor of the current task;

[0022] After the execution of the current task is completed, the task execution status of the current task is updated according to the execution status update operation identifier of the current task.

[0023] In an optional implementation manner, the method further comprises:

[0024] Obtaining an execution status check operation identifier in the task descriptor of the current task;

[0025] The task execution status of a predecessor task having a dependency relationship with the current task is determined according to the execution status operation identifier of the current task.

[0026] In an optional implementation, if it is determined that the current task cannot be executed based on the task execution status of the predecessor task and the task execution status of the current task, the step of determining the task execution status of the predecessor task that has a dependency relationship with the current task is returned until it is determined that the current task can be executed based on the task execution status of the predecessor task and the task execution status of the current task.

[0027] In an optional implementation manner, the method further comprises:

[0028] Obtaining a task descriptor of each task in the graph task, wherein the task descriptor includes dependency information between the tasks in the graph task;

[0029] According to the task descriptor of each task in the graph task, a predecessor task having a dependency relationship with the current task is determined.

[0030] In a second aspect, an embodiment of the present invention provides a computer system, comprising: a host end and a device end; wherein:

[0031] The host side is used to configure the task descriptor of the graph task, and send the graph task and the task descriptor corresponding to the graph task to the device side; wherein the task descriptor contains the dependency information between the tasks in the graph task;

[0032] The device side is used to determine the task execution status of a predecessor task that has a dependency relationship with the current task; determine whether to execute the current task based on the task execution status of the predecessor task and the task execution status of the current task; if so, update the task execution status of the current task after the execution of the current task is completed.

[0033] In a third aspect, an embodiment of the present application provides an execution end device, including: a memory, a processor;

[0034] Memory; Memory for storing instructions executable by the processor;

[0035] Wherein, the processor is configured to:

[0036] Determine the task execution status of the predecessor task that has a dependency relationship with the current task;

[0037] Determining whether to execute the current task according to the task execution status of the predecessor task and the task execution status of the current task;

[0038] If so, the task execution status of the current task is updated after the execution of the current task is completed.

[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the scheduling method for graph tasks as described in any one of the first aspects.

[0040] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method for scheduling graph tasks described in any one of the first aspects.

[0041] The graph task scheduling method, execution end device, storage medium and program product provided by the embodiments of the present invention determine the task execution status of a successor task that has a dependency relationship with the current task; judge whether to execute the current task based on the task execution status of the predecessor task and the task execution status of the current task; if so, update the task execution status of the current task after the execution of the current task is completed, so that the device can directly obtain the task execution status of the successor task of the current task before executing the current task, thereby realizing graph task scheduling processing on the device side, thereby eliminating the need for the host to schedule tasks for the device's task execution, reducing communication overhead and improving task operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0043] Figure 1 A schematic diagram showing the structure of a board 10 according to an embodiment of the present disclosure is shown;

[0044] Figure 2 A structural diagram showing a combined processing device in the chip 101 of this embodiment;

[0045] Figure 3 The schematic diagram of the internal structure of the computing device 201 as a single core is shown;

[0046] Figure 4 It shows a schematic diagram of the internal structure of the computing device 201 as a multi-core;

[0047] Figure 5 A schematic diagram showing the internal structure of a processor core according to an embodiment of the present disclosure is shown;

[0048] Figure 6 A schematic diagram of a graph structure of a graph task;

[0049] Figure 7 It is a flowchart of a method for scheduling graph tasks provided by the prior art;

[0050] Figure 8 It is a flowchart of a graph task scheduling method provided by this application;

[0051] Fig. 9 A schematic diagram of the hardware structure of a computer system provided for this application.

[0052] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0053] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0054] In view of the problem that in the existing graph task scheduling process, when the host-side device (referred to as: host) sends each task in the graph task to the execution-side device (referred to as: device) in sequence and executes it, the execution-side device will return the task execution result to the host-side device after completing each task, which leads to a large communication overhead between the device and the host, and the task processing efficiency is seriously affected. The present application provides a graph task scheduling method, an execution-side device, a storage medium and a program product.

[0055] The present disclosure provides a graph task scheduling method supported by an execution-end device, which inserts operations such as checking or updating the task execution status in the graph task, so that the device can automatically determine the task execution status of a predecessor task in the graph task that has a dependency relationship with the current task; judge whether to execute the current task based on the task execution status of the predecessor task and the task execution status of the current task; if so, a technical means is used to update the task execution status of the current task after the execution of the current task is completed, so that the device can directly obtain the task execution status of the predecessor task of the current task before executing the current task, thereby realizing graph task scheduling processing on the device side, thereby eliminating the need for the host to perform task scheduling for the device's task execution, reducing communication and IO overhead, and improving task operation efficiency.

[0056] Among them, the method and the device are based on the same application concept. Since the method and the device solve the problem in a similar principle, the implementation of the device and the method can refer to each other, and the repeated parts will not be repeated.

[0057] For the sake of convenience, the computer hardware structure involved in this application scheme will be described first:

[0058] Figure 1FIG. 1 is a schematic diagram showing the structure of a board 10 according to an embodiment of the present disclosure, which can be used as the execution end device mentioned above. Figure 1 As shown, the board 10 includes a chip 101, which is a system-on-chip (SoC), or system on chip, integrated with one or more combined processing devices, which are artificial intelligence computing units that support various deep learning and machine learning algorithms to meet the intelligent processing needs in complex scenarios in the fields of computer vision, speech, natural language processing, data mining, etc. In particular, deep learning technology is widely used in the field of cloud intelligence. A notable feature of cloud intelligence applications is the large amount of input data, which places high demands on the storage capacity and computing power of the platform. The board 10 of this embodiment is suitable for cloud intelligence applications and has huge off-chip storage, on-chip storage, and powerful computing power.

[0059] The chip 101 is connected to an external device 103 via an external interface device 102. The external device 103 is, for example, a server, a computer, a camera, a display, a mouse, a keyboard, a network card, or a wifi interface. The data to be processed can be transmitted from the external device 103 to the chip 101 via the external interface device 102. The calculation result of the chip 101 can be transmitted back to the external device 103 via the external interface device 102. According to different application scenarios, the external interface device 102 can have different interface forms, such as a PCIe interface.

[0060] The board 10 also includes a storage device 104 for storing data, which includes one or more storage units 105. The storage device 104 is connected to the control device 106 and the chip 101 through a bus and transmits data. The control device 106 in the board 10 is configured to control the state of the chip 101. To this end, in an application scenario, the control device 106 may include a microcontroller (MCU).

[0061] Figure 2 1 is a block diagram showing the combined processing device in the chip 101 of this embodiment. Figure 2 As shown in , the combined processing device 20 includes a computing device 201 , an interface device 202 , a processing device 203 and a storage device 204 .

[0062] The computing device 201 is configured to execute user-specified operations, and is mainly implemented as a single-core intelligent processor or a multi-core intelligent processor to perform deep learning or machine learning calculations. It can interact with the processing device 203 through the interface device 202 to jointly complete the user-specified operations.

[0063] The interface device 202 is used to transmit data and control instructions between the computing device 201 and the processing device 203. For example, the computing device 201 can obtain input data from the processing device 203 via the interface device 202 and write it into the storage device on the computing device 201 chip. Further, the computing device 201 can obtain control instructions from the processing device 203 via the interface device 202 and write them into the control cache on the computing device 201 chip. Alternatively or optionally, the interface device 202 can also read data in the storage device of the computing device 201 and transmit it to the processing device 203.

[0064] The processing device 203, as a general processing device, performs basic controls including but not limited to data handling, starting and / or stopping the computing device 201. Depending on the implementation, the processing device 203 can be a central processing unit (CPU), a graphics processing unit (GPU) or one or more types of processors in other general and / or special processors, these processors include but are not limited to digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., and their number can be determined according to actual needs. As mentioned above, only with respect to the computing device 201 disclosed in the present invention, it can be regarded as having a single-core structure or a homogeneous multi-core structure. However, when the computing device 201 and the processing device 203 are integrated and considered together, the two are regarded as forming a heterogeneous multi-core structure.

[0065] The storage device 204 is used to store data to be processed, which may be DRAM or DDR memory, and is usually 16G or larger in size, and is used to store data of the computing device 201 and / or the processing device 203 .

[0066] Figure 3 The single-core computing device 301 is used to process input data such as computer vision, speech, natural language, and data mining. The single-core computing device 301 includes three modules: a control module 31 , a computing module 32 , and a storage module 33 .

[0067] The control module 31 is used to coordinate and control the operation of the operation module 32 and the storage module 33 to complete the deep learning task, and includes an instruction fetch unit (IFU) 311 and an instruction decode unit (IDU) 312. The instruction fetch unit 311 is used to obtain instructions from the processing device 203, and the instruction decode unit 312 decodes the obtained instructions and sends the decoding results to the operation module 32 and the storage module 33 as control information.

[0068] The operation module 32 includes a vector operation unit 321 and a matrix operation unit 322. The vector operation unit 321 is used to perform vector operations and can support complex operations such as vector multiplication, addition, and nonlinear transformation; the matrix operation unit 322 is responsible for the core calculation of the deep learning algorithm, namely matrix multiplication and convolution.

[0069] The storage module 33 is used to store or transfer relevant data, including a neuron RAM (NRAM) 331, a parameter RAM (WRAM) 332, and a direct memory access module (DMA) 333. NRAM 331 is used to store input neurons, output neurons, and intermediate results after calculation; WRAM 332 is used to store the convolution kernel of the deep learning network, that is, the weight; DMA 333 is connected to DRAM 204 through bus 34, and is responsible for data transfer between the single-core computing device 301 and DRAM 204.

[0070] Figure 4 The schematic diagram of the internal structure of the computing device 201 is shown as a multi-core. The multi-core computing device 41 adopts a hierarchical structure design. The multi-core computing device 41 is a system on chip, which includes at least one cluster, and each cluster includes multiple processor cores. In other words, the multi-core computing device 41 is composed of a hierarchy of system on chip-cluster-processor core.

[0071] At the system-on-chip level, Figure 4 As shown, the multi-core computing device 41 includes an external storage controller 401 , a peripheral communication module 402 , an on-chip interconnect module 403 , a synchronization module 404 and a plurality of clusters 405 .

[0072] There may be multiple external storage controllers 401, two of which are shown in the figure as an example, and are used to respond to access requests issued by the processor core and access external storage devices, such as Figure 2DRAM 204 in the chip, thereby reading data from outside the chip or writing data. The peripheral communication module 402 is used to receive control signals from the processing device 203 through the interface device 202 to start the computing device 201 to perform tasks. The on-chip interconnect module 403 connects the external storage controller 401, the peripheral communication module 402 and multiple clusters 405 to transmit data and control signals between each module. The synchronization module 404 is a global synchronization barrier controller (GBC) used to coordinate the work progress of each cluster and ensure information synchronization. Multiple clusters 405 are the computing cores of the multi-core computing device 41. Four are shown as examples in the figure. With the development of hardware, the multi-core computing device 41 disclosed in the present invention can also include 8, 16, 64, or even more clusters 405. Clusters 405 are used to efficiently execute deep learning algorithms.

[0073] At the cluster level, Figure 4 As shown, each cluster 405 includes multiple processor cores (IPU cores) 406 and a memory core (MEM core) 407 .

[0074] The figure shows four processor cores 406 as an example, but the present disclosure does not limit the number of processor cores 406. Figure 5 Each processor core 406 is similar to Figure 3 The single-core computing device 301 also includes three modules: a control module 51, a computing module 52 and a storage module 53. The functions and structures of the control module 51, the computing module 52 and the storage module 53 are roughly the same as those of the control module 31, the computing module 32 and the storage module 33, and are not repeated here. It should be noted that the storage module 53 includes an input / output direct memory access module (IODMA) 533 and a move direct memory access module (MVDMA) 534. IODMA 533 controls the memory access of NRAM 531 / WRAM 532 and DRAM 204 through the broadcast bus 409; MVDMA 534 is used to control the memory access of NRAM 531 / WRAM 532 and the storage unit (SRAM) 408.

[0075] Back to Figure 4The storage core 407 is mainly used for storage and communication, that is, to store shared data or intermediate results between the processor cores 406, and to perform communication between the cluster 405 and the DRAM 204, communication between the clusters 405, and communication between the processor cores 406. In other embodiments, the storage core 407 has the ability of scalar operation and is used to perform scalar operation.

[0076] The storage core 407 includes an SRAM 408, a broadcast bus 409, a cluster direct memory access module (CDMA) 410, and a global direct memory access module (GDMA) 411. The SRAM 408 plays the role of a high-performance data transfer station. The data reused between different processor cores 406 in the same cluster 405 does not need to be obtained from the DRAM 204 by each processor core 406, but is transferred between the processor cores 406 via the SRAM 408. The storage core 407 only needs to quickly distribute the reused data from the SRAM 408 to multiple processor cores 406, so as to improve the efficiency of inter-core communication and greatly reduce on-chip and off-chip input / output access.

[0077] The broadcast bus 409, CDMA 410 and GDMA 411 are respectively used to perform communication between processor cores 406, communication between clusters 405 and data transmission between clusters 405 and DRAM 204. They will be described below.

[0078] The broadcast bus 409 is used to complete high-speed communication between the processor cores 406 in the cluster 405. The broadcast bus 409 of this embodiment supports inter-core communication modes including unicast, multicast and broadcast. Unicast refers to point-to-point (e.g., single processor core to single processor core) data transmission, multicast is a communication mode of transmitting a copy of data from the SRAM 408 to a specific number of processor cores 406, and broadcast is a communication mode of transmitting a copy of data from the SRAM 408 to all processor cores 406, which is a special case of multicast.

[0079] The CDMA 410 is used to control the memory access of the SRAM 408 between different clusters 405 in the same computing device 201 .

[0080] GDMA 411 cooperates with external memory controller 401 to control the access of SRAM 408 of cluster 405 to DRAM 204, or reads data from DRAM 204 to SRAM 408. As can be seen from the above, the communication between DRAM 204 and NRAM 431 or WRAM 432 can be realized through two channels. The first channel is to directly connect DRAM 204 and NRAM 431 or WRAM 432 through IODAM 433; the second channel is to first transmit data between DRAM 204 and SRAM 408 through GDMA 411, and then transmit data between SRAM 408 and NRAM 431 or WRAM 432 through MVDMA 534. Although it seems that the second channel requires more components to participate and the data flow is longer, in fact, in some embodiments, the bandwidth of the second channel is much greater than that of the first channel, so the communication between DRAM 204 and NRAM 431 or WRAM 432 may be more efficient through the second channel. The embodiments of the present disclosure can select a data transmission channel according to the hardware conditions thereof.

[0081] In other embodiments, the functions of GDMA 411 and IODMA 533 can be integrated into the same component. For the convenience of description, this disclosure regards GDMA 411 and IODMA 533 as different components. For those skilled in the art, as long as the functions implemented and the technical effects achieved are similar to those of this disclosure, they belong to the protection scope of this disclosure. Furthermore, the functions of GDMA 411, IODMA 533, CDMA 410, and MVDMA 534 can also be implemented by the same component.

[0082] The scheduling method of the graph task provided in this application is to execute Figure 1 In the board 10 shown, the graph task may include various deep learning and machine learning tasks, such as a neural network task including multiple task nodes. The graph task can be applied to complex scenarios in the fields of computer vision, speech, natural language processing, data mining, etc.

[0083] Based on the hardware structure of the above-mentioned execution end device, in order to more clearly understand the technical solution of the present application, the scheduling solution of the graph task in the prior art will be introduced in detail below.

[0084] A graph task refers to a task between multiple consecutive tasks represented by a graph structure. Each node in the graph structure corresponding to the graph task represents a task, and the directed edges formed between the nodes represent the dependencies between the tasks. Among them, a graph task can be a neural network task, and each task node in the graph task can be an operator in the neural network task (such as convolution, full connection, activation, etc.).

[0085] Figure 6 is a schematic diagram of the graph structure of a graph task, such as Figure 6 As shown, the graph structure includes five nodes A, B, C, D, and E. Each node represents a task. A is connected to B, C, and D respectively with directed edges, and B, C, and D are connected to E respectively with directed edges. Based on the graph structure, it can be seen that A has a dependency relationship with B, C, and D, that is, B, C, and D can only perform operations after A performs operations; B, C, and D have a dependency relationship with E, that is, E can only perform operations after B, C, and D have all completed operations.

[0086] It is precisely because of the task dependencies in the graph tasks that Figure 7 This is a flowchart of a method for scheduling graph tasks provided by the prior art. Figure 7 As shown, in the prior art, when the execution end device (abbreviated as: device) processes a graph task, it needs to provide it with a task scheduling scheme for the graph task through the host end device (abbreviated as: host). That is, after generating the graph task, the host needs to send each task to the execution end device in sequence according to the graph structure in the graph task, and the processing unit of the execution end device executes each task.

[0087] In order to enable the device to execute each task according to the correct dependencies between tasks, the host will schedule tasks for the device, that is, the device is required to return the task execution result to the host each time it completes a task. After obtaining the task result, the host will determine the next task that can be executed based on the dependencies in the graph structure, and send the next task to the device for execution. The host will repeat the task sending and task result reception until all tasks in the entire graph task have completed the calculation.

[0088] Obviously, such a task scheduling method requires frequent interaction between the host device and the execution device, which is obviously inefficient. With the increase in the number of tasks in the graph task and the complexity of the graph task itself, the host and the device need to spend a lot of communication resources and time resources on task delivery and task result return, resulting in a surge in communication overhead and IO overhead; at the same time, while waiting for the host to deliver and schedule tasks, the computing resources of the device are stagnant, which also reduces the utilization rate of the computing resources of the device, resulting in poor overall processing efficiency of the graph task.

[0089] In order to solve the problem of increased overhead caused by the above-mentioned existing graph task scheduling method, in this application, the host sends the graph task as a whole to the device, and after the device completes the execution of all tasks in the graph task, it receives the processing results of the graph task uploaded by the device at one time. As for the scheduling and execution of each task in the graph task, the device automatically maintains the dependency relationship between each task node in the graph task.

[0090] Specifically, the device can determine the task execution status of a predecessor task that has a dependency relationship with the current task; determine whether to execute the current task based on the task execution status of the predecessor task and the task execution status of the current task; if so, update the task execution status of the current task after the execution of the current task is completed, so that the device can directly obtain the task execution status of the predecessor task of the current task before executing the current task, thereby realizing graph task scheduling processing on the device side, thereby eliminating the need for the host to schedule tasks for the device's task execution, reducing communication and IO overhead, and improving task operation efficiency.

[0091] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the steps provided above.

[0092] Figure 8 This is a flowchart of a graph task scheduling method provided by the present application. The graph task scheduling method can be applied to Figure 1 In the computer hardware structure shown in FIG. 1 , the execution subject of the scheduling method may be an execution end device, which may be the aforementioned board 10 , and specifically may be the aforementioned chip 101 . Figure 1 The external device 103 may be the aforementioned host-end device, which may generate a graph task and send the graph task in a whole form to the execution-end device through the external interface device 102, so that the execution-end device may execute the graph task based on the scheduling method.

[0093] like Figure 8 As shown, the task scheduling method includes:

[0094] Step 801: Determine the task execution status of the predecessor task that has a dependency relationship with the current task;

[0095] Step 802: judging whether to execute the current task according to the task execution status of the predecessor task and the task execution status of the current task;

[0096] Step 803: If the current task is executed, then the task execution status of the current task is updated after the execution of the current task is completed.

[0097] Specifically, after the execution end device receives the graph task sent by the host end device, it can first perform a check operation on the execution status of the predecessor task based on the dependency relationship between the tasks described in the graph task before the execution end device executes the current task to determine the task execution status of the predecessor task that has a dependency relationship with the current task.

[0098] Then, the execution end device will determine whether to execute the current task according to the task execution status of the predecessor task and the task execution status of the current task.

[0099] Finally, after completing the execution of the current task, the execution end device may also perform an update operation on the execution status of the current task to update the task execution status of the current task.

[0100] Among them, the execution status of the task may include completed, in execution and not executed. Optionally, when the execution status of the predecessor of the current task is completed, and the task execution status of the current task is not executed, the execution end device can determine to execute the current task, and can update the task execution status of the current task after the current task is executed. Otherwise, if the execution status of the current task is completed, and / or the execution status of the predecessor task of the current task is in execution or not executed, it can be determined that the current task will not be executed. In the embodiment of the present disclosure, the dependency relationship of each task node in the graph task can be determined by the execution end device, so as to ensure the order and correctness of the execution of the graph task. In addition, the execution end device can automatically perform the status check operation and status update operation of the task. During the execution of the graph task, the execution end device does not need to interact with the host end device, thereby reducing communication and IO overhead and improving the execution efficiency of the graph task.

[0101] Furthermore, the host side can configure the status check operation and status update operation of the task through the operation identifier, and send the indication information together with the graph task to the execution end device at one time, thereby reducing communication and IO overhead and improving the execution efficiency of the graph task.

[0102] Optionally, each task may correspond to a task descriptor, which can be used to record various information of the task, including but not limited to: the above-mentioned operation identifier, dependencies between tasks, task scale, etc. The task descriptor of the task may be generated when the graph task is constructed, and the task descriptor will also be sent to the execution end device along with the graph task. Among them, the task scale refers to the resource configuration of the computing resources required for the graph task. The dependency relationship may include: the task structure of the graph task, that is, the number of input edges or the number of output edges that the task depends on in the graph task, and the predecessor node of which tasks the task node is, that is, the dependency relationship can be used to determine the predecessor task of the task.

[0103] That is, the execution end device can determine the dependency relationship between the tasks by analyzing the information in the task descriptor of the graph task. That is, in an optional implementation, the execution end device can first obtain the task descriptor of each task in the graph task, wherein the task descriptor contains the dependency information between the tasks in the graph task; then, according to the task descriptor of each task in the graph task, determine the predecessor task that has a dependency relationship with the current task.

[0104] Specifically, the task descriptor may include at least one bit to indicate the dependency relationship, such as recording the number of input edges of the task node to indicate the number of predecessor tasks that the task node depends on; and / or recording the number of output edges of the task node, and indicating which tasks the task node is the predecessor node of. Furthermore, the task descriptor may also include a mapping relationship between each input edge and its predecessor node.

[0105] like Figure 6 As shown, the number of input edges of tasks B, C, and D is 1 respectively, and the descriptors of tasks B, C, and D can include the number of their input edges and the input task node A corresponding to the input edge. The number of input edges of task E can be 3, and the descriptor of task E can include the number of input edges 3, as well as each input edge and its corresponding input task node. Figure 6 The arrow pointing to the task is the input edge.

[0106] In the embodiment of the present disclosure, the host device can configure the task descriptor of each task in the graph task. For example, the driver running on the host device can configure the task descriptor of each task and send the task descriptor together with the graph task to the execution device. Figure 6 After the graph task shown in the figure, the predecessor task and successor task of each task will be determined based on the dependency relationship in the task descriptor of each task, and the execution order of each task in the graph task will be determined according to the dependency relationship between the tasks, such as executing task A first, then executing tasks B, C and D, and finally executing task E.

[0107] Among them, by analyzing the dependency relationship, it can be known that task A will be the predecessor task of tasks B, C and D, and tasks B, C and D will be the predecessor tasks of task E. After the execution end device determines that the predecessor task of tasks B, C and D is task A, before executing tasks B, C and D, it is necessary to first determine the task execution status of task A to ensure that task A has been completed. Similarly, after the execution end device determines that the predecessor tasks of task E are tasks B, C and D, before executing task E, it is necessary to determine the task execution status of tasks B, C and D to ensure that tasks B, C and D have been completed.

[0108] Based on this, the execution end device can determine the scheduling strategy for the output task, as shown below:

[0109] For the execution of Task A: determine the task execution status of Task A → execute Task A → update the task execution status of Task A.

[0110] For the execution of tasks B, C, and D: determine the task execution status of task A and determine the task execution status of tasks B, C, and D → execute tasks B, C, and D → update the task execution status of tasks B, C, and D;

[0111] For the execution of task E: determine the task execution status of tasks B, C, and D and determine the task execution status of task E → execute task E → update the task execution status of task E.

[0112] Then, the execution end device will allocate corresponding computing resources to each task according to the above-mentioned task execution order and the scheduling strategy of each task, so that multiple computing resources execute the corresponding tasks until the task execution status of task E is updated to completed. When the graph task has been executed, the execution end device can return the execution result of the graph task to the host end device.

[0113] Of course, in the above process, when the execution end device determines that the current task cannot be executed based on the task execution status of the predecessor task and the task execution status of the current task, it returns to the step of determining the task execution status of the predecessor task that has a dependency relationship with the current task until it is determined to execute the current task based on the task execution status of the predecessor task and the task execution status of the current task.

[0114] Still Figure 6 Taking the execution of Task B in the task shown in the figure as an example, after the execution end device allocates the corresponding scheduling resources for Task B, the computing resources will start to execute the operation of Task B only when it is determined that the task execution status of Task A is completed. At this time, if the execution end device learns that the task execution status of Task A is not completed, then the computing resources will not execute the operation of Task B at this time, and re-acquire the task execution status of Task A after a preset time, until it is determined that the task execution status of Task A is completed, and the operation of Task B is triggered.

[0115] Through such a scheduling method, the execution end device can complete the scheduling of each task according to the received graph task, and ensure that each task can be executed in the order of its dependency. Compared with the existing technology, the execution end device does not need to conduct multiple scheduling communications with the host end device, and its scheduling overhead is relatively small. At the same time, since multiple computing resources are used to process each task separately, while ensuring high scheduling efficiency, the computing resources of the execution end device have a shorter pause time when processing tasks, which effectively improves the overall processing efficiency of the task.

[0116] Optionally, a hardware register may be set in the execution end device to store the task execution status of different tasks. In an optional implementation, the task execution status of different tasks is stored in different register bits of the register. When the register bit records a first state value, the task execution status of the task corresponding to the register bit is a completed state; when the register bit records a second state value, the task execution status of the task corresponding to the register bit is an uncompleted state.

[0117] Specifically, after the graph task is sent to the execution end device, the execution end device can first initialize the state value of each register bit in the register, that is, according to the graph structure in the graph task, allocate corresponding register bits to each task to establish a mapping relationship between tasks and register bits.

[0118] On this basis, when the execution end device determines whether to execute the current task based on the task execution status of the predecessor task and the task execution status of the current task, it can be specifically as follows: the execution end device reads the register bits of the predecessor task and the current task in the register; when the register bits of the predecessor task are recorded as the first state value and the register bits of the current task are recorded as the second state value, it is determined to execute the current task.

[0119] Specifically, Figure 6 Taking task B in as an example, based on the mapping relationship in the aforementioned initialization phase, the execution end device can determine the register bit of task A, the predecessor of task B, and read and obtain the status value of the register bits of task A and task B; at this time, if the status value of the register bit of task A is the first status value, and the status value of the register bit of task B is the second status value, then the execution end device can determine that task B can start execution.

[0120] Accordingly, in order to ensure that the entire graph task can be executed smoothly and facilitate the execution of subsequent tasks, in an optional implementation, after the task is executed, the execution end device also updates the register bit of the current task to the first state value.

[0121] Specifically, after task B is completed, the execution end device will also update the state value of the register bit corresponding to task B from the second state value to the first state value according to the aforementioned mapping relationship, so as to indicate that the task execution state of the current task B is completed.

[0122] Further optionally, the execution end device may also perform a corresponding status check or status update operation according to the operation identifier in the task descriptor to implement the check or update of the corresponding register bit in the register.

[0123] Optionally, the operation identifier may include an execution status update operation identifier for updating the task execution status of the current task; the execution end device may obtain the execution status update operation identifier in the task descriptor of the current task, and after the execution of the current task is completed, update the task execution status of the current task according to the execution status update operation identifier of the current task.

[0124] Further optionally, the operation identifier may also include an execution status check operation identifier for determining the task execution status of a predecessor task; the execution end device may obtain the execution status check operation identifier in the task descriptor of the current task, and determine the task execution status of the predecessor task that has a dependency relationship with the current task based on the execution status operation identifier of the current task.

[0125] Specifically, when the host-side device generates a task descriptor, on the one hand, the dependencies between the tasks are considered, and on the other hand, the change operations of the task execution status corresponding to each task are also considered. Among them, each task descriptor can also include several types of operation identifiers, among which the execution status update operation identifier can be used to indicate that the execution status of the task needs to be updated, and the execution status determination operation identifier can be used to indicate that the execution status of the task needs to be read and determined (i.e., the execution status check operation). The execution-side device can perform the corresponding operation according to whether the operation identifier is enabled.

[0126] by Figure 6Taking the graph tasks shown as an example, since task A is the first node, the execution status update operation flag in the task descriptor of task A can be configured to be enabled (such as set to 1), which means that after task A is executed, the status update operation of task A needs to be executed. Based on the dependency relationship of the graph tasks, it can be determined that tasks B, C, and D are intermediate nodes, which have both predecessor tasks A and successor tasks E. Therefore, the execution status update operation flag and the execution status determination operation flag in the task descriptors of tasks B, C, and D can be configured to be enabled (such as set to 1). Among them, the execution status update operation flag enabled indicates that after tasks B, C, and D are executed, the status update operation of tasks B, C, and D needs to be executed accordingly. The execution status determination operation flag enabled indicates that before tasks B, C, and D are executed, the status determination operation of task A needs to be executed accordingly. Since task E is a termination node, it has predecessor tasks B, C, and D, but no successor tasks. Therefore, the execution status update operation flag and the execution status determination operation flag in the task descriptor of task E can be configured to be enabled (such as set to 1), which means that before task E is executed, the status determination operation of tasks B, C, and D needs to be executed accordingly, and after task E is executed, the status update operation of task E is executed. The enabling or disabling of the operation flag in the task descriptor can be configured by the host side.

[0127] Based on this, after the execution end device obtains the graph task and the corresponding task descriptor, it can directly update the register bits of the register corresponding to the task according to the execution status update operation identifier in the task descriptor. That is, before executing the current task, the execution end device can perform a status check operation of the predecessor task of the current task according to the execution status determination operation identifier in the task descriptor of the current task to determine the execution status of the predecessor task of the current task. And, after completing the execution of the current task, the execution end device can perform a status update operation of the current task according to the execution status update operation identifier in the task descriptor of the current task to update the register bits of the current task to the first state value.

[0128] Optionally, the execution end device may include a task scheduler and at least one computing resource, the computing resource may be a multi-core processor, and the task scheduler is used to schedule and allocate the graph task to the at least one computing resource so that the processor executes the corresponding task. In the embodiment of the present disclosure, the task nodes in the graph task can be scheduled to the corresponding computing resources for execution, and the above-mentioned execution status update operation and execution status determination operation can be performed by the task scheduler.

[0129] For example, for Figure 6For the tasks in the figure, the task scheduler can first assign task A to computing resource A so as to use computing resource A to perform computing processing. After computing resource A completes task A, the task scheduler can perform a state update operation to update the state of task A. Before computing resources B, C, and D perform computing processing of tasks B, C, and D, the task scheduler is also used to perform a task state determination operation to determine whether its predecessor task A has been completed. When it is determined that task A has been completed, the task scheduler can schedule tasks B, C, and D to computing resources B, C, and D respectively so as to use computing resources B, C, and D to perform computing processing respectively. The task scheduler can also be used to perform state update operations on tasks B, C, and D respectively after tasks B, C, and D have been completed. When the execution end device performs task scheduling for each task, according to the task dependency relationship, multiple computing resources can perform computing processing simultaneously. For example, after computing resource A completes the computing of task A, computing resource B, computing resource C, and computing resource D can simultaneously process their respective corresponding tasks B, task C, and task D. In this way, tasks can be executed quickly, improving the overall execution efficiency of graph tasks. Furthermore, the task scheduler is also used to perform a task status determination operation according to the task description of task E to determine whether its predecessor tasks B, C, and D have been completed. When it is determined that tasks B, C, and D have been completed, the task scheduler can schedule task E to computing resource E to respectively use computing resource E to perform computing processing. The task scheduler can also be used to perform a status update operation on task E after task E is completed.

[0130] The graph task scheduling method provided by the embodiment of the present invention determines the task execution status of a successor task that has a dependency relationship with the current task; determines whether to execute the current task based on the task execution status of the predecessor task and the task execution status of the current task; if so, uses technical means to update the task execution status of the current task after the execution of the current task is completed, so that the device can directly obtain the task execution status of the successor task of the current task before executing the current task, thereby realizing graph task scheduling processing on the device side, thereby eliminating the need for the host to perform task scheduling for the device's task execution, reducing communication overhead, and improving task operation efficiency.

[0131] Fig. 9 A schematic diagram of the hardware structure of a computer system provided in this application. Fig. 9 As shown, the computer system includes: a host end 1010 and a device end 1020; wherein,

[0132] The host side 1010 is used to configure the task descriptor of the graph task, and send the graph task and the task descriptor corresponding to the graph task to the device side; wherein the task descriptor includes the dependency information between the tasks in the graph task;

[0133] Device end 1020 is used to determine the task execution status of a predecessor task that has a dependency relationship with the current task; determine whether to execute the current task based on the task execution status of the predecessor task and the task execution status of the current task; if so, update the task execution status of the current task after the execution of the current task is completed.

[0134] The device end 1020 in the computer system can be used to execute the method described in the first embodiment.

[0135] The present application also provides an execution end device, including: a memory, a processor;

[0136] Memory; Memory for storing instructions executable by the processor;

[0137] Wherein, the processor is configured to:

[0138] Determine the task execution status of the predecessor task that has a dependency relationship with the current task;

[0139] Determining whether to execute the current task according to the task execution status of the predecessor task and the task execution status of the current task;

[0140] If so, the task execution status of the current task is updated after the execution of the current task is completed.

[0141] In addition, the processor is also configured to be used to execute the method described in the aforementioned embodiment 1.

[0142] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the scheduling method for graph tasks as described in any one of the first embodiments.

[0143] The computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.

[0144] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the method for scheduling graph tasks described in any one of the first embodiments.

[0145] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0146] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer executable instructions. These computer executable instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0147] These computer executable instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0148] These computer executable instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

Claims

1. A method for scheduling graph tasks, characterized in that: The method is applied to an execution end device, and the method includes: Acquire a graph task; wherein the graph task includes a plurality of consecutive tasks, and the graph task is sent as a whole from the host end to the execution end device; Determine the task execution status of the predecessor task that has a dependency relationship with the current task; Determining whether to execute the current task according to the task execution status of the predecessor task and the task execution status of the current task; If so, updating the task execution status of the current task after the execution of the current task is completed; The method further comprises: After completing the execution processing of all tasks in the graph task, the processing results of the graph task are sent to the host end at one time.

2. The method for scheduling graph tasks according to claim 1, characterized in that: The task execution status of different tasks is stored in different register bits of the register; Wherein, when the register bit record is a first state value, the task execution state of the task corresponding to the register bit is a completed state; When the register bit is recorded as the second state value, the task execution state of the task corresponding to the register bit is an unfinished state.

3. The method for scheduling graph tasks according to claim 2, characterized in that: The determining whether to execute the current task according to the task execution status of the predecessor task and the task execution status of the current task includes: Reading the register of the previous task and the current task in the register; When the register bit of the predecessor task is recorded as the first state value and the register bit of the current task is recorded as the second state value, it is determined to execute the current task.

4. The method for scheduling graph tasks according to claim 2, characterized in that: The updating of the task execution status of the current task after the execution of the current task is completed includes: The register bit of the current task is updated to a first state value.

5. The method for scheduling graph tasks according to any one of claims 1 to 4, characterized in that: The method further comprises: Obtaining an execution status update operation identifier in the task descriptor of the current task; After the execution of the current task is completed, the task execution status of the current task is updated according to the execution status update operation identifier of the current task.

6. The method for scheduling graph tasks according to claim 5, characterized in that: The method further comprises: Obtaining an execution status check operation identifier in the task descriptor of the current task; The task execution status of a predecessor task having a dependency relationship with the current task is determined according to the execution status operation identifier of the current task.

7. The method for scheduling graph tasks according to claim 1, characterized in that: If it is determined that the current task cannot be executed based on the task execution status of the predecessor task and the task execution status of the current task, then return to the step of determining the task execution status of the predecessor task that has a dependency relationship with the current task until it is determined to execute the current task based on the task execution status of the predecessor task and the task execution status of the current task.

8. The method for scheduling graph tasks according to claim 1, characterized in that: The method further comprises: Obtaining a task descriptor of each task in the graph task, wherein the task descriptor includes dependency information between the tasks in the graph task; According to the task descriptor of each task in the graph task, a predecessor task having a dependency relationship with the current task is determined.

9. A computer system, characterized in that: include: Host side and device side; among them, The host side is used to configure the task descriptor of the graph task, and send the graph task and the task descriptor corresponding to the graph task to the device side; wherein the task descriptor contains the dependency information between the tasks in the graph task; A device side, used for obtaining a graph task; wherein, the graph task includes a plurality of consecutive tasks, and the graph task is sent as a whole from the host side to the device side; determining the task execution status of a predecessor task having a dependency relationship with the current task; judging whether to execute the current task according to the task execution status of the predecessor task and the task execution status of the current task; if so, updating the task execution status of the current task after the execution of the current task is completed; after completing the execution processing of all tasks in the graph task, sending the processing results of the graph task to the host side at one time.

10. An execution end device, comprising: Memory, processor; Memory; a memory for storing instructions executable by the processor; Wherein, the processor is configured to: Acquire a graph task; wherein the graph task includes a plurality of consecutive tasks, and the graph task is sent as a whole from the host end to the execution end device; Determine the task execution status of the predecessor task that has a dependency relationship with the current task; Determining whether to execute the current task according to the task execution status of the predecessor task and the task execution status of the current task; If so, updating the task execution status of the current task after the execution of the current task is completed; After completing the execution processing of all tasks in the graph task, the processing results of the graph task are sent at one time.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method for scheduling graph tasks as described in any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for scheduling graph tasks described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Task scheduling method and task scheduling apparatus

    CN104965754A

  • Workflow scheduling method and system

    CN112748997A