Model training task scheduling execution method, device, electronic device and storage medium

By detecting the model training process in real time and updating the tasks to be initiated, the problem of low efficiency in scheduling and executing model training tasks is solved, and efficient and continuous execution of tasks is achieved.

CN113918296BActive Publication Date: 2024-09-13PINGAN INT SMART CITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111181731.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-11
Publication Date
2024-09-13
Estimated Expiration
2041-10-11

AI Technical Summary

Technical Problem

Existing model training tasks are inefficient during the scheduling and execution process. Training progress and interruptions need to be frequently checked, resulting in inefficient task scheduling. When training is interrupted, it needs to be restarted and execution cannot be continued directly.

Method used

By obtaining the task queue and consuming resources, the model training process can be detected in real time, and available resources can be used to update the tasks to be initiated to avoid starting over and improve the efficiency of task scheduling and execution.

Benefits of technology

It achieves high efficiency in task scheduling and execution, avoids the problem of restarting after training interruption, and improves the continuity and efficiency of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113918296B
    Figure CN113918296B
Patent Text Reader

Abstract

The present invention relates to artificial intelligence technology, and discloses a method for scheduling and executing model training tasks, including: confirming the tasks to be initiated in the task queue according to the consumed resources and available resources, and confirming the task execution objects in the execution object set according to the tasks to be initiated; training the initial model constructed using the tasks to be initiated according to the task execution objects, and saving the model parameters of the initial model after each round of training and marking the corresponding saving time; if the training process of the initial model is interrupted, removing the tasks to be initiated from the task queue, and updating the tasks to be initiated according to the saved model parameters and saving time; adding the updated tasks to be initiated to the task queue according to the priority of the tasks to be initiated. The present invention also relates to a blockchain technology, and the model parameters can be stored in a blockchain node. The present invention also proposes a model training task scheduling execution device, equipment and medium. The present invention can improve the efficiency of task scheduling execution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to artificial intelligence technology, and in particular to a method, device, electronic device and storage medium for scheduling and executing model training tasks. Background Art

[0002] With the development of artificial intelligence, the training process of artificial intelligence models has changed from manual training in the past to using training platforms to automatically schedule and execute multiple model training tasks, implementing intelligent model training.

[0003] However, during the scheduling and execution of current model training tasks, it is necessary to continuously check whether the training is completed and whether the training will be interrupted. If the training is interrupted, other tasks cannot be scheduled, and the interrupted tasks need to be trained from the beginning, which leads to low efficiency in task scheduling and execution. Summary of the invention

[0004] The present invention provides a method, device, electronic device and computer-readable storage medium for scheduling and executing model training tasks, the main purpose of which is to improve the efficiency of task scheduling and execution.

[0005] To achieve the above object, the present invention provides a model training task scheduling execution method, comprising:

[0006] Obtain a task queue and the consumed resources corresponding to each task in the task queue;

[0007] Determine whether the number of tasks in the task queue is zero;

[0008] When the number of tasks in the task queue is zero, task scheduling is stopped;

[0009] When the number of tasks in the task queue is not zero, obtaining the available resources corresponding to each execution object in the preset execution object set in real time;

[0010] Confirming the tasks to be initiated in the task queue according to the consumed resources and the available resources, wherein the tasks to be initiated include: model architecture information, initial model parameters, and priority;

[0011] Constructing a model according to the model architecture information and the initial model parameters to obtain the initial model;

[0012] Perform multiple rounds of iterative training on the initial model using the execution objects in the execution object set, and save the model parameters of the initial model after each round of training and mark the corresponding saving time;

[0013] Detect in real time whether the training process of the initial model is interrupted until the training of the initial model is completed;

[0014] When it is detected that the training process of the initial model is interrupted, the task to be initiated is removed from the task queue, and the task to be initiated is updated according to the saved model parameters and the saved time;

[0015] According to the priority of the task to be initiated, the updated task to be initiated is added to the task queue, and the process returns to the step of determining whether the number of tasks in the task queue is zero.

