Task division method and device, electronic equipment, storage medium and computer product
Through the hierarchy of the deep learning model, AI tasks are divided and allocated to multiple devices for processing, the problem of unbalanced utilization of computing resources in traditional technology is solved, and efficient AI task scheduling and completion is achieved.
Patent Information
- Application Number
- CN202411780355.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-11
AI Technical Summary
The traditional AI task division method cannot fully utilize the advantages of the multi-device environment, resulting in unbalanced utilization of computing resources, affecting system performance and task completion.
By obtaining the hierarchy of the deep learning model, the AI tasks are divided into multiple parallel tasks according to the division strategies of the convolutional layer, pooling layer and fully connected layer, and assigned to different processing devices, edge devices and computing devices for feature extraction, dimensionality reduction processing and full connection operations.
It realizes the rational division and efficient scheduling of AI tasks, makes full use of computing resources, improves system performance and task completion, and significantly shortens the task completion time when handling large-scale tasks.
Smart Images

Figure CN119806805A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a task division method, device, electronic device, storage medium and computer product. Background Art
[0002] With the continuous development of computer technology, the application of deep learning models, especially CNN (Convolutional Neural Network) and LSTM (Long Short-Term Memory) models, has promoted the increasing complexity of AI (Artificial Intelligence) tasks, and the demand for computing resources has also increased dramatically.
[0003] Traditional AI task division is usually limited to a single device, that is, the entire deep learning algorithm model runs on one computing node. Although this traditional AI task division method is simple and easy to implement, it cannot fully utilize the advantages of a multi-device environment, resulting in uneven use of computing resources. When the task scale is large, a single device may not be able to complete the task within the specified time, thus affecting system performance and task completion.
[0004] Therefore, how to achieve reasonable division and efficient scheduling of AI tasks is a technical problem that needs to be solved urgently. Summary of the invention
[0005] The main purpose of this application is to provide a task division method, device, electronic device, storage medium and computer product, aiming to use the multi-level structure of deep learning models in a multi-device environment to achieve reasonable division and efficient scheduling of AI tasks.
[0006] To achieve the above objectives, the present application provides a task division method, which includes:
[0007] Obtain a hierarchical structure of a deep learning model, wherein the hierarchical structure includes at least a convolutional layer, a pooling layer, and a fully connected layer;
[0008] Determine a plurality of convolutional layer tasks according to the convolutional division strategy of the convolutional layer and the artificial intelligence tasks of the deep learning model, and perform feature extraction according to the processing device corresponding to each of the convolutional layer tasks to obtain task feature data output to the pooling layer;
[0009] Dividing the task feature data into a plurality of pooling layer tasks according to the pooling partitioning strategy of the pooling layer, and performing feature extraction according to the edge devices corresponding to each of the pooling layer tasks to obtain the task dimension reduction features output to the fully connected layer;
[0010] The task dimension reduction features are divided into matrix operation subtasks according to the fully connected partitioning strategy of the fully connected layer, and the fully connected operations are performed in parallel according to the computing devices corresponding to each matrix operation subtask.
[0011] In one embodiment, the step of determining a plurality of convolutional layer tasks based on the convolutional partitioning strategy of the convolutional layer and the artificial intelligence tasks of the deep learning model includes:
[0012] When the convolution partitioning strategy of the convolution layer is a feature map partitioning strategy, a plurality of convolution kernels corresponding to the convolution layer are determined, a convolution calculation operation is performed on the artificial intelligence task of the deep learning model according to each of the convolution kernels, and the feature maps calculated by each of the convolution kernels are used as a plurality of convolution layer tasks; or / and,
[0013] When the convolution partitioning strategy of the convolution layer is a convolution kernel partitioning strategy, the convolution computing tasks corresponding to each of the convolution kernels are used as multiple convolution layer tasks, and the convolution computing tasks are tasks in which the convolution kernel performs convolution computing operations on the artificial intelligence tasks; or / and,
[0014] When the convolution partitioning strategy of the convolution layer is a data block partitioning strategy, the number of convolution kernels of all the convolution kernels in the convolution layer is determined, and the artificial intelligence task is divided into task data blocks equal to the number of convolution kernels as multiple convolution layer tasks.
[0015] In one embodiment, the step of dividing the task feature data into a plurality of pooling layer tasks according to the pooling partitioning strategy of the pooling layer includes:
[0016] When the pooling division strategy of the pooling layer is a feature map pooling strategy, a plurality of data channels corresponding to the task feature data are determined, and a pooling operation corresponding to each of the data channels is used as a plurality of pooling layer tasks; or / and,
[0017] When the pooling partitioning strategy of the pooling layer is a data block pooling strategy, determining the number of pooling cores of all pooling cores in the pooling layer, and dividing the task feature data into pooling data blocks equal to the number of pooling cores as a plurality of pooling layer tasks; or / and,
[0018] When the pooling division strategy of the pooling layer is a batch pooling strategy, the task feature data is determined to be batch data, and the pooling operation of each batch in the batch data is used as multiple pooling layer tasks.
[0019] In one embodiment, the task division method includes:
[0020] Determine the task dependencies of the deep learning model and construct a task dependency graph based on the task dependencies; wherein the task dependencies are set to use the task feature data output by the convolutional layer as the input data of the pooling layer, and use the task dimensionality reduction features output by the pooling layer as the input data of the fully connected layer.
[0021] In one embodiment, the task division method includes:
[0022] The task priority of the artificial intelligence task is determined according to a preset task scheduling algorithm. When the task priority is higher than the priority of other tasks in the deep learning model, the deep learning model is triggered to divide the artificial intelligence task according to the hierarchical structure. The task scheduling algorithm is:
[0023] P(t)=α*urgency(t)+β*resource_usage(t)+y*dependency_level(t)
[0024] Among them, P(t) refers to the priority of artificial intelligence task t; urgency(t) refers to the urgency of artificial intelligence task t, α refers to the weight of the urgency, resource_usage(t) refers to the resource usage of artificial intelligence task t, β refers to the weight of the resource usage, dependency_level(t) refers to the dependency level of artificial intelligence task t, and y refers to the weight of the dependency level.
[0025] In one embodiment, the task division method includes:
[0026] Determine the dependent tasks of the deep learning model, and determine the task processing layer where the dependent tasks are located;
[0027] Delay compensation is performed on the device communication delay between the task processing layer and the task processing layer above the task processing layer according to a preset delay compensation mechanism.
[0028] In addition, to achieve the above-mentioned purpose, the present application also provides a task division device, the task division device comprising:
[0029] An acquisition module, used to acquire a hierarchical structure of a deep learning model, wherein the hierarchical structure includes at least a convolutional layer, a pooling layer, and a fully connected layer;
[0030] A convolution partitioning module, used to determine a plurality of convolution layer tasks according to the convolution partitioning strategy of the convolution layer and the artificial intelligence tasks of the deep learning model, and perform feature extraction according to the processing device corresponding to each of the convolution layer tasks to obtain task feature data output to the pooling layer;
[0031] A pooling partitioning module is used to divide the task feature data into multiple pooling layer tasks according to the pooling partitioning strategy of the pooling layer, and perform feature extraction according to the edge devices corresponding to each of the pooling layer tasks to obtain the task dimension reduction features output to the fully connected layer;
[0032] The fully connected partitioning module is used to divide the dimension reduction features of the task into matrix operation subtasks according to the fully connected partitioning strategy of the fully connected layer, and perform fully connected operations in parallel according to the computing devices corresponding to each matrix operation subtask.
[0033] Each functional module of the task division device of the present application implements the steps of the task division method of the present application as described above during operation.
[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a device, which includes a memory, a processor, and a task division program stored in the memory and executable on the processor, and the task division program implements the steps of the above-mentioned task division method when executed by the processor.
[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, which is a computer-readable storage medium, and a task division program is stored on the computer-readable storage medium. When the task division program is executed by the processor, the steps of the above-mentioned task division method are implemented.
[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer product, which includes a computer program, and the computer program contains computer program code means stored on a computer-readable medium or a carrier, and the computer program code means is configured to implement the steps of the task division method as described above when executed by a computer or a processor.
[0037] The present invention proposes a task division method, device, electronic device, storage medium and computer product, which realizes the reasonable division and efficient scheduling of AI tasks in a multi-device environment for the multi-level structure of a deep learning model. Specifically, the hierarchical structure of the deep learning model is first obtained, and the hierarchical structure at least includes a convolution layer, a pooling layer and a fully connected layer. Subsequently, according to the convolution division strategy of the convolution layer and the artificial intelligence task of the deep learning model, multiple convolution layer tasks are assigned to different processing devices for feature extraction, thereby obtaining task feature data output to the pooling layer. Next, according to the pooling division strategy of the pooling layer, the task feature data is further divided into multiple pooling layer tasks, and assigned to the corresponding edge devices for feature dimensionality reduction processing, and the task dimensionality reduction features output to the fully connected layer are obtained. Finally, according to the fully connected division strategy of the fully connected layer, the task dimensionality reduction features are divided into multiple matrix operation subtasks, and with the help of the parallel computing power of multiple computing devices, the fully connected operation is efficiently performed, so as to quickly obtain the final output result of the artificial intelligence task. In other words, the task division method set up in this application fully utilizes the advantages of the hierarchical structure and multi-device environment of the deep learning model to achieve balanced utilization of computing resources, improve system performance and task completion, especially when processing large-scale tasks, and can significantly shorten the task completion time. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flowchart of the first embodiment of the task division method of the present application;
[0039] Figure 2 It is a flowchart of the second embodiment of the task division method of the present application;
[0040] Figure 3 It is a structural diagram of a task division device involved in an embodiment of the present application;
[0041] Figure 4 A schematic diagram of the structure of a task division device involved in an embodiment of the present application;
[0042] Figure 5 This is a schematic diagram of the memory structure involved in the embodiment of the present application.
[0043] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] The present application embodiment provides a task division method, referring to Figure 1 As shown, Figure 1 It is a flowchart of the first embodiment of the task division method of the present application.
[0045] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0046] With the continuous development of computer technology, the application of deep learning models, especially CNN (Convolutional Neural Network) and LSTM (Long Short-Term Memory) models, has promoted the increasing complexity of AI (Artificial Intelligence) tasks, and the demand for computing resources has also increased dramatically.
[0047] Traditional AI task division is usually limited to a single device, that is, the entire deep learning algorithm model runs on one computing node. Although this traditional AI task division method is simple and easy to implement, it cannot fully utilize the advantages of a multi-device environment, resulting in uneven use of computing resources. When the task scale is large, a single device may not be able to complete the task within the specified time, thus affecting system performance and task completion.
[0048] Therefore, how to achieve reasonable division and efficient scheduling of AI tasks is a technical problem that needs to be solved urgently. In order to solve the above-mentioned computing defects, the present application provides a task division method, device, electronic device, storage medium and computer product.
[0049] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, a database system, etc., or a device capable of realizing the above functions, such as a task division device, etc. The following takes the task division device as an example to illustrate this embodiment and the following embodiments.
[0050] The task division method of the present application includes the following implementation steps S10 to S40.
[0051] Step S10: Obtain a hierarchical structure of the deep learning model, where the hierarchical structure includes at least a convolutional layer, a pooling layer, and a fully connected layer.
[0052] In this embodiment, by obtaining the hierarchical structure of the deep learning model, since the hierarchical structure includes at least a convolutional layer, a pooling layer, and a fully connected layer, the hierarchical structure of the deep learning model can be fully utilized to achieve reasonable division and efficient scheduling of artificial intelligence tasks in a multi-device environment.
[0053] Step S20: Determine multiple convolutional layer tasks based on the convolution division strategy of the convolutional layer and the artificial intelligence tasks of the deep learning model, and perform feature extraction based on the processing equipment corresponding to each of the convolutional layer tasks to obtain task feature data output to the pooling layer.
[0054] In this embodiment, the artificial intelligence task of the deep learning model is divided into multiple convolutional layer tasks according to the convolution partitioning strategy of the convolutional layer, and each convolutional layer task is intelligently assigned to the corresponding computing device for parallel processing, thereby significantly improving the efficiency of artificial intelligence task feature extraction, so that each processing device can focus on the convolutional layer task it is responsible for, thereby making full use of computing resources, so that the task feature data output to the pooling layer can be obtained quickly and accurately.
[0055] It should be noted that the processing device can be understood as a CPU (Central Processing Unit) device; the artificial intelligence task can be understood as an image recognition task, a speech recognition task or a natural language processing task.
[0056] Step S30: Divide the task feature data into multiple pooling layer tasks according to the pooling division strategy of the pooling layer, and perform feature extraction according to the edge devices corresponding to each of the pooling layer tasks to obtain the task dimension reduction features output to the fully connected layer.
[0057] In this embodiment, the task feature data is intelligently divided into multiple pooling layer tasks according to the pooling partitioning strategy of the pooling layer, and each pooling layer task is intelligently assigned to the corresponding edge device for parallel processing, so that each edge device can be used to parallelly process the pooling layer tasks to achieve efficient dimensionality reduction processing of the task feature data, so that each edge device focuses on its assigned pooling layer tasks to extract the most representative task dimensionality reduction features and output them to the fully connected layer. This not only significantly improves the speed and efficiency of the pooling layer feature processing, but also effectively reduces the dimension of the task feature data and reduces the consumption of computing resources, providing more refined and accurate task dimensionality reduction features for the subsequent feature synthesis and decision-making of the fully connected layer.
[0058] It should be noted that edge devices can be understood as CPU devices or edge computing devices.
[0059] Step S40: Divide the dimension reduction features of the task into matrix operation subtasks according to the fully connected partitioning strategy of the fully connected layer, and perform fully connected operations in parallel according to the computing devices corresponding to each matrix operation subtask.
[0060] In this embodiment, the task dimensionality reduction features are intelligently divided into multiple matrix operation subtasks according to the fully connected partitioning strategy of the fully connected layer, and each matrix operation subtask is assigned to different computing devices to achieve parallel processing, so that each computing device can focus on the matrix operation subtask it undertakes and perform fully connected operations independently and in parallel, which greatly improves the computing speed of the fully connected layer, ensures the real-time and accuracy of data processing, and makes full use of computing resources to achieve efficient feature integration and decision support.
[0061] In summary, the present invention proposes a task division method, device, electronic device, storage medium and computer product, which realizes the reasonable division and efficient scheduling of AI tasks in a multi-device environment for the multi-level structure of the deep learning model. Specifically, the hierarchical structure of the deep learning model is first obtained, and the hierarchical structure at least includes a convolution layer, a pooling layer and a fully connected layer. Subsequently, according to the convolution division strategy of the convolution layer and the artificial intelligence task of the deep learning model, multiple convolution layer tasks are assigned to different processing devices for feature extraction, thereby obtaining task feature data output to the pooling layer. Next, the task feature data is further divided into multiple pooling layer tasks according to the pooling division strategy of the pooling layer, and assigned to the corresponding edge devices for feature dimensionality reduction processing, and the task dimensionality reduction features output to the fully connected layer are obtained. Finally, the task dimensionality reduction features are divided into multiple matrix operation subtasks according to the fully connected division strategy of the fully connected layer, and the fully connected operation is efficiently performed with the help of the parallel computing power of multiple computing devices, so as to quickly obtain the final output result of the artificial intelligence task. In other words, the task division method set up in this application fully utilizes the advantages of the hierarchical structure and multi-device environment of the deep learning model to achieve balanced utilization of computing resources, improve system performance and task completion, especially when processing large-scale tasks, and can significantly shorten the task completion time.
[0062] Furthermore, based on the first embodiment of the task division method of the present application, a second embodiment of the task division method of the present application is proposed. Figure 2 , Figure 2 This is a flow chart of the second embodiment of the task division method of the present application. In some feasible embodiments, the above-mentioned step S20: determining multiple convolutional layer tasks based on the convolution division strategy of the convolutional layer and the artificial intelligence tasks of the deep learning model, also includes the following implementation steps S201 to S203.
[0063] Step S201: When the convolution partitioning strategy of the convolution layer is a feature map partitioning strategy, a plurality of convolution kernels corresponding to the convolution layer are determined, a convolution calculation operation is performed on the artificial intelligence task of the deep learning model according to each of the convolution kernels, and the feature maps calculated by each of the convolution kernels are used as a plurality of convolution layer tasks;
[0064] In this embodiment, when the convolution division strategy of the convolution layer adopts the feature map division strategy, the multiple convolution kernels equipped by the convolution layer are determined. Subsequently, for the artificial intelligence tasks undertaken by the deep learning model, each convolution kernel independently performs the convolution calculation operation, thereby generating feature maps corresponding to each convolution kernel. These feature maps are essentially the specific manifestations of the convolution layer tasks, and each feature map contains the unique feature information of the input data (ie, artificial intelligence tasks) under the action of different convolution kernels. That is, the present application can process the computational tasks of multiple convolution kernels in parallel through the feature map division strategy, which not only significantly improves the computational efficiency of the convolution layer, but also can mine the features of the input data from multiple angles and levels, providing more comprehensive and rich feature information for the subsequent deep learning process.
[0065] It should be noted that the convolution operation can be understood as the convolution layer in the neural network of the deep learning model, which usually performs a sliding window operation with the artificial intelligence task (such as the original input image) through the convolution kernel (i.e., filter) to extract local features. Each convolution kernel is applied to a specific area of the input to generate an output feature map (i.e., the feature map calculated by the convolution kernel). Since each convolution kernel performs the convolution operation independently, the calculation of the convolution layer is usually highly parallel. Among them, the original input image can be understood as the input data when the artificial intelligence task is an image recognition task. Exemplarily, the input data of the convolution layer is usually a multi-dimensional tensor (such as the original input image), and its shape is [batch_size, height, width, channels], where "batch_size" is the sample batch size, height and width are the spatial dimensions of the original input image, channels is the number of color channels of the original input image (such as channels = 3 for RGB images), and the convolution layer performs sliding convolution through multiple convolution kernels. The output is usually an image feature map output by each convolution kernel (i.e., the convolution layer task). The size of these image feature maps is usually smaller than that of the original input image. That is to say, the output of the convolution calculation operation in the convolution layer is also in the form of a multi-dimensional tensor.
[0066] In a specific embodiment, when the convolution partitioning strategy of the convolution layer adopts the feature map partitioning strategy, the feature map obtained after each convolution kernel calculation can be used as an independent task unit and assigned to different processing devices for processing. Assuming there are n convolution kernels, the n feature maps of the convolution calculation operation can be calculated in parallel and assigned to multiple processing devices respectively.
[0067] Step S202: Alternatively or / and, when the convolution division strategy of the convolution layer is a convolution kernel division strategy, the convolution calculation task corresponding to each of the convolution kernels is used as multiple convolution layer tasks, and the convolution calculation task is a task in which the convolution kernel performs a convolution calculation operation on the artificial intelligence task.
[0068] In this embodiment, when the convolution division strategy of the convolution layer is determined to be the convolution kernel division strategy, the convolution calculation task corresponding to each convolution kernel is regarded as an independent convolution layer task, and each convolution layer task is composed of the corresponding convolution kernel performing specific convolution calculation operations on the artificial intelligence task, so that the convolution calculation task of each convolution kernel is clearly defined and allocated to the corresponding computing resources (i.e., processing equipment), realizing parallel processing, which not only significantly improves the computing efficiency of the convolution layer, but also enables the deep learning model to extract the features of the input data faster. Since each convolution kernel can focus on capturing specific feature patterns, it also enhances the feature learning ability of the deep learning model.
[0069] In a specific embodiment, each convolution kernel itself can be regarded as an independent convolution calculation task (i.e., convolution kernel operation), and different convolution calculation tasks can be assigned to multiple processing devices so that each device performs different convolution kernel operations to calculate the feature map after convolution (i.e., the feature map calculated by the convolution kernel).
[0070] Step S203: either or, when the convolution partitioning strategy of the convolution layer is a data block partitioning strategy, determine the number of convolution kernels of all the convolution kernels in the convolution layer, and divide the artificial intelligence task into task data blocks equal to the number of convolution kernels as multiple convolution layer tasks.
[0071] In this embodiment, when the convolution partitioning strategy of the convolution layer adopts the data block partitioning strategy, the number of convolution kernels of all convolution kernels in the convolution layer is first determined; then, the artificial intelligence task is divided into multiple task data blocks according to the number of convolution kernels, and each task data block corresponds to a convolution kernel, thereby constituting multiple parallel convolution layer tasks. That is, the present application allows each convolution kernel to independently perform convolution calculations on the data block it is responsible for through the data block partitioning strategy, which not only makes full use of computing resources and realizes parallel processing, but also improves the flexibility and efficiency of data processing, so that the deep learning model can complete feature extraction more quickly in the convolution layer, and provide more abundant feature information for the subsequent pooling layer and fully connected layer, thereby improving the processing speed and performance of the entire model.
[0072] In a specific embodiment, since the original input image can be understood as the input data when the artificial intelligence task is an image recognition task, the original input image is divided into task data blocks equal to the number of convolution kernels through the convolution layer, and different task data blocks are assigned to different devices for convolution operations. This can reduce the memory usage of a single device and improve computational parallelism. For example, the original input image can be divided into regions corresponding to each convolution kernel, and the convolution operation of each region is performed independently on different devices.
[0073] In a specific embodiment, assuming that the input data of the convolution layer is an input feature map of size H*W*C, the goal of the convolution operation is to generate an output of size H'*W'*N, where N is the number of convolution kernels. The size of the task data block that the corresponding processing device needs to process is calculated based on the size, stride and filling strategy of each convolution kernel, and each task data block is allocated to the corresponding processing device through a preset first allocation method; next, a parallel processing task is generated based on the hardware parallel capability of each processing device and the corresponding task data block for processing, for example, different convolution kernels are allocated to different GPU thread pools, and each thread pool processes different convolution kernel calculation tasks in parallel.
[0074] It should be noted that the preset first allocation method can be understood as each processing device processing different areas of the input image (such as rows, columns, etc.); or, each processing device processing different convolution kernel operations; or, each processing device calculating different color channels.
[0075] Furthermore, in some feasible embodiments, the above step S30: dividing the task feature data into multiple pooling layer tasks according to the pooling division strategy of the pooling layer, also includes the following implementation steps S301 to S303.
[0076] Step S301: When the pooling division strategy of the pooling layer is a feature map pooling strategy, multiple data channels corresponding to the task feature data are determined, and the pooling operations corresponding to each of the data channels are used as multiple pooling layer tasks.
[0077] When the pooling partitioning strategy of the pooling layer adopts the feature map pooling strategy, after determining multiple data channels in the task feature data, since the pooling operation corresponding to each data channel (i.e., the pooling layer task) is an independent pooling operation, the efficiency and accuracy of the pooling layer feature extraction are effectively improved.
[0078] It should be noted that the pooling operation can be understood as a spatial dimensionality reduction of the input feature map (the feature map output by the convolution layer, i.e., the task feature data). Exemplarily, the pooling operation extracts the maximum value (maximum pooling) or the average value (average pooling) in a small local area (such as a 2*2 or 3*3 sliding window), thereby reducing the spatial size of the feature map output by the pooling layer after dimensionality reduction (i.e., the task dimensionality reduction feature), and making the feature map after dimensionality reduction more compact, i.e., the size of the feature map after dimensionality reduction is smaller than the input feature map. Exemplarily, the input of the pooling layer is the feature map output by the convolution layer, with a size of [batch_size, height, width, channels], representing the feature map of a batch of images. The output of the pooling layer is a smaller dimensionality reduction feature map, which is usually performed by taking the maximum value or average value in each local area. Assuming that the size of the pooling kernel is k*k, the stride is s, and the padding is p, the pooling operation converts the input height×width feature map into a smaller height'×width' output feature map.
[0079] In a specific embodiment, the pooling operation can be performed by dividing the task feature data into data channels to perform task allocation. Assuming that the task feature data has C data channels, the pooling operation of each data channel can be assigned to different devices (such as different CPU devices or edge computing devices). Each device is responsible for processing the pooling operation of a data channel, reducing the computational burden of a single device.
[0080] Step S302: Alternatively or / and, when the pooling partitioning strategy of the pooling layer is a data block pooling strategy, determine the number of pooling cores of all pooling cores in the pooling layer, and divide the task feature data into pooling data blocks equal to the number of pooling cores as multiple pooling layer tasks.
[0081] In this embodiment, when the pooling partitioning strategy of the pooling layer adopts the data block pooling strategy, the number of pooling cores of all pooling cores in the pooling layer is determined, and the task feature data is divided into pooling data blocks equal to the number of pooling cores. Each pooling data block is processed as an independent pooling layer task, which not only ensures the parallelism and efficiency of data processing, but also enhances the local sensitivity and robustness of feature extraction, providing richer feature representation for subsequent deep learning tasks.
[0082] In a specific embodiment, the task feature data is divided into multiple pooled data blocks, and each pooled data block can be assigned to different edge devices for pooling operations. Each edge device will process a portion of the task feature data (i.e., the pooled data block), thereby executing the pooling task in parallel, and making full use of the parallel computing capabilities of multiple devices. For example, for a 4*4 task feature data, if a 2*2 pooling kernel is used with a stride of 2, the 4*4 task feature data can be divided into four 2*2 regions, and the pooling operation of each region is processed by a different edge device. Finally, the pooled results are summarized.
[0083] It should be noted that each pooled data block includes a portion of task feature data.
[0084] Step S303: Alternatively or / and, when the pooling division strategy of the pooling layer is a batch pooling strategy, the task feature data is determined to be batch data, and the pooling operation of each batch in the batch data is used as multiple pooling layer tasks.
[0085] In this embodiment, when the pooling division strategy of the pooling layer adopts the batch pooling strategy, after determining that the task feature data exists in batch form (that is, the task feature data is batch data), each batch in the batch data is then regarded as an independent pooling layer task for pooling operation, which greatly improves the data processing throughput and effectively shortens the model training and reasoning time by processing multiple batches of data in parallel. At the same time, the batch pooling strategy also helps the model better learn the batch-level features between data, enhances the model's generalization ability and ability to handle complex data distribution.
[0086] In a specific embodiment, if the task feature data is batch data (batch_size>1), the pooling tasks of different samples can be assigned to different edge devices. Each edge device processes a batch of pooling operations, that is, the batch pooling strategy set in this application is suitable for processing large batches of data. For example, assuming that the batch data has 16 samples, the pooling operation of each sample can be assigned to different edge devices for parallel computing.
[0087] Furthermore, in some feasible embodiments, the task division method further includes the following implementation step A10.
[0088] Step A10: Determine the task dependency of the deep learning model, and construct a task dependency graph based on the task dependency; wherein the task dependency is set to use the task feature data output by the convolution layer as the input data of the pooling layer, and to use the task dimensionality reduction features output by the pooling layer as the input data of the fully connected layer.
[0089] In this embodiment, by clarifying the task dependency relationship between the layers in the deep learning model, that is, setting the task feature data output by the convolution layer directly as the input of the pooling layer, and the task dimension reduction features output by the pooling layer are further used as the input of the fully connected layer, a clear task dependency graph can be constructed, which not only ensures the smooth transmission and efficient processing of artificial intelligence tasks in the deep learning model, but also enhances the learning ability and expression efficiency of the deep learning model for complex data features through hierarchical feature extraction and dimension reduction. In other words, the construction of the task dependency graph makes the structure of the deep learning model clearer, which helps to optimize the performance of the deep learning model and improve the accuracy of task processing.
[0090] It should be noted that the edge representation in the task dependency graph can be understood as edge A→B, that is, task B depends on the output of task A as input, and task B can only be executed after task A is completed.
[0091] Furthermore, in some other feasible embodiments, the task division method also includes the following implementation step B10.
[0092] Step B10: Determine the task priority of the artificial intelligence task according to a preset task scheduling algorithm. When the task priority is higher than the priority of other tasks in the deep learning model, the deep learning model is triggered to divide the artificial intelligence task according to the hierarchical structure. The task scheduling algorithm is:
[0093] P(t)=α*urgency(t)+β*resource_usage(t)+y*dependency_level(t)
[0094] Among them, P(t) refers to the priority of artificial intelligence task t; urgency(t) refers to the urgency of artificial intelligence task t, α refers to the weight of the urgency, resource_usage(t) refers to the resource usage of artificial intelligence task t, β refers to the weight of the resource usage, dependency_level(t) refers to the dependency level of artificial intelligence task t, and y refers to the weight of the dependency level.
[0095] In this embodiment, in the task scheduling of the deep learning model, the execution priority of different artificial intelligence tasks is determined by calculating the task priorities of different artificial intelligence tasks. Specifically, the priority of artificial intelligence task t is the result of the weighted sum of three factors: urgency, resource usage, and dependency level. Each factor contributes differently to the task priority, depending on the values of α, β, and y.
[0096] It should be noted that the degree of influence of each factor on task priority is as follows:
[0097] Urgency(t) represents the urgency of AI task t, and usually measures whether AI task t has a time limit. If AI task t has a strict deadline or time window, the urgency is higher and should be given a higher priority. α is the weight of the urgency, indicating the degree of influence of urgency on the priority of the task. Generally, the larger α is, the greater the proportion of the urgency of AI task t in the final priority.
[0098] resource_usage(t) refers to the resource usage of AI task t, that is, a measure of the computing resources required by AI task t, such as CPU, GPU, or memory. Generally, AI task t with high resource consumption may cause computing bottlenecks and affect the overall efficiency of the system. Therefore, if AI task t has a large resource usage, it may need to be given a higher priority to ensure that system resources are not occupied by low-priority tasks for a long time. β is the weight of resource usage, indicating the degree of impact of resource consumption on priority. If β is large, the resource consumption of AI task t has a greater impact on scheduling priority.
[0099] Urgency(t) refers to the dependency relationship between AI task t and other tasks. A task depends on the output of other tasks, so it needs to wait until the predecessor task is completed before it can start executing. If the dependency relationship of a task is complex and there are many dependent tasks, its dependency level is higher. This kind of AI task t may affect the execution of other tasks, so it needs to be adjusted in time. y is the weight of the dependency level, which indicates the degree of influence of the task dependency on its priority. If y is large, the dependency of AI task t has a greater impact on the final priority, and tasks with strong dependencies may be executed first to reduce waiting time.
[0100] In a specific embodiment, assume that there are three tasks t1, t2, and t3, and the urgency, resource consumption, and dependency of each task are as follows: Task t1 has high urgency, low resource consumption, and simple dependency; Task t2 has medium urgency, medium resource consumption, and more dependent tasks; Task t3 has low urgency, high resource consumption, and few dependent tasks. Assume that α=3, that is, urgency is the main factor; β=1, that is, resource usage has a greater impact on scheduling; y=1, that is, the dependency level has a relatively small impact on scheduling. Then, the priority of the three tasks t1, t2, and t3 is calculated as follows:
[0101] P(t1)=α*urgency(t1)+β*resource_usage(t1)+y*dependency_level(t1)
[0102] P(t2)=α*urgency(t2)+β*resource_usage(t2)+y*dependency_level(t2)
[0103] P(t3)=α*urgency(t3)+β*resource_usage(t3)+y*dependency_level(t3)
[0104] If task t1 has the highest urgency, task t2 has medium resource usage and complex dependencies, and task t3 has low urgency but high resource consumption, then the system will decide the execution order of the tasks based on these priorities: execute task t1 first, then task t2, and finally task t3.
[0105] Furthermore, in some feasible embodiments, the task division method further includes the following implementation steps C10 to C20.
[0106] Step C10: determining dependent tasks of the deep learning model, and determining the task processing layer where the dependent tasks are located;
[0107] Step C20: Delay compensation is performed on the device communication delay between the task processing layer and the task processing layer above the task processing layer according to a preset delay compensation mechanism.
[0108] In this embodiment, by executing steps C10 to C20, the dependent tasks of the deep learning model and the task processing layer in which they are located can be accurately identified, and based on the preset delay compensation mechanism, the device communication delay between the task processing layer and the layer above it can be effectively reduced, thereby improving the overall operating efficiency and performance of the deep learning model.
[0109] It should be noted that the preset delay compensation mechanism is as shown in the following formula:
[0110] EST(ti)=max(tj∈Predecessors(ti))(LFT(tj)+Comm_delay(tj,ti))
[0111] Among them, EST(ti) represents the earliest start time (Earliest StartTime) of task ti (i.e., dependent task), that is, the earliest time point when task ti starts to execute, which is affected by the completion time of its predecessor task. In other words, the start time of task ti cannot be earlier than the completion time of its predecessor task tj;
[0112] Predecessors(ti) represents all predecessor tasks tj of task ti. These predecessor tasks tj are tasks that must be completed before task ti starts, that is, the input dependent tasks of task ti; LFT(tj) represents the latest finish time (Latest Finish Time) of predecessor task tj, that is, the latest time that predecessor task tj can be completed, which is usually related to the start time of subsequent task ti and the time limit of the task; Comm_delay(tj,ti) represents the communication delay from task tj to task ti, that is, the time required to pass the result to task ti after task tj is executed, which may be affected by factors such as network bandwidth and data transmission rate between devices.
[0113] The max in the formula max(tj∈Predecessors(ti)) means selecting a maximum value (i.e., the task tj that is completed latest) from all predecessor tasks tj. In other words, the start time of task ti is not only affected by a single predecessor task tj, but also takes into account the task tj that is completed latest among all predecessor tasks tj. For example, if task ti depends on multiple tasks tj (i.e., a set of predecessor tasks), then task ti must wait until all tasks tj in the set of predecessor tasks are completed, and after taking into account the communication delay of each task tj, task ti can be started. That is, the earliest start time of task ti depends on the latest completed task among the predecessor tasks and its transmission delay.
[0114] Exemplarily, assume that there is a dependency relationship between Task A, Task B and Task C as follows: Task C depends on Task A and Task B (i.e., Task A and Task B are the predecessor tasks of Task C); the latest completion time of Task A is LFT(A)=10. The latest completion time of Task B is LFT(B)=8; the communication delay from Task A to Task C Comm_delay(A,C)=2; the communication delay from Task B to Task C Comm_delay(B,C)=1; according to the preset delay compensation mechanism, it can be determined that the earliest start time of Task C EST(C) should be: EST(C)=max(LFT(A)+Commgelay(A,C), LFT(B)+Commgelay(B,C)), after substituting specific values, it can be determined that EST(C)=max(10+2,8+1)=max(12,9)=12, therefore, the earliest start time of Task C is 12.
[0115] In summary, the preset delay compensation mechanism calculates the earliest start time (EST) of the AI task in the parallel computing task scheduling, which is determined by the latest completion time (LFT) of the predecessor task and the communication delay (Comm_delay) between tasks. This calculation ensures that tasks are executed in sequence and can be reasonably scheduled in a multi-device or multi-process environment to avoid wasted execution time due to communication delays or resource competition.
[0116] In summary, the present invention proposes a task division method, device, electronic device, storage medium and computer product, which realizes the reasonable division and efficient scheduling of AI tasks in a multi-device environment for the multi-level structure of the deep learning model. Specifically, the hierarchical structure of the deep learning model is first obtained, and the hierarchical structure at least includes a convolution layer, a pooling layer and a fully connected layer. Subsequently, according to the convolution division strategy of the convolution layer and the artificial intelligence task of the deep learning model, multiple convolution layer tasks are assigned to different processing devices for feature extraction, thereby obtaining task feature data output to the pooling layer. Next, the task feature data is further divided into multiple pooling layer tasks according to the pooling division strategy of the pooling layer, and assigned to the corresponding edge devices for feature dimensionality reduction processing, and the task dimensionality reduction features output to the fully connected layer are obtained. Finally, the task dimensionality reduction features are divided into multiple matrix operation subtasks according to the fully connected division strategy of the fully connected layer, and the fully connected operation is efficiently performed with the help of the parallel computing power of multiple computing devices, so as to quickly obtain the final output result of the artificial intelligence task. In other words, the task division method set up in this application fully utilizes the advantages of the hierarchical structure and multi-device environment of the deep learning model to achieve balanced utilization of computing resources, improve system performance and task completion, especially when processing large-scale tasks, and can significantly shorten the task completion time.
[0117] In addition, this application also provides a task division device, please refer to Figure 3 , Figure 3 Schematic diagram of the structure of the task division device involved in the embodiment of the present application. The task division device provided in the present application includes:
[0118] An acquisition module H01 is used to acquire a hierarchical structure of a deep learning model, wherein the hierarchical structure includes at least a convolutional layer, a pooling layer, and a fully connected layer;
[0119] A convolution partitioning module H02 is used to determine a plurality of convolution layer tasks according to the convolution partitioning strategy of the convolution layer and the artificial intelligence tasks of the deep learning model, and to perform feature extraction according to the processing device corresponding to each of the convolution layer tasks to obtain task feature data output to the pooling layer;
[0120] The pooling partitioning module H03 is used to divide the task feature data into multiple pooling layer tasks according to the pooling partitioning strategy of the pooling layer, and perform feature extraction according to the edge device corresponding to each of the pooling layer tasks to obtain the task dimension reduction features output to the fully connected layer;
[0121] The fully connected partitioning module H04 is used to divide the dimension reduction features of the task into matrix operation subtasks according to the fully connected partitioning strategy of the fully connected layer, and perform fully connected operations in parallel according to the computing devices corresponding to each matrix operation subtask.
[0122] In addition, the present application also provides a task division device. Figure 4 , Figure 4 The structure diagram of the task division device involved in the embodiment of the present application is shown in FIG. The device in the embodiment of the present application may be a device for locally running the task division method.
[0123] The present application provides a task division device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the task division device method in the above-mentioned embodiment one.
[0124] Reference below Figure 4 , which shows a schematic diagram of the structure of a task division device suitable for implementing the embodiment of the present application. The task division device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The task division device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0125] like Figure 4As shown, the task division device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the task division device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following devices can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the task division device to communicate wirelessly or wired with other devices to exchange data. Although the task division device with various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices can be implemented or have alternatively.
[0126] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0127] The task division device provided by the present application adopts the task division device method in the above embodiment, which can solve the technical problem of low reliability of the task division device. Compared with the prior art, the beneficial effects of the task division device provided by the present application are the same as the beneficial effects of the task division device method provided by the above embodiment, and other technical features in the task division device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0128] In addition, refer to Figure 5 , Figure 5This is a schematic diagram of a memory structure involved in an embodiment of the present application. The present application provides a computer-readable storage medium. The computer-readable storage medium stores a task division program, and when the task division program is executed by a processor, the steps of the above-mentioned task division method are implemented.
[0129] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0130] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0131] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0132] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A task division method, characterized in that: The task division method comprises: Obtain a hierarchical structure of a deep learning model, wherein the hierarchical structure includes at least a convolutional layer, a pooling layer, and a fully connected layer; Determine a plurality of convolutional layer tasks according to the convolutional division strategy of the convolutional layer and the artificial intelligence tasks of the deep learning model, and perform feature extraction according to the processing device corresponding to each of the convolutional layer tasks to obtain task feature data output to the pooling layer; Dividing the task feature data into a plurality of pooling layer tasks according to the pooling partitioning strategy of the pooling layer, and performing feature extraction according to the edge devices corresponding to each of the pooling layer tasks to obtain the task dimension reduction features output to the fully connected layer; The task dimension reduction features are divided into matrix operation subtasks according to the fully connected partitioning strategy of the fully connected layer, and the fully connected operations are performed in parallel according to the computing devices corresponding to each matrix operation subtask.
2. The task division method according to claim 1, characterized in that: The step of determining a plurality of convolutional layer tasks according to the convolutional partitioning strategy of the convolutional layer and the artificial intelligence tasks of the deep learning model comprises: When the convolution partitioning strategy of the convolution layer is a feature map partitioning strategy, a plurality of convolution kernels corresponding to the convolution layer are determined, a convolution calculation operation is performed on the artificial intelligence task of the deep learning model according to each of the convolution kernels, and the feature maps calculated by each of the convolution kernels are used as a plurality of convolution layer tasks; or / and, When the convolution partitioning strategy of the convolution layer is a convolution kernel partitioning strategy, the convolution computing tasks corresponding to each of the convolution kernels are used as multiple convolution layer tasks, and the convolution computing tasks are tasks in which the convolution kernel performs convolution computing operations on the artificial intelligence tasks; or / and, When the convolution partitioning strategy of the convolution layer is a data block partitioning strategy, the number of convolution kernels of all the convolution kernels in the convolution layer is determined, and the artificial intelligence task is divided into task data blocks equal to the number of convolution kernels as multiple convolution layer tasks.
3. The task division method according to claim 1, characterized in that: The step of dividing the task feature data into a plurality of pooling layer tasks according to the pooling division strategy of the pooling layer comprises: When the pooling division strategy of the pooling layer is a feature map pooling strategy, a plurality of data channels corresponding to the task feature data are determined, and a pooling operation corresponding to each of the data channels is used as a plurality of pooling layer tasks; or / and, When the pooling partitioning strategy of the pooling layer is a data block pooling strategy, determining the number of pooling cores of all pooling cores in the pooling layer, and dividing the task feature data into pooling data blocks equal to the number of pooling cores as a plurality of pooling layer tasks; or / and, When the pooling division strategy of the pooling layer is a batch pooling strategy, the task feature data is determined to be batch data, and the pooling operation of each batch in the batch data is used as multiple pooling layer tasks.
4. The task division method according to claim 1, characterized in that: The task division method comprises: Determine the task dependencies of the deep learning model and construct a task dependency graph based on the task dependencies; wherein the task dependencies are set to use the task feature data output by the convolutional layer as the input data of the pooling layer, and use the task dimensionality reduction features output by the pooling layer as the input data of the fully connected layer.
5. The task division method according to claim 1, characterized in that: The task division method comprises: The task priority of the artificial intelligence task is determined according to a preset task scheduling algorithm. When the task priority is higher than the priority of other tasks in the deep learning model, the deep learning model is triggered to divide the artificial intelligence task according to the hierarchical structure. The task scheduling algorithm is: P(t)=α*urgency(t)+β*resource_usage(t)+y*dependency_level(t) Among them, P(t) refers to the priority of artificial intelligence task t; urgency(t) refers to the urgency of artificial intelligence task t, resource_usage(t) refers to the resource usage of artificial intelligence task t, and dependency_level(t) refers to the dependency level of artificial intelligence task t.
6. The task division method according to claim 1, characterized in that: The task division method comprises: Determine the dependent tasks of the deep learning model, and determine the task processing layer where the dependent tasks are located; Delay compensation is performed on the device communication delay between the task processing layer and the task processing layer above the task processing layer according to a preset delay compensation mechanism.
7. A task division device, characterized in that: The task division device comprises: An acquisition module, used to acquire a hierarchical structure of a deep learning model, wherein the hierarchical structure includes at least a convolutional layer, a pooling layer, and a fully connected layer; A convolution partitioning module, used to determine a plurality of convolution layer tasks according to the convolution partitioning strategy of the convolution layer and the artificial intelligence tasks of the deep learning model, and perform feature extraction according to the processing device corresponding to each of the convolution layer tasks to obtain task feature data output to the pooling layer; A pooling partitioning module is used to divide the task feature data into multiple pooling layer tasks according to the pooling partitioning strategy of the pooling layer, and perform feature extraction according to the edge devices corresponding to each of the pooling layer tasks to obtain the task dimension reduction features output to the fully connected layer; The fully connected partitioning module is used to divide the dimension reduction features of the task into matrix operation subtasks according to the fully connected partitioning strategy of the fully connected layer, and perform fully connected operations in parallel according to the computing devices corresponding to each matrix operation subtask.
8. A task division device, characterized in that: The task division device includes a memory, a processor, and a task division program stored in the memory and executable on the processor. When the processor executes the task division program, the steps of the task division method according to any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a task division program, and when the task division program is executed by the processor, the steps of the task division method according to any one of claims 1 to 7 are implemented.
10. A computer product, characterized in that: The computer product comprises a computer program, which contains computer program code means stored on a computer-readable medium or carrier wave, and the computer program code means is configured to implement the steps of the task division method according to any one of claims 1 to 6 when executed by a computer or a processor.
Citation Information
Cited By
CNN inference task time slice segmentation method and system based on divisible tuple
CN121542057A