Task scheduling method and device for hierarchical calculation of large model, and electronic equipment
Task scheduling is performed through deep learning networks, combining model layer parameters and state parameters of home appliance computing devices, solving the problem of limited computing capabilities of edge devices, and achieving efficient hierarchical calculation and accurate allocation of large-scale deep learning models.
Patent Information
- Application Number
- CN202410942913.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-11-08
AI Technical Summary
When the prior art allocates large-scale deep learning models, the computing power and storage space of edge devices are limited, resulting in inaccurate allocation and inability to effectively run large-scale deep learning models.
By obtaining the parameters of the model layer to be allocated and the calculation status parameters of the home appliance computing device, using the deep learning network for task scheduling, determining the target home appliance computing device, and assigning the model layer to it for layered calculations, combining the model calculation time and the complexity of the device calculation. Optimized allocation strategy for balanced and available computing power maximization parameters.
More accurate computing task allocation is achieved, ensuring that the target home appliance computing equipment can effectively run large-scale deep learning models, and improving the efficiency and accuracy of distributed computing.
Smart Images

Figure CN118916129A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a task scheduling method and device, and electronic equipment for large-model hierarchical computing. Background Art
[0002] At present, in the era of big models, smart homes and smart families have been comprehensively upgraded. In order to meet the needs of smart homes and smart families in the era of big models, considering that the hardware resources of home terminals are usually limited and scattered, if you want to better use big model technology in smart home terminals, you need to consider using model layered computing to achieve distributed computing through multiple hardware computing devices in the home, thereby achieving efficient operation of large deep learning models.
[0003] In order to achieve distributed computing of large models, the related art discloses a distributed deep learning framework, which uses an edge computing model of D2D (Device-to-Device) communication, and can distribute part of the computing tasks to edge devices of the network, such as smartphones and tablets.
[0004] In the process of implementing the embodiments of the present disclosure, it is found that there are at least the following problems in the related art:
[0005] The computing power and storage space of the network's edge devices are relatively limited, and related technologies are not accurate enough in allocating computing tasks to edge devices. After allocating large models to edge devices with relatively small computing power and storage space, large deep learning models may not be able to run effectively.
[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0007] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0008] The embodiments of the present disclosure provide a task scheduling method, device, and electronic device for large-model hierarchical computing, which can make the allocation of computing tasks more accurate.
[0009] In some embodiments, a task scheduling method for hierarchical computing of a large model includes: obtaining parameters of a model layer to be assigned of a large model; determining first computing state parameters of a home appliance computing device to be selected; wherein the first computing state parameters include one or more of computing load parameters, network delay parameters, and available computing power parameters of each home appliance computing device; using the parameters of the model layer to be assigned and the first computing state parameters as state input values of a deep learning network, and obtaining multiple action output values output by the deep learning network based on the state input values; determining a target home appliance computing device among the home appliance computing devices to be selected based on the action output values, and assigning the target model layer of the large model to the target home appliance computing device to perform hierarchical computing of the large model.
[0010] Optionally, determining a target home appliance computing device among the home appliance computing devices to be selected based on the action output value includes: obtaining a target output value corresponding to the action output value; determining a target action output value among the action output values having the smallest difference with the target output value; and using the home appliance computing device to be selected corresponding to the target action output value as the target home appliance computing device.
[0011] Optionally, obtaining a target output value corresponding to the action output value includes calculating the target output value according to the following formula:
[0012] Q=r+γ*maxQ(s',a')
[0013] Among them, Q is the target output value, r is the reward value parameter, γ is the discount factor, s' is the new calculation state parameter, and a' is the new action.
[0014] Optionally, after assigning the target model layer of the large model to the target home appliance computing device, it also includes: obtaining the second computing state parameter of the home appliance computing device to be selected; wherein the second computing state parameter includes one or more of a model calculation time parameter, a device calculation complexity balance parameter, and a device available computing power maximization parameter; determining a reward value parameter of the deep learning network according to the second computing state parameter; and using the second computing state parameter and the reward value parameter to construct training data in the experience pool to extract training data in the experience pool and train the deep learning network.
[0015] Optionally, determining the reward value parameter according to the second computing state parameter includes: when the second computing state parameter includes a model computing time parameter, a device computing complexity balance parameter, and a device available computing power maximization parameter, calculating the reward value parameter according to the following formula:
[0016] r=alpha×TCT-beta×BDL-gamma×(1 / MACP)
[0017] Among them, r is the reward value parameter, TCT is the model calculation time, BDL is the device calculation load balancing, MACP is the maximization of the available computing power of the device, and alpha, beta and gamma are weight coefficients.
[0018] Optionally, extracting training data from the experience pool to train the deep learning network includes: using the training data in the experience pool to iteratively train the deep learning network; wherein the iterative training includes using a stochastic gradient descent algorithm to optimize the parameters of the deep learning network to minimize the mean square error between the action training output value of the deep learning network and the learning target value.
[0019] Optionally, the iterative training also includes: adopting an ε-greedy strategy to select actions of the deep learning network; wherein the ε-greedy strategy includes selecting an action with the largest action output value with a probability of 1-ε, and randomly selecting an action with a probability of ε.
[0020] In some embodiments, a task scheduling device for hierarchical calculation of a large model includes: a model decomposition module, configured to hierarchize the large model and obtain the model layer parameters to be assigned of the large model; a device status monitoring module, configured to determine the first computing state parameters of the home appliance computing device to be selected; wherein the first computing state parameters include one or more of the computing load parameters, network delay parameters and available computing power parameters of each home appliance computing device; a deep learning decision module, connected to the model decomposition module and the device status monitoring module, configured to use the model layer parameters to be assigned and the first computing state parameters as the state input values of the deep learning network, and obtain multiple action output values output by the deep learning network based on the state input values; a task scheduling module, connected to the deep learning decision module, configured to determine the target home appliance computing device among the home appliance computing devices to be selected according to the action output value, and assign the target model layer of the large model to the target home appliance computing device to perform hierarchical calculation of the large model.
[0021] In some embodiments, a task scheduling device for large model hierarchical computing includes a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned task scheduling method for large model hierarchical computing through the computer program.
[0022] In some embodiments, the electronic device includes: an electronic device body; and, as described above, a task scheduling device for large model hierarchical computing, installed on the electronic device body.
[0023] The task scheduling method, device, and electronic device for large model hierarchical computing provided by the embodiments of the present disclosure can achieve the following technical effects:
[0024] In the disclosed embodiment, by obtaining the first computing state parameter of the home appliance computing device to be selected, the current state of the selected home appliance computing device can be evaluated so as to select a suitable target home appliance computing device when making an allocation. The model layer parameters to be allocated and the first computing state parameter are used as the state input values of the deep learning network, and the deep learning network can be used for calculation to obtain an allocation strategy, and the obtained allocation strategy can combine the information of the model layer parameters to be allocated and the first computing state parameter. In this way, the target home appliance computing device that can be determined based on the action output value is more matched with the model layer to be allocated, so that the allocation of computing tasks is more accurate, and the target home appliance computing device can effectively run a large deep learning model.
[0025] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0027] Figure 1 It is a hardware environment diagram of a task scheduling method for large model hierarchical computing provided by an embodiment of the present disclosure;
[0028] Figure 2 is a schematic diagram of a task scheduling method for large model hierarchical computing provided by an embodiment of the present disclosure;
[0029] Figure 3 is a schematic diagram of another task scheduling method for large model hierarchical computing provided by an embodiment of the present disclosure;
[0030] Figure 4 is a schematic diagram of another task scheduling method for large model hierarchical computing provided by an embodiment of the present disclosure;
[0031] Figure 5 is a schematic diagram of a task scheduling device for large model hierarchical computing provided by an embodiment of the present disclosure;
[0032] Figure 6 It is a schematic diagram of another task scheduling device for large model hierarchical computing provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0034] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0035] Unless otherwise stated, the term "plurality" means two or more.
[0036] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0037] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0038] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0039] In the era of big models, with the comprehensive upgrade of smart homes and smart families, how to better use big model technology in the home environment is an important issue.
[0040] According to one aspect of an embodiment of the present application, a task scheduling method for large model hierarchical computing is provided. The task scheduling method for large model hierarchical computing is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned task scheduling method for large model hierarchical computing can be applied to Figure 1 In the hardware environment shown in FIG. 1 , a home computing device 102 and a server 104 are formed. Figure 1As shown, the server 104 is connected to the home appliance computing device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0041] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The home appliance computing device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing equipment, a smart dishwasher, a smart projection equipment, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air equipment, a smart kitchen and bathroom equipment, a smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification equipment, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0042] Combination Figure 2 As shown, the embodiment of the present disclosure provides a task scheduling method for large model hierarchical computing, including:
[0043] S01, the server obtains the model layer parameters to be allocated of the large model.
[0044] S02, the server determines the first computing state parameters of the home appliance computing device to be selected, wherein the first computing state parameters include one or more of the computing load parameters, network delay parameters and available computing power parameters of each home appliance computing device.
[0045] S03, the server uses the model layer parameters to be assigned and the first calculation state parameters as state input values of the deep learning network, and obtains multiple action output values output by the deep learning network based on the state input values.
[0046] S04, the server determines the target home appliance computing device among the candidate home appliance computing devices according to the action output value, and allocates the target model layer of the large model to the target home appliance computing device to perform hierarchical calculation of the large model.
[0047] In the disclosed embodiment, the large model is a large deep learning model. By dividing the large deep learning model into independently computable sub-modules, the large model is layered. Each sub-model corresponds to a model layer to be allocated one by one. The parameters of the model layer to be allocated include the number of model layers to be allocated. By calculating the sub-modules through multiple hardware computing devices of the smart home, distributed computing of the large model can be achieved.
[0048] By adopting the task scheduling method for large model hierarchical computing provided by the embodiment of the present disclosure, by obtaining the first computing state parameter of the home appliance computing device to be selected, the current state of the selected home appliance computing device can be evaluated, so as to select a suitable target home appliance computing device when making an allocation. By using the model layer parameters to be allocated and the first computing state parameter as the state input value of the deep learning network, the deep learning network can be used for calculation to obtain an allocation strategy, and the obtained allocation strategy can combine the information of the model layer parameters to be allocated and the first computing state parameter. In this way, the target home appliance computing device that can be determined according to the action output value is more matched with the model layer to be allocated, so that the allocation of computing tasks is more accurate, and the target home appliance computing device can effectively run the large deep learning model.
[0049] Among them, the computing load parameter describes the proportion of the number of tasks being processed by the device to the total computing capacity of the device. Specifically, if the number of tasks being executed by device i is T, and the total task capacity of device i is C, the computing load of device i can be defined as s1 = T / C. s1 reflects the degree of use of the device. When s1 is close to 1, it means that device i has been fully utilized and cannot undertake more computing tasks. Network latency describes the time it takes for data to be transmitted from a device to other devices. In actual operation, the network latency can be estimated by continuously sending and receiving small data packets and measuring the average round-trip time RTT between device i and device j. Available computing power describes the number of computing tasks that a device can perform per unit time. It is determined by factors such as the hardware configuration of the device (such as the performance of the CPU and GPU), the operating system, and other applications currently running. The available computing power of a device is a dynamically changing value that can be obtained by regularly monitoring the resource usage of the device.
[0050] Optionally, determining a target home appliance computing device among the selected home appliance computing devices according to the action output value includes: obtaining a target output value corresponding to the action output value. Determining a target action output value having the smallest difference with the target output value among the action output values. Using the selected home appliance computing device corresponding to the target action output value as the target home appliance computing device.
[0051] In the disclosed embodiment, the target output value can represent the best output result of the deep learning network. By comparing the action output value with the target output value, the deviation between the action output value and the best output result can be known. The smaller the difference obtained, the smaller the deviation. By determining the target action output value with the smallest difference from the target output value in the action output value, the target output value closest to the best output result can be selected. In this way, the selected home appliance computing device corresponding to the target action output value can be used as the target home appliance computing device. By performing hierarchical calculation of the large model through the target home appliance computing device, the operation of the large model can be more efficient.
[0052] Optionally, obtaining a target output value corresponding to the action output value includes calculating the target output value according to the following formula:
[0053] Q=r+γ*maxQ(s',a')
[0054] Among them, Q is the target output value, r is the reward value parameter, γ is the discount factor, s' is the new calculation state parameter, and a' is the new action.
[0055] When calculating the target output value, the action needs to be defined. In the embodiment of the present disclosure, the action can be defined as selecting a certain device to allocate the computing task of the model layer to be allocated. In addition, each action can be given a unique identifier or code. For example, an integer identifier can be assigned to each action according to the serial number sequence of the device. When an action is selected, a corresponding identifier is actually generated.
[0056] In the disclosed embodiment, the target output value is calculated by using the reward value parameter, the new calculation state parameter and the new action. After each action is executed, a new calculation state parameter and a new action are obtained. In addition, the reward value parameter is calculated according to the state of the system, and the reward value parameter can be used to represent the effect after the action is executed to evaluate whether the action meets the requirements of hierarchical computing.
[0057] Assume that the target output value is a vector Q = [q_1, q_2, ..., q_n] of length n, where n is the number of devices and q_i is the expected reward of device i being selected. The device with the largest Q value can be selected by action = np.argmax(Q).
[0058] In practical applications, the Q value can be calculated based on the calculation of the large model. The original action is defined as assigning the first model layer to the smart refrigerator. Based on the calculation status of the smart refrigerator, for example, if the current available computing power of the smart refrigerator is still redundant, a reward value parameter 1 can be obtained, indicating that the smart refrigerator can calculate the first model layer. In addition, a new action is obtained, such as assigning the second model layer to the smart refrigerator, and then obtaining the new calculation status of the smart refrigerator. In this way, the maximum Q value of all possible actions is calculated based on the reward value parameter 1, the new calculation status of the smart refrigerator, and the new action.
[0059] Optionally, after assigning the target model layer of the large model to the target home appliance computing device, the method further includes: obtaining a second computing state parameter of the selected home appliance computing device. The second computing state parameter includes one or more of a model computing time parameter, a device computing complexity balance parameter, and a device available computing power maximization parameter. The reward value parameter of the deep learning network is determined according to the second computing state parameter. The training data in the experience pool is constructed using the second computing state parameter and the reward value parameter to extract the training data in the experience pool and train the deep learning network.
[0060] Combination Figure 3 As shown, the embodiment of the present disclosure provides another task scheduling method for large model hierarchical computing, including:
[0061] S11, the server obtains the model layer parameters to be allocated of the large model.
[0062] S12, the server determines the first computing state parameters of the home appliance computing device to be selected, wherein the first computing state parameters include one or more of a computing load parameter, a network delay parameter, and an available computing power parameter of each home appliance computing device.
[0063] S13, the server uses the model layer parameters to be assigned and the first calculation state parameters as state input values of the deep learning network, and obtains multiple action output values output by the deep learning network based on the state input values.
[0064] S14, the server determines the target home appliance computing device among the candidate home appliance computing devices according to the action output value, and allocates the target model layer of the large model to the target home appliance computing device to perform hierarchical calculation of the large model.
[0065] S15, the server obtains the second computing state parameter of the selected household appliance computing device, wherein the second computing state parameter includes one or more of a model computing time parameter, a device computing complexity balance parameter, and a device available computing power maximization parameter.
[0066] S16, the server determines a reward value parameter of the deep learning network according to the second calculation state parameter.
[0067] S17, the server constructs training data in the experience pool using the second calculation state parameter and the reward value parameter to extract training data in the experience pool and train the deep learning network.
[0068] In the disclosed embodiment, after the target model layer of the large model is assigned to the target home appliance computing device, the target home appliance can perform calculations according to the assigned target model layer. The calculation process causes the state of the target home appliance to change, and the current computing load, network delay, and available computing power will change according to the target model layer. Therefore, the server can obtain the second computing state parameter of the selected home appliance computing device.
[0069] During the training process of the model, the experience replay technology can be used to store the second calculation state parameters and reward value parameters in the experience pool as training data. When the experience pool accumulates enough data, a batch of data can be randomly extracted from it to train the deep learning network. In this way, after the device completes the calculation, the device status information is updated, and the mechanism of feedback learning based on the new status and calculation results can continuously learn and improve the deep learning network, making the task scheduling strategy generated by the deep learning network more optimized.
[0070] Optionally, determining the reward value parameter according to the second computing state parameter includes: when the second computing state parameter includes a model computing time parameter, a device computing complexity balance parameter, and a device available computing power maximization parameter, calculating the reward value parameter according to the following formula:
[0071] r=alpha×TCT-beta×BDL-gamma×(1 / MACP)
[0072] Among them, r is the reward value parameter, TCT is the model calculation time, BDL is the device calculation load balance, MACP is the maximization of the available computing power of the device, and alpha, beta and gamma are weight coefficients. In the embodiment of the present disclosure, TCT represents the total time required to complete all model layer calculation tasks. TCT can be minimized by optimizing device selection and model layer allocation strategies. Therefore, the goal of the alpha×(TCT / initial estimated total time) term is to encourage the agent to reduce the total calculation time. BDL represents the degree of balance of the computing load of all devices. During the calculation of large models, it is hoped that all devices will be fully utilized as much as possible, rather than only some devices taking on most of the tasks. Therefore, the beta×std(computational load of all devices) term is used to encourage the balancing of device loads. MACP represents the average available computing power of all devices. Higher MACP means faster model calculation speed and higher overall efficiency. Therefore, the gamma×(1 / mean(available computing power of all devices)) term is used to encourage the improvement of the available computing power of the device.
[0073] According to the formula, a reward value will be returned for each device selection and model layer allocation behavior. The deep learning network will adjust the output behavior strategy based on this reward value in order to obtain higher cumulative rewards in the future.
[0074] Optionally, extracting training data from the experience pool to train the deep learning network includes: using the training data in the experience pool to iteratively train the deep learning network. The iterative training includes optimizing the parameters of the deep learning network using a stochastic gradient descent algorithm to minimize the mean square error between the action training output value of the deep learning network and the learning target value.
[0075] In the disclosed embodiments, iterative training is a common training strategy in deep learning. It mainly trains the model repeatedly, and each iteration is optimized based on the results of the previous iteration to improve the performance of the model. Through iterative training, the model can gradually learn the inherent laws and patterns of the data, thereby improving its prediction performance.
[0076] Stochastic gradient descent is an optimization algorithm in deep learning. In each iteration, a small batch of samples is randomly selected to calculate the gradient of the loss function, and this gradient is used to update the parameters of the model. The stochastic gradient descent algorithm is fast in calculation. Since only one sample or its small batch is used for calculation each time, the stochastic gradient descent algorithm is very fast in calculation, especially on large-scale data sets, and is usually faster than the batch gradient descent algorithm. In addition, only one or a few samples need to be processed each time, which takes up less memory.
[0077] Through iterative optimization of the deep learning network, the deep learning network can continuously optimize the scheduling strategy based on historical experience and gradually learn a better strategy, so that the scheduling and execution of tasks will become more and more efficient.
[0078] Optionally, the iterative training further includes: selecting an action of the deep learning network using an ε-greedy strategy, wherein the ε-greedy strategy includes selecting an action with the largest action output value with a probability of 1-ε, and randomly selecting an action with a probability of ε.
[0079] Combination Figure 4 As shown, the embodiment of the present disclosure provides another task scheduling method for large model hierarchical computing, including:
[0080] S21, the server obtains the model layer parameters to be allocated of the large model.
[0081] S22, the server determines the first computing state parameters of the home appliance computing device to be selected, wherein the first computing state parameters include one or more of a computing load parameter, a network delay parameter, and an available computing power parameter of each home appliance computing device.
[0082] S23, the server uses the model layer parameters to be assigned and the first calculation state parameters as state input values of the deep learning network, and obtains multiple action output values output by the deep learning network based on the state input values.
[0083] S24, the server determines the target home appliance computing device among the candidate home appliance computing devices according to the action output value, and allocates the target model layer of the large model to the target home appliance computing device to perform hierarchical calculation of the large model.
[0084] S25, the server obtains the second computing state parameter of the selected household appliance computing device, wherein the second computing state parameter includes one or more of a model computing time parameter, a device computing complexity balance parameter, and a device available computing power maximization parameter.
[0085] S26: The server determines a reward value parameter of the deep learning network according to the second calculation state parameter.
[0086] S27, the server constructs training data in the experience pool using the second calculation state parameter and the reward value parameter.
[0087] S28, the server extracts training data from the experience pool.
[0088] S29, the server adopts the ε-greedy strategy to select the action of the deep learning network. The ε-greedy strategy includes selecting the action with the largest action output value with a probability of 1-ε, and randomly selecting an action with a probability of ε.
[0089] In the disclosed embodiment, the ε-greedy strategy is to strike a balance between exploration and exploitation. When selecting an action, there is a certain probability ε to explore, that is, to select a random action in order to discover new states and strategies. Specifically, the ε-greedy strategy defines an exploration rate ε, which usually takes a value between 0 and 1. Each time an action is selected, a random number between 0 and 1 is generated. If the random number is less than ε, a random action is selected. If it is greater than or equal to ε, the optimal action is selected based on the learned information. In this way, the needs of exploration and exploitation can be balanced, and the learning and convergence process of the strategy can be continuously optimized.
[0090] Through the iterative optimization of the deep learning network using the ε-greedy strategy, the deep learning network can continuously optimize the scheduling strategy based on historical experience and gradually learn a better strategy, making the scheduling and execution of tasks more and more efficient.
[0091] Optionally, when scheduling the computing tasks of the large model, the state data of the large model computing system is collected. The collected state data of the large model computing system is input into a trained state evaluation model to obtain a state evaluation value of the large model computing system. When the state evaluation value triggers a feedback mechanism of the large model computing system, the state evaluation value is transmitted to the task scheduler so that the task scheduler reschedules the computing tasks of the large model.
[0092] In this way, the state data of the large model computing system can be collected, and the state data can represent the operation status of the large model computing system after the scheduling operation. The collected state data of the large model computing system is input into the trained state evaluation model, and the operation status of the system can be evaluated to obtain the state evaluation value of the large model computing system. The large model computing system is provided with a feedback mechanism. When the state evaluation value triggers the feedback mechanism of the large model computing system, the state evaluation value is transmitted to the task scheduler so that the task scheduler can reschedule the computing tasks of the large model. In this way, the task scheduler can judge whether the scheduling strategy is reasonable according to the state evaluation value, so that the scheduling strategy can be adjusted, and then the computing tasks of the large model can be rescheduled. The optimization of the scheduling strategy is realized, and the problem of poor operation of the large model computing system and low efficiency of hierarchical computing caused by unreasonable scheduling strategies is reduced.
[0093] Optionally, collecting the state data of the large model computing system includes: collecting the state data of the large model computing system through programming technology according to the collection interval. The programming technology includes one or more of system call, inter-process communication and log record. The collected state data is stored in a database.
[0094] In the disclosed embodiment, the large model computing system is set with an interval time for data collection. In the large model computing process, it is necessary to obtain information in real time, but too frequent data collection may affect system performance. Therefore, it is necessary to set a reasonable time interval according to the actual situation and monitoring requirements of the large model computing system. For example, in the process of hierarchical computing, the large model computing system collects data once after each model layer is allocated.
[0095] Furthermore, system information can be read through system calls. Process information can be obtained by using inter-process communication. Business information can be obtained by using the logging function. System information, process information, and business information can represent the current state of the large model computing system, so that the large model computing system can reschedule the computing tasks of the large model according to the current state. The scheduling strategy is optimized, reducing the problem of poor operation of the large model computing system and low efficiency of hierarchical computing due to unreasonable scheduling strategies.
[0096] After the status data is collected, it can be stored in a constructed database to back up the data and prevent data loss, thereby improving the security and availability of the status data.
[0097] Optionally, when the state evaluation value triggers a feedback mechanism of the large model computing system, transmitting the state evaluation value to the task scheduler includes: obtaining a preset threshold in the feedback mechanism of the large model computing system. When the state evaluation value is greater than or equal to the preset threshold, transmitting the state evaluation value to the task scheduler through a message queue.
[0098] In the disclosed embodiments, the message queue is a mode of inter-process communication or inter-thread communication. It can be used as a buffer to store a large number of messages. When the recipient is temporarily unable to process the message, the message can be stored in the queue and wait for the recipient to process it. The message queue is used as a feedback method. Once a new status evaluation result is generated, a message is added to the queue. The task scheduler can monitor this queue and process new messages when they are received.
[0099] Optionally, the task scheduling method for large-model hierarchical computing further includes: when the state evaluation value is less than the abnormal threshold of the large-model computing system, marking the abnormal computing task as a computing task that needs to limit resources, and modifying the authority or priority of the computing task that needs to limit resources. After modifying the authority or priority of the computing task that needs to limit resources, in the event of an abnormality in the computing task, adjusting the parameters of the computing task or restarting the service.
[0100] In the disclosed embodiment, the large model computing system is provided with an abnormal threshold. When the state evaluation value is less than the abnormal threshold of the large model computing system, it indicates that the task is abnormal and needs to be processed. The task scheduler can limit the extent to which abnormal computing tasks use resources and set a new resource usage target. Resource restrictions include methods such as CPU time slices and memory restrictions. Limiting resource usage can prevent abnormal task behavior caused by excessive resource usage. The large model computing system can affect the probability of a task being allocated resources by adjusting its priority in the scheduling queue. If a task exhibits abnormal behavior, its priority can be lowered to prevent excessive resource usage.
[0101] This ensures that when a task behaves abnormally or requires more hardware resources, it will not affect other tasks and the overall system to run stably, thus achieving the goal of optimizing hardware utilization and stability and preventing single point problems from causing a complete crash. At the same time, it also constitutes an exception handling mechanism with strong execution capability, good adaptability, and the ability to quickly and effectively respond to the running state and return it to normal.
[0102] Furthermore, after the server modifies the permissions or priorities of computing tasks that require resource restrictions, if the computing tasks still have abnormalities, the server can find the problem based on error feedback and log information, and restore to normal by updating the code or changing the implementation method. For some tasks that need to run for a long time, a certain timeout value should be given during the setting to prevent dead loops or long-term blocking.
[0103] Optionally, the task scheduling method for large model hierarchical computing further includes: feeding back task information of abnormal computing tasks to the state assessment model to update the state assessment model.
[0104] In the disclosed embodiment, the state assessment model can evaluate the operation of the system and obtain the state assessment value of the large model computing system. When a task is abnormal, the state assessment model needs to consider the abnormal computing task when evaluating the state of the system. By feeding back the task information of the abnormal computing task to the state assessment model, the state assessment model can be updated so that the state assessment value output by the state assessment model is more accurate. This achieves the optimization of the scheduling strategy and reduces the problem of poor operation of the large model computing system and low efficiency of hierarchical computing due to unreasonable scheduling strategies.
[0105] Optionally, the task scheduling method for large model hierarchical computing also includes: parallel optimization of one or more of the system's central processing unit CPU, graphics processing unit GPU and field programmable gate array FPGA based on the collected status data of the large model computing system.
[0106] In the disclosed embodiment, parallel optimization is continuously performed during the operation of the entire system. During the design phase, the system needs to consider how to maximize the parallel computing of the hardware devices. For example, when selecting a programming model and parallel algorithm suitable for the device, it is necessary to fully consider the characteristics of the device and the system requirements. During the scheduling phase, it is necessary to decide how to assign and schedule tasks to each hardware device based on the task type and the current system status to achieve the most effective parallel computing. During the execution phase, the parallel computing process is dynamically optimized based on real-time feedback information. For example, if it is detected that the load of a CPU core is too high, some tasks are transferred to other cores, or when it is detected that the GPU is idle, some tasks that can be accelerated by the GPU can be assigned to the idle GPU. During the evaluation phase, the parallel efficiency is further improved by regularly evaluating the system operation and performance data, and adjusting the system configuration, parameters or execution strategy.
[0107] Optionally, after obtaining the parameters of the model layer to be allocated of the large model, the method further includes: quantitatively scoring the task factors of the computing tasks of the multi-layer sub-models of the large model. The task factors include multiple parameters of task complexity, device computing power, data transmission requirement, real-time requirement, concurrent processing requirement, network stability and task urgency. The scores of multiple task factors are weighted and summed to obtain the total score of the task. When the total score of the task exceeds the set threshold, the computing task is allocated to different household computing devices.
[0108] The disclosed embodiment quantitatively scores the task factors, and by comparing the calculated total score with the set threshold, different hierarchical strategies can be obtained according to the computing tasks, and the computing tasks can be allocated to different household computing devices. In addition, the disclosed embodiment can score multiple task factors, so that the obtained task total score can integrate the information of multiple task factors, thereby making the evaluation of the task more accurate.
[0109] Optionally, weighted summing of the scoring results of multiple task factors is performed to obtain a total score of the task, including: inputting multiple task factors of the calculation task into a meta-learning model to obtain a weight allocation strategy for the multiple task factors. According to the weight allocation strategy, a corresponding weight is assigned to each task factor. According to the weight of each task factor, weighted summing of the scores is performed to obtain a total score of the task.
[0110] In the embodiment of the present disclosure, the dynamic adjustment of weights can be achieved using a meta-learning method. When using the meta-learning method, some historical data is collected in advance, and a meta-learning model is trained to learn the optimal weights.
[0111] Distribution strategy. Meta-learning is usually used to learn how to learn. It can extract common information from multiple related tasks to accelerate the learning process of new tasks. In specific applications, the meta-learning model is input according to the real-time status of the task and the device, and the weight distribution result of its output is obtained.
[0112] According to the weight allocation strategy obtained by meta-learning, a corresponding weight is assigned to each task factor. The weight reflects the importance of different task factors to the final task score. For each task, the score is weighted and summed according to the weight of each task factor. In this way, the impact of different task factors on the overall performance of the task can be comprehensively considered. The result of the weighted sum is the total score of the task, which can more comprehensively reflect the comprehensive performance of the task, thereby improving the accuracy and reliability of the score.
[0113] Optionally, weighted summing of the scoring results of multiple task factors is performed to obtain a total task score, including: obtaining a redistribution strategy of the weights of multiple task factors through a reinforcement learning algorithm based on historical weight data of the multiple task factors. According to the weight distribution strategy, a corresponding weight is assigned to each task factor. According to the weight of each task factor, weighted summing of the scores is performed to obtain a total task score.
[0114] In the disclosed embodiment, a reinforcement learning strategy can be used for weight adjustment. The system provides feedback based on the results of each task scheduling (e.g., task completion time, resource consumption, etc.), and then automatically adjusts the weights through the reinforcement learning algorithm to optimize future task processing performance. Reinforcement learning learns how to make optimal decisions through interaction with the environment. The reinforcement learning algorithm learns how to adjust the weights of different task factors based on historical weight data to maximize the reward function (e.g., the accuracy of the total task score).
[0115] According to the weight allocation strategy of the reinforcement learning algorithm, a corresponding weight is assigned to each task factor. The weight reflects the importance of different task factors to the final task score. For each task, the score is weighted and summed according to the weight of each task factor. In this way, the impact of different task factors on the overall performance of the task can be comprehensively considered. The result of the weighted sum is the total score of the task, which can more comprehensively reflect the comprehensive performance of the task, thereby improving the accuracy and reliability of the score.
[0116] Optionally, the meta-learning model is obtained in the following manner: feature data is extracted from historical weight data of multiple task factors, and the feature data is input into a meta-learning basic model so that the meta-learning basic model learns a weight allocation strategy to obtain a meta-learning model.
[0117] A meta-learning model is a machine learning model that can learn how to learn. The basic principle is to extract general learning rules and strategies by learning on multiple tasks so that it can quickly adapt and learn when faced with new tasks. The model usually contains two key components: a meta-learner and a task learner. The task of the meta-learner is to learn general learning rules and strategies, while the task learner focuses on learning specific tasks. The main goal of the meta-learning model is to enable the model to solve some new learning tasks with only a small number of samples. For example, in tasks such as image classification and speech recognition, traditional machine learning methods require a large amount of labeled or speech data for training, while meta-learning technology can use a small amount of data for training, and then transfer the learned knowledge to new tasks, thereby greatly reducing training time and data requirements and improving the completion of tasks. Common meta-learning methods include MAML (Model-Agnostic Meta-Learning), which has the advantages of rapid adaptation to new tasks and model independence.
[0118] In the disclosed embodiment, feature data can be obtained by calculating the mean, median, standard deviation and other statistics of historical weight data to reflect the distribution of weights. The meta-learning basic model includes a model based on a neural network, a decision tree or an integration method. The meta-learning basic model is a meta-learning framework that requires multiple iterations and adjustments, including adjusting feature extraction methods, optimizing model structures and parameters, etc., to obtain better meta-learning model performance.
[0119] Optionally, the task complexity parameter is quantitatively scored as follows: one or more of the amount of computation, data size, or number of steps is selected as an evaluation factor. Each evaluation factor is assigned a corresponding weight. The task complexity parameter is calculated according to the following formula:
[0120] C=w1×C1+w2×C2+w3×C3
[0121] Among them, C is the task complexity parameter, C1 is the computational effort, C2 is the data size, C3 is the number of steps, and w1, w2, and w3 are weight coefficients.
[0122] In the disclosed embodiments, the amount of computation required for a task may affect its complexity. For example, solving big data problems or high-performance computing problems requires a large amount of computing resources. The amount of computation can be measured by the time complexity and space complexity of the algorithm, such as O(n^2) or O(2^n) usually means higher complexity. The data scale of the input and output of the task is also an important consideration. If a task needs to process a large amount of input data, or needs to generate a large amount of output data, the complexity of the task may be very high. The data scale can be measured in units such as bytes, kilobytes, and megabytes. The more steps there are to perform a task, the higher the complexity of the task may be. For example, a task involving multiple stages of calculation, analysis, and optimization is usually more complex than a task that only contains a single calculation step. The number of steps can be clearly expressed using a task flow chart or pseudocode.
[0123] Optionally, the device computing capability parameter is quantitatively scored as follows: one or more of processor speed, memory size, storage space, or network bandwidth is selected as an evaluation factor. Each evaluation factor is assigned a corresponding weight. The device computing capability parameter is calculated according to the following formula:
[0124] D=v1×D1+v2×D2+v3×D3+v4×D4
[0125] Among them, D is the device computing capability parameter, D1 is the processor speed, D2 is the memory size, D3 is the storage space, D4 is the network bandwidth, and v1, v2, v3 and v4 are weight coefficients.
[0126] In the disclosed embodiments, processor speed is a key factor in determining the computing power of the device. It is usually measured in megahertz (MHz) or gigahertz (GHz). In addition, the number of cores of the processor is also important, and multiple cores can provide better parallel processing capabilities. The size of the memory directly affects the device's ability to handle multiple tasks simultaneously. The larger the memory, the more applications and services the device can run simultaneously. The amount of memory is usually measured in gigabytes (GB) or terabytes (TB). Storage space includes the capacity of a hard disk drive (HDD) or a solid-state drive (SSD). The available storage space affects the device's ability to perform data-intensive tasks. The size of the storage space is often expressed in gigabytes (GB) or terabytes (TB). When network bandwidth is used as an evaluation factor, a fast and stable network connection can speed up data transmission, which is very important for computing tasks that rely on the network.
[0127] Combination Figure 5 As shown, the embodiment of the present disclosure provides a task scheduling device 20 for hierarchical computing of a large model, including a model decomposition module 201, a device state monitoring module 202, a deep learning decision module 203 and a task scheduling module 204. The model decomposition module 201 is configured to hierarchize the large model and obtain the model layer parameters to be assigned of the large model. The device state monitoring module 202 is configured to determine the first computing state parameters of the selected home appliance computing device. Among them, the first computing state parameters include one or more of the computing load parameters, network delay parameters and available computing power parameters of each home appliance computing device. The deep learning decision module 203 is connected to the model decomposition module 201 and the device state monitoring module 202, and is configured to use the model layer parameters to be assigned and the first computing state parameters as the state input values of the deep learning network, and obtain multiple action output values output by the deep learning network based on the state input values. The task scheduling module 204 is connected to the deep learning decision module 203, and is configured to determine the target home appliance computing device among the selected home appliance computing devices according to the action output value, and assign the target model layer of the large model to the target home appliance computing device to perform hierarchical calculation of the large model.
[0128] In the disclosed embodiment, the device status monitoring module 202 can evaluate the current status of the selected home appliance computing device by obtaining the first computing status parameter of the home appliance computing device to be selected, so as to select the appropriate target home appliance when making the allocation. The deep learning decision module 203 uses the model layer parameters to be allocated and the first computing status parameter as the state input value of the deep learning network, and can use the deep learning network to perform calculations to obtain the allocation strategy, and the obtained allocation strategy can combine the information of the model layer parameters to be allocated and the first computing status parameter. In this way, the task scheduling module 204 can determine that the target home appliance computing device is more matched with the model layer to be allocated based on the action output value, so that the allocation of computing tasks is more accurate, and the target home appliance computing device can effectively run the large deep learning model.
[0129] Optionally, the deep learning decision module 203 can obtain the target output value corresponding to the action output value, determine the target action output value with the smallest difference between the action output value and the target output value, and use the selected home appliance computing device corresponding to the target action output value as the target home appliance computing device.
[0130] Optionally, after the task scheduling module 204 assigns the target model layer of the large model to the target home appliance computing device, the device state monitoring module 202 can obtain the second computing state parameter of the selected home appliance computing device. Determine the reward value parameter of the deep learning network according to the second computing state parameter. Use the second computing state parameter and the reward value parameter to construct training data in the experience pool, so as to extract training data in the experience pool and train the deep learning network.
[0131] Optionally, the deep learning decision module 203 can use the training data in the experience pool to iteratively train the deep learning network. The iterative training includes optimizing the parameters of the deep learning network using a stochastic gradient descent algorithm to minimize the mean square error between the action training output value of the deep learning network and the learning target value.
[0132] Furthermore, the iterative training also includes: using an ε-greedy strategy to select an action of the deep learning network, wherein the ε-greedy strategy includes selecting an action with the largest action output value with a probability of 1-ε, and randomly selecting an action with a probability of ε.
[0133] Combination Figure 6As shown, the embodiment of the present disclosure provides another task scheduling device 70 for large model hierarchical computing, including a processor (processor) 700 and a memory (memory) 701. Optionally, the device 70 may also include a communication interface (Communication Interface) 702 and a bus 703. Among them, the processor 700, the communication interface 702, and the memory 701 can communicate with each other through the bus 703. The communication interface 702 can be used for information transmission. The processor 700 can call the logic instructions in the memory 701 to execute the task scheduling method for large model hierarchical computing of the above embodiment.
[0134] In addition, the logic instructions in the memory 701 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.
[0135] The memory 701 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 700 executes the functional application and data processing by running the program instructions / modules stored in the memory 701, that is, the task scheduling method for large model hierarchical computing in the above embodiment is implemented.
[0136] The memory 701 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function. The data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 701 may include a high-speed random access memory and may also include a non-volatile memory.
[0137] The disclosed embodiment provides an electronic device, comprising: an electronic device body, and the above-mentioned task scheduling device 20 for large-model hierarchical computing. The task scheduling device 20 for large-model hierarchical computing is installed on the electronic device body. The installation relationship described here is not limited to placement inside the electronic device body, but also includes installation connections with other components of the electronic device, including but not limited to physical connections, electrical connections, or signal transmission connections. It can be understood by those skilled in the art that the task scheduling device 20 for large-model hierarchical computing can be adapted to a feasible electronic device body, thereby realizing other feasible embodiments.
[0138] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A task scheduling method for large model hierarchical computing, characterized in that: include: Obtaining the model layer parameters to be allocated of the large model; Determine a first computing state parameter of the selected household computing device; wherein the first computing state parameter includes one or more of a computing load parameter, a network delay parameter, and an available computing power parameter of each household computing device; Using the model layer parameter to be allocated and the first calculated state parameter as the state input value of the deep learning network, and obtaining a plurality of action output values output by the deep learning network based on the state input value; The target home appliance computing device among the candidate home appliance computing devices is determined according to the action output value, and the target model layer of the large model is allocated to the target home appliance computing device to perform hierarchical calculation of the large model.
2. The task scheduling method according to claim 1, characterized in that: Determining a target home appliance computing device among the selected home appliance computing devices according to the action output value includes: Obtain the target output value corresponding to the action output value; Determine the target action output value having the smallest difference with the target output value among the action output values; The candidate home appliance computing device corresponding to the target action output value is used as the target home appliance computing device.
3. The task scheduling method according to claim 2, characterized in that: Obtaining the target output value corresponding to the action output value includes calculating the target output value according to the following formula: Q=r+γ*maxQ(s',a') Among them, Q is the target output value, r is the reward value parameter, γ is the discount factor, s' is the new calculation state parameter, and a' is the new action.
4. The task scheduling method according to claim 1, 2 or 3, characterized in that: After assigning the target model layer of the large model to the target appliance computing device, it also includes: Acquire a second computing state parameter of the selected household appliance computing device; wherein the second computing state parameter includes one or more of a model computing time parameter, a device computing complexity balance parameter, and a device available computing power maximization parameter; Determine a reward value parameter of the deep learning network according to the second calculation state parameter; The training data in the experience pool is constructed using the second calculation state parameter and the reward value parameter to extract the training data in the experience pool and train the deep learning network.
5. The task scheduling method according to claim 4, characterized in that: Determining a reward value parameter according to the second calculation state parameter includes: When the second computing state parameter includes the model computing time parameter, the device computing load balancing parameter, and the device available computing power maximization parameter, the reward value parameter is calculated according to the following formula: r=alpha×TCT-beta×BDL-gamma×(1 / MACP) Among them, r is the reward value parameter, TCT is the model calculation time, BDL is the device calculation load balancing, MACP is the maximization of the available computing power of the device, and alpha, beta and gamma are weight coefficients.
6. The task scheduling method according to claim 4, characterized in that: Extract training data from the experience pool and train the deep learning network, including: Use the training data in the experience pool to iteratively train the deep learning network; Among them, iterative training includes optimizing the parameters of the deep learning network using a stochastic gradient descent algorithm to minimize the mean square error between the action training output value of the deep learning network and the learning target value.
7. The task scheduling method according to claim 6, characterized in that: Iterative training also includes: The ε-greedy strategy is used to select the actions of the deep learning network; the ε-greedy strategy includes selecting the action with the largest action output value with a probability of 1-ε, and randomly selecting an action with a probability of ε.
8. A task scheduling device for large model hierarchical computing, characterized in that: include: A model decomposition module is configured to divide the large model into layers and obtain model layer parameters to be allocated of the large model; A device status monitoring module is configured to determine a first computing status parameter of the selected home appliance computing device; wherein the first computing status parameter includes one or more of a computing load parameter, a network delay parameter, and an available computing power parameter of each home appliance computing device; A deep learning decision module is connected to the model decomposition module and the device state monitoring module, and is configured to use the model layer parameter to be allocated and the first calculated state parameter as the state input value of the deep learning network, and obtain a plurality of action output values output by the deep learning network based on the state input value; The task scheduling module is connected to the deep learning decision module and is configured to determine the target home appliance computing device among the selected home appliance computing devices according to the action output value, and assign the target model layer of the large model to the target home appliance computing device to perform hierarchical calculation of the large model.
9. A task scheduling device for large model hierarchical computing, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the task scheduling method for large model hierarchical computing according to any one of claims 1 to 7 through the computer program.
10. An electronic device, characterized in that: include: Electronic device body; and, The task scheduling device for large model hierarchical computing as described in claim 8 or 9 is installed on the electronic device body.