[0016] Optionally, the confirming the tasks to be initiated in the task queue according to the consumed resources and the available resources includes:

[0017] Calculate the consumed resources and each of the available resources respectively to obtain corresponding resource differences;

[0018] Summarizing all the resource differences corresponding to each of the consumed resources to obtain a corresponding resource difference set;

[0019] Select a resource difference set having a resource difference value not greater than zero from among all the resource difference sets to obtain a target resource difference set;

[0020] Determine the task to which the consumption resource corresponding to the target resource difference set belongs as the task to be selected;

[0021] The to-be-selected task that ranks highest in the task queue is selected to obtain the to-be-initiated task.

[0022] Optionally, the root constructs a model according to the model architecture information and the initial model parameters to obtain the initial model, including:

[0023] Obtaining a model framework and a model structure in the model building information;

[0024] Put all the model structures into the model framework, and connect them according to a preset connection order to obtain the combined model;

[0025] The initial model parameters are set as model parameters of the combined model to obtain the initial model.

[0026] Optionally, the performing multiple rounds of iterative training on the initial model using the execution objects in the execution object set, and saving the model parameters of the initial model after each round of training and marking the corresponding saving time, includes:

[0027] Selecting a resource difference set corresponding to the task to be initiated from all the resource difference sets to obtain a selected resource difference set;

[0028] Selecting the execution objects to which the available resources corresponding to the resource differences not greater than zero in the target resource difference set belong, to obtain a target execution object set;

[0029] The available resources are used to select an object in the target execution object set to obtain the task execution object.

[0030] The task execution object is used to perform multiple rounds of iterative training on the initial model, and the model parameters of the initial model after each round of training are saved and the corresponding saving time is marked.

[0031] Optionally, the selecting an object in the target execution object set by using the available resources to obtain the task execution object includes:

[0032] Acquire the object state of each execution object in the target execution object set, wherein the object state includes: execution state and idle state;

[0033] Selecting the execution objects whose object status is the execution status from the target execution object set to obtain a first execution object set;

[0034] Determining whether the first execution object set is an empty set;

[0035] When the first execution object set is an empty set, selecting the execution objects in the target execution object set whose object status is the execution status to obtain a second execution object set;

[0036] Select the execution object with the smallest available resources in the second execution object set to obtain a task execution object;

[0037] When the first execution object set is not an empty set, the execution object with the smallest available resource in the first execution object set is selected to obtain a task execution object.

[0038] Optionally, performing multiple rounds of iterative training on the initial model using the task execution object, and saving model parameters of the initial model after each round of training and marking the corresponding saving time, includes:

[0039] Obtaining a training sample data set and a data label of each training sample data in the training sample data set;

[0040] Selecting training sample data from the training sample data set and inputting it into the initial model to obtain a predicted label value;

[0041] Confirming the true value of the label according to the data label;

[0042] According to the predicted label value and the true value of the label, a preset loss function is used to calculate to obtain a label loss value;

[0043] When the label loss value is less than or equal to the preset loss threshold, the initial model training is completed, and a trained initial model is obtained;

[0044] When the label loss value is greater than a preset loss threshold, the model parameters of the initial model are adjusted, the adjusted model parameters of the initial model are saved and the corresponding saving time is marked, and the step of selecting the training sample data in the training sample data set and inputting the initial model is returned.

[0045] Optionally, updating the task to be initiated according to the saved model parameters and the saved time includes:

[0046] Extract the model parameter with the longest storage time from all the saved model parameters to obtain the target model parameter;

[0047] The target model parameters replace the initial model parameters in the task to be initiated to obtain an updated task to be initiated.

[0048] In order to solve the above problems, the present invention also provides a model training task scheduling execution device, the device comprising:

