Control method and device of multi-level computing model and readable storage medium
By allocating computation groups to the computation layers of a multi-level computation model for parallel computation, the problem of parallel computation of multiple computation streams is solved, improving computational efficiency and hardware resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN DEEPROUTE AI CO LTD
- Filing Date
- 2022-04-22
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, it is difficult to implement multi-computation stream parallel operations in multi-level computing models, making it difficult to effectively utilize hardware resources to improve execution efficiency.
By obtaining the data input/output relationships between the computational layers of the hierarchical computational model, a computational group is assigned to each computational layer, and computational resources are allocated and the running order is determined according to the data input/output relationships between the computational groups, thereby controlling the parallel computation of each computational group.
It achieves efficient parallel computing at the computing layer, reducing computation time and improving hardware resource utilization and execution efficiency.
Smart Images

Figure CN115186793B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of high-performance computing, and in particular to control methods, devices, and readable storage media for multi-level computing models. Background Technology
[0002] Inference engines play a crucial role in accelerating inference speed in deep learning. A well-designed inference engine can achieve advantages such as high performance and low power consumption during deployment. There are many techniques for optimizing deep learning models within the inference engine.
[0003] In general, during the inference process of deep learning, most algorithms perform top-down inference calculations according to model dependencies. For example... Figure 1 The topology shown represents a small deep learning model. Because the input values for operation layers OP1 and OP3 require the computation result of OP0, OP1 and OP3 need to be computed after OP0. Similarly, based on the dependencies between other operation layers, the inference framework generally provides a running order in which all operation layers are executed one by one. This order can be obtained through "topological sorting". Figure 1 The actual running sequence of the model shown may be, but is not limited to, as follows: Figure 2 The order is shown.
[0004] In practice, deep learning model computation and inference are deployed across different hardware platforms. For example, most deep learning inference processes are deployed on different GPGPU computing platforms such as NVIDIA, AMD, and Intel. Because these platforms have varying amounts of computing resources, their performance also differs. Therefore, the execution strategies for deep learning model operators will vary during runtime. When hardware computing resources far exceed the demands of the current operational layer, multiple computational streams can be run simultaneously on the hardware to improve resource utilization and further reduce execution time. A computational stream is defined as a program that modern GPGPU hardware allows to support the parallel execution of multiple unrelated computational programs. Each program can simultaneously occupy a portion of the hardware resources, and each program has its own independent start and end timeline. This aims to fully utilize hardware resources and achieve higher execution efficiency.
[0005] Figure 1After OP0 runs, we hope that the OP1->OP2 and OP3->OP4 computational flows can run simultaneously on the hardware. However, in practical applications, considering that deep learning models can be very large and have many complex dependencies, we need to determine under what circumstances multiple computational flows can run concurrently, and under what circumstances they cannot. How can we ensure that subsequent operation layers can begin execution as soon as the computations dependent on multiple operation layers are completed? These are the problems we need to solve. Summary of the Invention
[0006] This application provides a control method, device, and readable storage medium for a multi-level computing model, which solves the problem of difficulty in implementing parallel operation of multiple computing streams in the prior art for multi-level computing models.
[0007] To address the aforementioned technical problems, the first aspect of this application provides a control method for a multi-level computing model, comprising: acquiring a multi-level computing model to be processed, the multi-level computing model including at least two computing layers, each computing layer having a data input / output relationship with at least one computing layer; allocating a corresponding computing group to each computing layer according to the data input / output relationship between the computing layers; wherein there are at least two parallel computing groups, each parallel computing group having a data input / output relationship with the same computing layer, and at least one computing group including at least two computing layers; allocating computing resources to each computing group; and performing inference operations on the multi-level computing model according to the data input / output relationship between the computing groups and the allocated computing resources.
[0008] To address the aforementioned technical problems, a second aspect of this application provides a multi-level computational model control device, the device comprising a processor and a memory coupled to each other; the memory stores a computer program, and the processor executes the computer program to implement the multi-level computational model control method as provided in the first aspect above.
[0009] To address the aforementioned technical problems, a third aspect of this application provides a computer-readable storage medium storing program data, which, when executed by a processor, implements the control method for the multi-level computing model provided in the first aspect.
[0010] The beneficial effects of this application are as follows: Unlike existing technologies, this application first obtains a hierarchical computing model to be processed. This model includes multiple computing layers, each with a data input / output relationship with at least one other computing layer. Then, based on the data input / output relationships between computing layers, a corresponding computing group is assigned to each computing layer. At least two parallel computing groups exist, each with a data input / output relationship with the same computing layer. Next, computational resources are allocated to each computing group based on the data input / output relationships, and the running order of each computing group is determined. Finally, based on the running order and allocated computational resources, each computing group is controlled to perform computations, wherein the at least two parallel computing groups perform parallel computations at least for a portion of the time. This method utilizes the dependencies between computing layers to group them, allocating corresponding computational resources to each group. For computing groups capable of parallel computation, each can have its own independent start and end timelines, significantly saving computation time and improving execution efficiency. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a schematic diagram of the topology of an embodiment of the hierarchical computing model of this application;
[0013] Figure 2 This application Figure 1 A schematic diagram of the operational order topology of an embodiment of the hierarchical computing model shown;
[0014] Figure 3 This is a flowchart illustrating an embodiment of the control method for a multi-level computational model of this application.
[0015] Figure 4 This is a schematic diagram of the topology of each computational layer of the neural network model in this application;
[0016] Figure 5 This is a flowchart illustrating an embodiment of step S12 of this application;
[0017] Figure 6 This application Figure 1 The diagram shows the first operation order of the hierarchical calculation model.
[0018] Figure 7 This application Figure 1 The diagram shows the second operation order in the hierarchical calculation model.
[0019] Figure 8 This application Figure 1 The diagram shows the third operation order in the hierarchical calculation model.
[0020] Figure 9 This is a schematic flowchart of an embodiment of the present application for allocating computing groups to each computing layer;
[0021] Figure 10 This is a schematic block diagram of the structure of an embodiment of the multi-level computational model control device of this application;
[0022] Figure 11 This is a schematic block diagram of another embodiment of the multi-level computational model control device of this application;
[0023] Figure 12 This is a schematic block diagram of an embodiment of a computer-readable storage medium of this application. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0025] The terms "first" and "second" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0026] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0027] The control method for the multi-level computing model provided in this application can be applied to computing models with multiple computing levels, such as deep learning models. The deep learning model is, for example, at least one of image processing models, speech recognition models, and road condition analysis models. For example, it can be deployed on an autonomous vehicle system platform to intelligently identify the surrounding environment of the driving road.
[0028] Please see Figure 3 , Figure 3 This is a schematic flowchart illustrating an embodiment of the control method for the multi-level computational model of this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily use the same method. Figure 3 The illustrated process sequence is limited. This embodiment includes the following steps:
[0029] Step S11: Obtain the hierarchical computation model to be controlled.
[0030] The hierarchical computation model comprises multiple computation layers, each of which has a data input / output relationship with at least one other computation layer. Understandably, "multiple" in this paper refers to two or more.
[0031] The data input / output relationship between computation layers can be simply described as a dependency relationship. For example, please see... Figure 1 In the hierarchical computation model shown, the input values of computation layers OP1 and OP3 depend on the computation results of computation layer OP0, meaning OP1 and OP3 depend on OP0. Similarly, the input values of computation layer OP2 depend on the computation results of OP1. Therefore, if OP1 is taken as the current layer, it has a data input relationship with OP0 and a data output relationship with OP2. Here, an input layer is a computation layer that inputs its own computation results to other computation layers, and an output layer is a computation layer that receives computation results from other computation layers. Specifically, a layer with a data input relationship to a given computation layer is called an input layer, and a layer with a data output relationship to that computation layer is called an output layer.
[0032] The hierarchical computation model used in this paper is a neural network model, such as a convolutional neural network, deconvolutional neural network, or recurrent neural network. A neural network model generally includes an input layer, hidden layers, and an output layer. Understanding this, each layer in a neural network model is treated as a separate computational layer. For example, please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a topological diagram of an embodiment of the neural network model of this application. The model includes an input layer, an output layer and three hidden layers. If the input layer, the output layer and each hidden layer are treated as separate computational layers, then the neural network model includes five computational layers.
[0033] Taking convolutional neural networks (CNNs) as an example, CNNs are commonly used for image recognition. Their characteristic feature is that the hidden layers consist of convolutional layers, pooling layers (also called downsampling layers), and activation layers. Each layer's function is to achieve classification. For convolutional layers, each layer in a CNN consists of several convolutional units (kernels), and the parameters of each convolutional unit are optimized using the backpropagation algorithm.
[0034] Hierarchical computational models can also be combinations of various types of neural network models. Understandably, many emerging deep neural networks have been proposed and applied to various topics. Due to differences in application areas, desired outcomes, and the increasing complexity of the problems to be solved, combining multiple neural network models of the same or different types into a complex hierarchical computational model to solve problems has become very common. For example, in some video processing techniques, feature extraction is performed separately on image and audio data in a video to obtain audio and image features. These features are then fused, and sentiment prediction is performed based on the fused features. In this approach, typically, corresponding encoders are used to extract speech and image features separately, a fusion network is used to fuse the speech and image features to obtain fused features, and a decoding network is used to decode the fused features to obtain the sentiment prediction result. Based on the different feature processing requirements of each sub-network, the encoders for image and audio feature extraction can be composed of 3D residual networks and long short-term memory networks, respectively. The first layer of each encoder is connected to the input layer, and the last layer of each encoder is connected to the first layer of the fusion network. The fusion network may include fully connected layers, and the last layer of the fusion network is connected to the first layer of the decoding network, thus forming a complex hierarchical computation model. For this type of hierarchical computation model, each hidden layer can still be used as a separate computation layer, and the hierarchical structure of the hierarchical computation model can be derived based on the data input / output relationships between the computation layers.
[0035] In some embodiments, the hierarchical computing model is, for example, an image processing model, used to recognize images of the surrounding environment to obtain information such as road conditions, vehicles, and crowds. Subsequently, dangerous actions can be identified based on the image recognition results, and emergency braking or deceleration can be automatically performed. In other embodiments, the hierarchical computing model can also be, for example, a speech recognition or dialogue model. Specifically, it can recognize received speech information and issue a voice reply message based on the recognition result, or issue control commands based on the recognition result to control the operation of vehicle components.
[0036] Step S12: Assign each computing layer to the corresponding computing group according to the data input / output relationship between computing layers.
[0037] by Figure 1 Taking the hierarchical computing structure shown as an example, if the hardware computing resources are sufficient, if this application Figure 1 The topology shown is a complete hierarchical computing model. For this hierarchical computing model, after the OP0 computing layer, both the "OP1->OP2 line" and the "OP3->OP4 line" depend on the output of the OP0 computing layer. The two computing streams, "OP1->OP2 line" and "OP3->OP4 line", have the objective conditions to run simultaneously. Different computing resources can be allocated to them, and the two computing streams can run at the same time.
[0038] In this way, if according to Figure 2 The topology shown runs each computation layer in sequence. If each computation layer requires time t, the total running time of the model is 6t. However, if the "OP1->OP2 line" and "OP3->OP4 line" are divided into two computation groups, and the hardware resources are sufficient to support the parallel operation of the two computation groups, the running time of the model can be shortened to 4t, which greatly saves the computation time of the hierarchical computation model.
[0039] However, in general, the dependencies between the computational layers of a deep learning model are intricate. In more complex cases, other embodiments are provided below to assign computational groups to each computational layer.
[0040] In this hierarchical computing model, there are at least two parallel computing groups, and each parallel computing group has a data input / output relationship with the same computing layer. Specifically, after the computing group performs the operation, it obtains corresponding output data, and the output data of the parallel computing group is output to the same computing layer. Alternatively, there is a computing layer whose output data is output to multiple parallel computing groups.
[0041] Step S13: Allocate computing resources to each computing group according to the data input / output relationship between each computing group, and determine the running order of each computing group.
[0042] This step obtains the computing resources of the computing platform, such as computer equipment used for automatic calculation of hierarchical computing models. The computer equipment can be an independent computing device, such as an in-vehicle computer device. The computing platform has corresponding computing resources, and this step can allocate corresponding computing resources to each computing group according to the preset conditions of the computing group.
[0043] Before each computing group performs its operation, it is determined whether there are computing groups that can operate in parallel with it. If such computing groups exist, the available computing resources are allocated appropriately among the parallel computing groups. For example, if at least two computing groups receive data from the same computing group or computing layer, these at least two computing groups are identified as parallel computing groups.
[0044] Understandably, before this step, the computational resources required by each computing group are analyzed. If the computing units and memory usage of a computing group exceed a preset ratio, the hardware resources are considered insufficient to support multi-stream computation, and no computational resources are allocated to each computing group. If the computing units and memory usage of a computing group do not exceed the preset ratio, it indicates that the hardware resources can support multi-stream computation, and computational resources are allocated to each computing group. For example, by analyzing the resources required by each computing group, if the computing units and memory usage of a computing group is as high as 70% or more, the platform's computational resources are insufficient to support multi-stream computation, and computational resources cannot be allocated to each computing group separately; only single-stream computation can be performed. However, if the computing units and memory usage of a computing group is only 20%, 10%, or lower, it indicates that the hardware resources can support the parallel computation of that computing group with other computing layers with lower computing unit and memory usage, and multi-stream computation can be achieved.
[0045] Understandably, if at least one parallel computing group comprises at least two computing layers, then the resources required by this computing group are allocated based on the computational workload of the layer with the largest computational load. Specifically, if a computing group has three computing layers, and the first and second computing layers each occupy 60% of the computing units and memory, while the third computing layer occupies 80% of the computing units and memory, then the resources required by the computing group are based on the data from the third computing layer.
[0046] For example, Nvidia GPUs offer an nsight compute tool that can visualize the memory and computing power consumption of hardware resources by the computing layer, making it easier to allocate computing resources based on the resource usage of each computing layer in the hierarchical computing model.
[0047] Similar to how the order of operations is determined in the computing layer, the order of operations in computing groups can also be determined based on the data dependencies between computing groups. Specifically, for parallel computing groups, if the computing resources allow multiple parallel computing groups to operate in parallel, then the parallel computing groups are given the same priority in terms of operation order. If multiple parallel computing groups are not allowed to operate in parallel, then the parallel computing groups are not set to the same priority.
[0048] Step S14: Control each computing group to perform calculations according to the order of calculations among the computing groups and the allocated computing resources.
[0049] Among them, at least two parallel computing groups perform parallel operations at least for a portion of the time.
[0050] Each computation group includes a signaler, which receives the end signal from the previous computation group and / or, after all computation layers in the corresponding computation group have completed their operations, sends an end signal to the next computation group. Specifically, for computation layers with no data input, the signaler sends an end signal; for end layers, which have no output layers after them, the signaler receives end signals; for intermediate layers, which have both input and output layers, the signaler receives end signals from input layers and also sends an end signal when the current layer has completed its operations.
[0051] One implementation method is to assign a semaphore to each computing group. The initial value of the semaphore can be set to 0. The semaphore has two functions: setting the signal and waiting for the signal.
[0052] The specific explanations of the signal setting function and the signal waiting function are as follows:
[0053] 1. Set signal function: If all calculation layers in the current calculation group have finished calculating, set the signal of the current calculation group to 1.
[0054] 2. Waiting for signals: Each computation group can wait for signals from other computation groups. If a computation group G0 is waiting for the semaphore value of G1 to be 0, then G0 will not execute any computation layer until the semaphore value of G1 is set to 1, at which point G0 will begin executing the computation layer within its own group.
[0055] In one embodiment, when the current computing group receives the end signals from all dependent groups, the current computing group receives data input from the dependent groups and begins the computing process for the current computing group; wherein, the dependent groups are computing groups that have a data input relationship with the current computing group. After the current computing group completes its calculations, its signal generator issues an end signal.
[0056] Thus, this embodiment groups the computational layers of the hierarchical computational model and allocates different computational resources to different computational groups. When multiple parallel computational groups have the conditions to operate simultaneously, they can use their respective computational resources to perform multi-computational stream operations, saving inference computation time.
[0057] Please see Figure 5 , Figure 5 This is a schematic flowchart of an embodiment of step S12 of this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow that approach. Figure 5 The illustrated process sequence is limited. This embodiment includes the following steps:
[0058] S121: Sort the computing layers according to the data flow between them.
[0059] This step requires determining the execution order of each computational layer in the hierarchical computation model under a single computational flow. This can be achieved by using an inference engine to analyze the dependencies between computational layers, determine the data input / output relationships between them, and thus determine the data flow direction. In this case, the execution order of the computational layers can be determined using methods including, but not limited to, topological sorting. Figure 1 Taking the hierarchical computing model shown as an example, one way to operate this hierarchical computing model is, but not limited to, [the following]. Figure 6-8 You can choose any one of the three running sequences shown as the running sequence for this level of calculation model.
[0060] S122: According to the sorting results, each computational layer is taken as the current computational layer in turn.
[0061] In one embodiment, with Figure 6 The running order shown is based on the sorting results. OP0, OP1, OP2, OP3, OP4, and OP5 can be used as the current computing layers in sequence. The dependencies between each current computing layer and other computing layers can be resolved to allocate computing groups to each computing layer.
[0062] S123: Based on the data input / output relationship between the current computing layer and other computing layers, assign the current computing layer to the corresponding computing group.
[0063] This step divides the computational layers L1, L2, ..., Lm into several computational groups G1, G2, ..., Gn. One of the computational groups can be represented as: Gx = {Ly1, Ly2, Ly3, ..., Lyz}, 1 <= x <= n, 1 <= y1, y2, ..., yz <= m, 1 <= z <= m.
[0064] The computing group referred to in this application is a collection of several computing layers.
[0065] Please see Figure 9 , Figure 9 This is a schematic flowchart illustrating an embodiment of allocating computing groups to each computing layer according to this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily use the same method. Figure 9 The illustrated process sequence is limited. Computation groups can be assigned to each computation layer according to the following steps:
[0066] S31: Determine whether the current computation layer is a constant layer.
[0067] A constant layer refers to a computational layer that is constant, or where all inputs to the current computational layer are constant. In this case, the computational layer will also be considered constant and will not require any computation.
[0068] If this step determines that the current calculation layer is a constant layer, then proceed to step S32 and set the next calculation layer as the current calculation layer.
[0069] If it is determined that the current computation layer is not a constant layer, proceed to step S33.
[0070] S32: If the current computation layer is not the last computation layer, the next computation layer is the current computation layer.
[0071] Based on the sorting results, the next computational layer is selected as the current computational layer, and step S31 is executed. Further details are omitted here.
[0072] S33: Determine whether an input layer exists in the current computation layer.
[0073] The input layer is the computation layer that inputs the calculation results into the current computation layer.
[0074] If this step determines that the current computation layer does not have an input layer, proceed to step S34; if this step determines that the current computation layer does have an input layer, proceed to step S35.
[0075] S34: Create a new computing group for the current computing layer and assign the current computing layer to the newly created computing group.
[0076] If the current computing layer does not have an input layer, it means that there is no data input from other computing layers. In this case, a new computing group is created for the current computing layer, and the current computing layer is assigned to the new computing group.
[0077] S35: Determine whether each input layer corresponding to the current computation layer uses the current computation layer as the output layer only.
[0078] The output layer is the computation layer that receives the computation results of the current computation layer.
[0079] If yes, then proceed to step S36; otherwise, that is, if there is an input layer in the current computation layer that is not based on the current computation layer, then proceed to step S34.
[0080] S36: Determine whether each input layer corresponding to the current computation layer is in the same computation group.
[0081] If yes, proceed to step S37; otherwise, proceed to step S34.
[0082] S37: Assign the current computation layer to the computation group where the input layer is located.
[0083] If the current computation layer corresponds to one or more input layers, and the corresponding input layers all output data to the current computation layer, and the corresponding input layers are all in the same computation group, it indicates that the dependency relationship between the current computation layer and the computation group where the corresponding input layer is located is relatively simple. The current computation layer can be assigned to the computation group where the input layer is located and perform operations as the same computation flow.
[0084] The above embodiments determine the dependencies between each computing layer one by one, and classify each computing layer into the corresponding computing group according to the corresponding dependencies. This ensures the simplicity of data dependencies within each computing group as much as possible, reduces the complexity of data input / output within a single computing group, and improves computing efficiency.
[0085] Unlike existing technologies, this embodiment optimizes the grouping of computational layers based on the data transmission paths between them, allowing at least two computational layers to be included in the same group. Compared to using a single computational layer as a unit, subsequent resource allocation and control scheduling are simplified. The hierarchical computational model can achieve parallel computation to the greatest extent possible based on the grouping of computational groups, reducing memory consumption and improving computation speed. Furthermore, the process is fully automated, reducing the development burden on the user end.
[0086] Please see Figure 10 , Figure 10This is a schematic block diagram of an embodiment of the multi-level computing model control device of this application. The multi-level computing model control device 100 of this application includes: an acquisition module 110, a grouping module 120, a resource allocation module 130, and an inference operation module 140. The acquisition module 110 is used to acquire the hierarchical computing model to be controlled. The hierarchical computing model includes multiple computing layers, and each computing layer has a data input / output relationship with at least one other computing layer. The grouping module 120 is used to allocate each computing layer to a corresponding computing group according to the data input / output relationship between the computing layers. At least two parallel computing groups exist, and at least two parallel computing groups have a data input / output relationship with the same computing layer. The resource allocation module 130 is used to allocate computing resources to each computing group according to the data input / output relationship between the computing groups and determine the running order of each computing group. The inference operation module 140 is used to control each computing group to perform operations according to the running order of each computing group and the allocated computing resources, wherein at least two parallel computing groups perform parallel operations at least for a portion of the time.
[0087] The multi-level computing model control device 100 may further include a sorting module (not shown in the figure), which is used to sort each computing layer according to the order of operation of the computing layers; the grouping module 120 is also used to sequentially take each computing layer as the current computing layer according to the sorting result; and to assign a corresponding computing group to the current computing layer according to the data input / output relationship between the current computing layer and other computing layers.
[0088] For details regarding the specific steps of each processing module's execution, please refer to the description of each step in the above embodiment of the control method for the multi-level computing model of this application; further details will not be repeated here.
[0089] Please see Figure 11 , Figure 11 This is a schematic block diagram of another embodiment of the multi-level computational model control device of this application. The multi-level computational model control device 200 of this application includes a processor 210 and a memory 220 coupled to each other. The memory 220 stores a computer program, and the processor 210 is used to execute the computer program to implement the control method of the multi-level computational model described in the above embodiments.
[0090] For a description of each step of the processing execution, please refer to the description of each step in the above embodiment of the control method for the multi-level computing model of this application, and it will not be repeated here.
[0091] The memory 220 can be used to store program data and modules. The processor 210 executes various functional applications and data processing by running the program data and modules stored in the memory 220. The memory 220 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created according to the use of the multi-level computing model control device 200, etc. In addition, the memory 220 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 220 may also include a memory controller to provide the processor 210 with access to the memory 220.
[0092] In the various embodiments of this application, the disclosed methods and apparatus can be implemented in other ways. For example, the embodiments of the multi-level computational model control device 200 described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be indirect couplings or communication connections between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0093] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0094] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0095] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium.
[0096] See Figure 12 , Figure 12 This is a schematic block diagram of a computer-readable storage medium according to an embodiment of the present application. The computer-readable storage medium 300 stores program data 310. When the program data 310 is executed, it implements the steps of the control method of the multi-level computing model described above.
[0097] For a description of each step of the processing execution, please refer to the description of each step in the above embodiment of the control method for the multi-level computing model of this application, and it will not be repeated here.
[0098] The computer-readable storage medium 300 can be any medium capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0099] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A control method for a multi-level computational model, characterized in that, include: Obtain a hierarchical computing model to be controlled, the hierarchical computing model including multiple computing layers, each computing layer having a data input / output relationship with at least one other computing layer; The computing layers are sorted according to the data flow between them; According to the sorting results, each of the aforementioned computational layers is taken as the current computational layer in turn; Based on the data input / output relationship between the current computing layer and other computing layers, the current computing layer is assigned to a corresponding computing group; wherein, there are at least two parallel computing groups, and the at least two parallel computing groups have a data input / output relationship with the same computing layer; Based on the data input / output relationships between the computing groups, computing resources are allocated to each computing group, and the running order of each computing group is determined. According to the running order of each computing group and the allocated computing resources, the computing groups are controlled to perform operations, wherein at least two parallel computing groups perform operations in parallel at least for a portion of the time. Each computing group includes a signaler for receiving an end signal from the previous computing group and / or, after all computing layers of the corresponding computing group have completed their operations, sending an end signal to the next computing group. In response to the current computing group receiving the end signal from all dependent groups, the data input from the dependent groups is received, and the computing process for the current computing group begins; wherein, the dependent groups are computing groups that have a data input relationship with the current computing group; The step of allocating a corresponding computing group to the current computing layer based on the data input / output relationship between the current computing layer and other computing layers includes: Determine whether the current computation layer is a constant layer; If so, the next computing layer is the current computing layer, and the step of assigning a corresponding computing group to the current computing layer continues; If not, determine whether the current computing layer has an input layer; If it is determined that the current computing layer has the input layer, determine whether each input layer corresponding to the current computing layer uses the current computing layer as the output layer only; If it is determined that each input layer corresponding to the current computing layer uses the current computing layer as the output layer only, determine whether each input layer corresponding to the current computing layer is in the same computing group; If it is determined that each input layer corresponding to the current computing layer is in the same computing group, the current computing layer is assigned to the computing group where the input layers are located; wherein, the output layer is the computing layer that receives computing results from other computing layers; If it is determined that the current computing layer does not have an input layer, or that at least one input layer corresponding to the current computing layer not only uses the current computing layer as an output layer, or that each input layer corresponding to the current computing layer is not in the same computing group, a new computing group is created for the current computing layer, and the current computing layer is assigned to the newly created computing group.
2. The method according to claim 1, characterized in that, At least one of the parallel computing groups includes at least two of the computing layers; The step of allocating computing resources to each computing group based on the data input / output relationship between each computing group includes: The computing resources are allocated based on the computing layer with the largest computational load among the at least two computing layers.
3. A multi-level computing module control device, characterized in that, The apparatus includes a processor and a memory coupled to each other; the memory stores a computer program, and the processor executes the computer program to implement the steps of the method as described in any one of claims 1-2.
4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program data that, when executed by a processor, implements the steps of the method as described in any one of claims 1-2.