[0049] The task confirmation module is used to obtain the task queue and the consumption resources corresponding to each task in the task queue; determine whether the number of tasks in the task queue is zero; when the number of tasks in the task queue is zero, stop task scheduling; when the number of tasks in the task queue is not zero, obtain the available resources corresponding to each execution object in the preset execution object set in real time; confirm the tasks to be initiated in the task queue according to the consumption resources and the available resources, wherein the tasks to be initiated include: model architecture information, initial model parameters, and priority;

[0050] A model building training module, used to build a model according to the model architecture information and the initial model parameters to obtain the initial model; perform multiple rounds of iterative training on the initial model using the execution objects in the execution object set, and save the model parameters of the initial model after each round of training and mark the corresponding saving time;

[0051] The task scheduling execution module is used to detect in real time whether the training process of the initial model is interrupted until the training of the initial model is completed; when it is detected that the training process of the initial model is interrupted, the task to be initiated is removed from the task queue, and the task to be initiated is updated according to the saved model parameters and the saved time; according to the priority of the task to be initiated, the updated task to be initiated is added to the task queue, and the step of determining whether the number of tasks in the task queue is zero is returned.

[0052] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0053] a memory storing at least one computer program; and

[0054] The processor executes the computer program stored in the memory to implement the above-mentioned model training task scheduling execution method.

[0055] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned model training task scheduling execution method.

[0056] When the embodiment of the present invention detects that the training process of the initial model is interrupted, the task to be initiated is removed from the task queue, and the task to be initiated is updated according to the saved model parameters and the saving time; according to the priority of the task to be initiated, the updated task to be initiated is added to the task queue, and the step of determining whether the number of tasks in the task queue is zero is returned to directly reschedule the interrupted task, and update the task at the same time, so that the updated task can continue to be trained on the basis of the interruption of the original task, without the need to re-execute the original task, and the efficiency of task scheduling is higher. Therefore, the model training task scheduling execution method, device, electronic device and readable storage medium proposed in the embodiment of the present invention improve the efficiency of task scheduling execution. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A flowchart of a method for scheduling and executing model training tasks provided by an embodiment of the present invention;

[0058] Figure 2 A schematic diagram of a module of a model training task scheduling execution device provided by an embodiment of the present invention;

[0059] Figure 3 A schematic diagram of the internal structure of an electronic device for implementing a method for scheduling and executing model training tasks provided by an embodiment of the present invention;

[0060] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0061] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0062] The embodiment of the present invention provides a method for scheduling and executing a model training task. The execution subject of the model training task scheduling execution method includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided in the embodiment of the present application. In other words, the model training task scheduling execution method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.

[0063] Reference Figure 1 FIG. 1 is a flow chart of a method for scheduling and executing a model training task provided by an embodiment of the present invention. In the embodiment of the present invention, the method for scheduling and executing a model training task includes:

[0064] S1. Obtain a task queue and the consumed resources corresponding to each task in the task queue;

[0065] The task queue in the embodiment of the present invention is a queue of different model training tasks, wherein the task queue contains different model training tasks.

[0066] Furthermore, the consumed resources in the embodiment of the present invention are the computing power resources required to execute the corresponding tasks. For example, if the computing power resources required to execute task A are 2kh / s, then the computing power resources consumed by task A are 2kh / s.

[0067] S2, determining whether the number of tasks in the task queue is zero;

[0068] In order to determine whether to perform task scheduling again in the embodiment of the present invention, it is necessary to first determine whether the number of tasks in the task queue is zero.

[0069] S3. When the number of tasks in the task queue is zero, stop task scheduling;

[0070] In detail, in the embodiment of the present invention, when the number of tasks in the task queue is zero, it means that all tasks have been executed and completed, and task scheduling is stopped.

[0071] S4. When the number of tasks in the task queue is not zero, obtaining available resources corresponding to each execution object in the preset execution object set in real time;

[0072] In the embodiment of the present invention, when the number of tasks in the task queue is not zero, it is necessary to obtain the available resources corresponding to each execution object in the preset execution object set, so as to determine the tasks that need to be scheduled for execution according to the available resources.

[0073] In detail, the execution object in the embodiment of the present invention is a GPU server or a CPU server, and the available resources are the available computing resources of the execution object.

[0074] In the embodiment of the present invention, each execution object can execute multiple tasks as long as the available resources of the execution object can meet the task requirements. For example, if the available resources of the execution object are 2kh / s and the consumed resources corresponding to task A are 1kh / s, then the execution object can run task A.

[0075] S5. Confirm the tasks to be initiated in the task queue according to the consumed resources and the available resources, wherein the tasks to be initiated include: model architecture information, initial model parameters, and priority;

[0076] In detail, the model architecture information in the embodiment of the present invention is the architecture information that needs to be trained for the task to be initiated. The initial model parameters are preset model initial parameters, and the priority is the priority corresponding to the task.

[0077] Optionally, in the embodiment of the present invention, any integer within a preset range may be used to represent the priority, and the smaller the value, the higher the priority. For example, the preset range is [0, 255].

[0078] In detail, in an embodiment of the present invention, confirming the tasks to be initiated in the task queue according to the consumed resources and the available resources includes:

[0079] Step 1: Calculate the consumed resources and each of the available resources respectively to obtain corresponding resource differences;

[0080] Specifically, in the embodiment of the present invention, the difference between the consumed resource and each of the available resources is calculated to obtain the corresponding resource difference, such as: the consumed resource is 4kh / s, and the available resource is 3kh / s, then the resource difference is 4kh / s-3kh / s=1kh / s.

[0081] Step 2: Summarize all the resource differences corresponding to each of the consumed resources to obtain a corresponding resource difference set;

[0082] Step 3: Select a resource difference set having a value not greater than zero from all the resource difference sets to obtain a target resource difference set;

[0083] In detail, in the embodiment of the present invention, if the resource difference is greater than zero, it means that the corresponding available resources cannot meet the training resource consumption of the task. Therefore, it is necessary to select a resource difference set with a value not greater than zero from all the resource difference sets to obtain the target resource difference set.

[0084] Step 4: Determine the task to which the consumption resource corresponding to the target resource difference set belongs as the task to be selected;

[0085] Step 5: Select the task to be selected that ranks highest in the task queue to obtain the task to be initiated.

[0086] For example, the task queue is [Task A, Task C, Task B, Task D], where Task C and Task B are tasks to be selected, Task C ranks second in the task queue, and Task B ranks third in the task queue. Therefore, Task B is the task to be initiated.

[0087] S6. constructing a model according to the model architecture information and the initial model parameters to obtain the initial model;

[0088] In the embodiment of the present invention, the initial model is an artificial intelligence model. Optionally, the initial model is a convolutional neural network model.

[0089] In detail, in an embodiment of the present invention, a model framework and a model structure in the model construction information are obtained; all the model structures are placed in the model framework, connected in a preset connection order to obtain the combined model, and the initial model parameters are set as the model parameters of the combined model to obtain the initial model.

[0090] S7, using the execution objects in the execution object set to perform multiple rounds of iterative training on the initial model, and saving the model parameters of the initial model after each round of training and marking the corresponding saving time;

[0091] In the embodiment of the present invention, confirming the task execution object in the set of all the execution objects according to the task to be initiated includes:

[0092] Selecting a resource difference set corresponding to the task to be initiated from all the resource difference sets to obtain a selected resource difference set;

[0093] The execution objects to which the available resources corresponding to the resource differences not greater than zero in the target resource difference set belong are selected to obtain a target execution object set.

[0094] Furthermore, an embodiment of the present invention utilizes the available resources to select an object in the target execution object set to obtain the task execution object; utilizes the task execution object to perform multiple rounds of iterative training on the initial model, and saves the model parameters of the initial model after each round of training and marks the corresponding saving time.

[0095] In detail, in the embodiment of the present invention, the object in the target execution object set is selected by using the available resources to obtain the task execution object, including:

[0096] Acquire the object state of each execution object in the target execution object set, wherein the object state includes: execution state and idle state;

[0097] Selecting the execution objects whose object status is the execution status from the target execution object set to obtain a first execution object set;

[0098] Determine whether the first execution object set is an empty set; if the first execution object set is an empty set, select the execution object whose object state is the execution state in the target execution object set to obtain a second execution object set;

[0099] The execution object with the smallest available resources in the second execution object set is selected to obtain a task execution object.

[0100] If the first execution object set is not an empty set, the execution object with the smallest available resource in the first execution object set is selected to obtain a task execution object.

[0101] Optionally, in an embodiment of the present invention, the task execution object is used to perform multiple rounds of iterative training on the initial model, and the model parameters of the initial model after each round of training are saved and the corresponding saving time is marked, including:

[0102] Obtaining a training sample data set and a data label of each training sample data in the training sample data set;

[0103] The data labels in the embodiment of the present invention are labels for marking training sample data, including: categories, coordinates, etc.

[0104] Optionally, in an embodiment of the present invention, the task execution object is used to obtain a training sample data set and a data label of each training sample data in the training sample data set, and training resources are loaded to perform multiple rounds of training on the initial model, and the model parameters of the initial model after each training are saved and the corresponding saving time is marked until the initial model training is completed, and the trained initial model is output.

[0105] Selecting training sample data from the training sample data set and inputting it into the initial model to obtain a predicted label value;

[0106] Confirming the true value of the label according to the data label;

[0107] According to the predicted label value and the true value of the label, a preset loss function is used to calculate to obtain a label loss value;

[0108] When the label loss value is less than or equal to the preset loss threshold, the initial model training is completed, and a trained initial model is obtained;

[0109] When the label loss value is greater than a preset loss threshold, the model parameters of the initial model are adjusted, the model parameters of the initial model are saved and the corresponding saving time is marked, and the step of selecting the training sample data in the training sample data set and inputting the initial model is returned.

[0110] Among them, each calculation of the label loss value is the end of a round of training. When the initial model training is completed, the trained model is output, and the training resources loaded by the task execution object are released at the same time, and the task to be initiated is removed from the task queue and returned to S2.

[0111] In another embodiment of the present invention, the model parameters can be stored in the blockchain node, utilizing the high throughput characteristics of the blockchain node to improve the efficiency of data access.

[0112] S8. Detect in real time whether the training process of the initial model is interrupted until the training of the initial model is completed;

[0113] In detail, in order to prevent the interruption of the training process of the initial model in the embodiment of the present invention, it is necessary to monitor in real time whether the training process of the initial model is interrupted before the training of the initial model is completed.

[0114] S9, when it is detected that the training process of the initial model is interrupted, the task to be initiated is removed from the task queue, and the task to be initiated is updated according to the saved model parameters and the saved time;

[0115] In order to prevent the interruption of the training process of the model in the embodiment of the present invention, which causes the inability to continue executing the tasks in the task queue, the model parameters with the longest storage time among all the saved model parameters are extracted to obtain the target model parameters; the target model parameters are used to replace the initial model parameters in the task to be initiated to obtain an updated task to be initiated.

[0116] Optionally, in the embodiment of the present invention, whether the training process of the initial model is stopped is monitored to determine whether the training process of the initial model is interrupted.

[0117] S10. According to the priority of the task to be initiated, add the updated task to be initiated to the task queue, and return to S2.

[0118] In the embodiment of the present invention, the task priority of the updated task to be initiated is the same as the task priority of the task to be initiated. Therefore, in the embodiment of the present invention, the updated task to be initiated is added to the task queue according to the priority of the task to be initiated, and the step of determining whether the number of tasks in the task queue is zero is returned, and S2 is returned.

[0119] S11, when the training process of the initial model is not detected to be interrupted, the initial model after training is output, the task to be initiated is removed from the task queue and the process returns to S2;

[0120] In detail, when the initial model training is completed, the trained model is output, and at the same time, the training resources loaded by the task execution object are released, and the task to be initiated is removed from the task queue and returns to S2.

[0121] like Figure 2 The figure shows a functional module diagram of the model training task scheduling execution device of the present invention.

[0122] The model training task scheduling execution device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the model training task scheduling execution device can include a task confirmation module 101, an execution object confirmation module 102, and a task scheduling execution module 103. The module described in the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0123] In this embodiment, the functions of each module / unit are as follows:

[0124] The task confirmation module 101 is used to obtain the task queue and the consumption resources corresponding to each task in the task queue; determine whether the number of tasks in the task queue is zero; when the number of tasks in the task queue is zero, stop task scheduling; when the number of tasks in the task queue is not zero, obtain the available resources corresponding to each execution object in the preset execution object set in real time; confirm the tasks to be initiated in the task queue according to the consumption resources and the available resources, wherein the tasks to be initiated include: model architecture information, initial model parameters, and priority;

[0125] The model building training module 102 is used to build a model according to the model architecture information and the initial model parameters to obtain the initial model; perform multiple rounds of iterative training on the initial model using the execution objects in the execution object set, and save the model parameters of the initial model after each round of training and mark the corresponding saving time;

[0126] The task scheduling execution module 103 is used to detect in real time whether the training process of the initial model is interrupted until the initial model training is completed; when it is detected that the training process of the initial model is interrupted, the task to be initiated is removed from the task queue, and the task to be initiated is updated according to the saved model parameters and the saved time; according to the priority of the task to be initiated, the updated task to be initiated is added to the task queue, and the step of determining whether the number of tasks in the task queue is zero is returned.

[0127] like Figure 2 The figure is a schematic diagram of the structure of an electronic device for implementing the model training task scheduling execution method of the present invention.

[0128] The electronic device may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a model training task scheduling execution program.

[0129] Among them, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 11 may be an internal storage unit of an electronic device in some embodiments, such as a mobile hard disk of the electronic device. The memory 11 may also be an external storage device of an electronic device in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the model training task scheduling execution program, but also can be used to temporarily store data that has been output or is to be output.

[0130] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, and executes or executes the programs or modules (such as the model training task scheduling execution program, etc.) stored in the memory 11, and calls the data stored in the memory 11 to execute various functions of the electronic device and process data.

[0131] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0132] Figure 2 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 2 The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0133] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure classification circuits, power converters or inverters, power status indicators, etc. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0134] Optionally, the communication interface 13 may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.

[0135] Optionally, the communication interface 13 may also include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0136] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0137] The model training task scheduling execution program stored in the memory 11 in the electronic device is a combination of multiple computer programs. When running in the processor 10, it can achieve:

[0138] Obtain a task queue and the consumed resources corresponding to each task in the task queue;

[0139] Determine whether the number of tasks in the task queue is zero;

[0140] When the number of tasks in the task queue is zero, task scheduling is stopped;

[0141] When the number of tasks in the task queue is not zero, obtaining the available resources corresponding to each execution object in the preset execution object set in real time;

[0142] Confirming the tasks to be initiated in the task queue according to the consumed resources and the available resources, wherein the tasks to be initiated include: model architecture information, initial model parameters, and priority;

[0143] Constructing a model according to the model architecture information and the initial model parameters to obtain the initial model;

[0144] Perform multiple rounds of iterative training on the initial model using the execution objects in the execution object set, and save the model parameters of the initial model after each round of training and mark the corresponding saving time;

[0145] Detect in real time whether the training process of the initial model is interrupted until the training of the initial model is completed;

[0146] When it is detected that the training process of the initial model is interrupted, the task to be initiated is removed from the task queue, and the task to be initiated is updated according to the saved model parameters and the saved time;

[0147] According to the priority of the task to be initiated, the updated task to be initiated is added to the task queue, and the process returns to the step of determining whether the number of tasks in the task queue is zero.

[0148] Specifically, the specific implementation method of the processor 10 for the above computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0149] Furthermore, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable medium can be non-volatile or volatile. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM).

[0150] An embodiment of the present invention may further provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program may implement:

[0151] Obtain a task queue and the consumed resources corresponding to each task in the task queue;

[0152] Determine whether the number of tasks in the task queue is zero;

[0153] When the number of tasks in the task queue is zero, task scheduling is stopped;

[0154] When the number of tasks in the task queue is not zero, obtaining the available resources corresponding to each execution object in the preset execution object set in real time;

[0155] Confirming the tasks to be initiated in the task queue according to the consumed resources and the available resources, wherein the tasks to be initiated include: model architecture information, initial model parameters, and priority;

[0156] Constructing a model according to the model architecture information and the initial model parameters to obtain the initial model;

[0157] Perform multiple rounds of iterative training on the initial model using the execution objects in the execution object set, and save the model parameters of the initial model after each round of training and mark the corresponding saving time;

[0158] Detect in real time whether the training process of the initial model is interrupted until the training of the initial model is completed;

[0159] When it is detected that the training process of the initial model is interrupted, the task to be initiated is removed from the task queue, and the task to be initiated is updated according to the saved model parameters and the saved time;

[0160] According to the priority of the task to be initiated, the updated task to be initiated is added to the task queue, and the process returns to the step of determining whether the number of tasks in the task queue is zero.

[0161] Furthermore, the computer-usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0162] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0163] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0164] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0165] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0166] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0167] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0168] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0169] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for scheduling and executing model training tasks. It is characterized in that The method comprises: Obtain a task queue and the consumed resources corresponding to each task in the task queue; Determine whether the number of tasks in the task queue is zero; When the number of tasks in the task queue is zero, task scheduling is stopped; When the number of tasks in the task queue is not zero, the available resources corresponding to each execution object in the preset execution object set are obtained in real time, the execution object is a GPU server or a CPU server, and the available resources are the available computing resources of the execution object; Confirming the tasks to be initiated in the task queue according to the consumed resources and the available resources, wherein the tasks to be initiated include: model architecture information, initial model parameters, and priority; Constructing a model according to the model architecture information and the initial model parameters to obtain the initial model; Perform multiple rounds of iterative training on the initial model using the execution objects in the execution object set, and save the model parameters of the initial model after each round of training and mark the corresponding saving time; Detect in real time whether the training process of the initial model is interrupted until the training of the initial model is completed; When it is detected that the training process of the initial model is interrupted, the task to be initiated is removed from the task queue, and the task to be initiated is updated according to the saved model parameters and the saved time; According to the priority of the task to be initiated, adding the updated task to be initiated to the task queue, and returning to the step of determining whether the number of tasks in the task queue is zero; Among them, updating the task to be initiated according to the saved model parameters and the saving time includes: extracting the model parameter with the largest saving time among all the saved model parameters to obtain the target model parameter; replacing the initial model parameter in the task to be initiated with the target model parameter to obtain the updated task to be initiated.

2. The model training task scheduling execution method according to claim 1, It is characterized in that The confirming the tasks to be initiated in the task queue according to the consumed resources and the available resources includes: Calculate the consumed resources and each of the available resources respectively to obtain corresponding resource differences; Summarizing all the resource differences corresponding to each of the consumed resources to obtain a corresponding resource difference value set; Select a resource difference set having a resource difference value not greater than zero from among all the resource difference sets to obtain a target resource difference set; Determine the task to which the consumption resource corresponding to the target resource difference set belongs as the task to be selected; The to-be-selected task that ranks highest in the task queue is selected to obtain the to-be-initiated task.

3. The model training task scheduling execution method according to claim 1, It is characterized in that The step of constructing a model according to the model architecture information and the initial model parameters to obtain the initial model includes: Obtaining a model framework and a model structure in the model building information; Put all the model structures into the model framework, connect them according to a preset connection order, and obtain a combined model; The initial model parameters are set as model parameters of the combined model to obtain the initial model.

4. The model training task scheduling execution method according to claim 2, It is characterized in that The using the execution objects in the execution object set to perform multiple rounds of iterative training on the initial model, and saving the model parameters of the initial model after each round of training and marking the corresponding saving time, includes: Selecting a resource difference set corresponding to the task to be initiated from all the resource difference sets to obtain a selected resource difference set; Selecting the execution objects to which the available resources corresponding to the resource differences not greater than zero in the target resource difference set belong, to obtain a target execution object set; Using the available resources, select an object in the target execution object set to obtain a task execution object; The task execution object is used to perform multiple rounds of iterative training on the initial model, and the model parameters of the initial model after each round of training are saved and the corresponding saving time is marked.

5. The model training task scheduling execution method according to claim 4, It is characterized in that The step of selecting an object in the target execution object set by using the available resources to obtain a task execution object includes: Acquire the object state of each execution object in the target execution object set, wherein the object state includes: execution state and idle state; Selecting the execution objects whose object status is the execution status from the target execution object set to obtain a first execution object set; Determining whether the first execution object set is an empty set; When the first execution object set is an empty set, selecting the execution objects in the target execution object set whose object status is the execution status to obtain a second execution object set; Select the execution object with the smallest available resources in the second execution object set to obtain a task execution object; When the first execution object set is not an empty set, the execution object with the smallest available resource in the first execution object set is selected to obtain a task execution object.

6. The model training task scheduling execution method according to claim 4, It is characterized in that The using the task execution object to perform multiple rounds of iterative training on the initial model, and saving the model parameters of the initial model after each round of training and marking the corresponding saving time, includes: Obtaining a training sample data set and a data label of each training sample data in the training sample data set; Selecting training sample data from the training sample data set and inputting it into the initial model to obtain a predicted label value; Confirming the true value of the label according to the data label; According to the predicted label value and the true value of the label, a preset loss function is used to calculate to obtain a label loss value; When the label loss value is less than or equal to the preset loss threshold, the initial model training is completed, and a trained initial model is obtained; When the label loss value is greater than a preset loss threshold, the model parameters of the initial model are adjusted, the adjusted model parameters of the initial model are saved and the corresponding saving time is marked, and the step of selecting the training sample data in the training sample data set and inputting the initial model is returned.

7. A model training task scheduling execution device, used to implement the model training task scheduling execution method according to any one of claims 1 to 6, It is characterized in that include: A task confirmation module is used to obtain a task queue and the consumption resources corresponding to each task in the task queue; Determine whether the number of tasks in the task queue is zero; when the number of tasks in the task queue is zero, stop task scheduling; when the number of tasks in the task queue is not zero, obtain in real time the available resources corresponding to each execution object in the preset execution object set, the execution object is a GPU server or a CPU server, and the available resources are the available computing resources of the execution object; Confirming the tasks to be initiated in the task queue according to the consumed resources and the available resources, wherein the tasks to be initiated include: model architecture information, initial model parameters, and priority; A model building training module, used to build a model according to the model architecture information and the initial model parameters to obtain the initial model; perform multiple rounds of iterative training on the initial model using the execution objects in the execution object set, and save the model parameters of the initial model after each round of training and mark the corresponding saving time; The task scheduling execution module is used to detect in real time whether the training process of the initial model is interrupted until the training of the initial model is completed; when it is detected that the training process of the initial model is interrupted, the task to be initiated is removed from the task queue, and the task to be initiated is updated according to the saved model parameters and the saved time; according to the priority of the task to be initiated, the updated task to be initiated is added to the task queue, and the step of determining whether the number of tasks in the task queue is zero is returned.

8. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; Wherein, the memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the model training task scheduling execution method as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, the model training task scheduling execution method as described in any one of claims 1 to 6 is implemented.