Training task execution method, device, electronic device and storage medium

Through general controller and training task configuration, the problem of high learning cost of multiple model training framework controllers is solved, and efficient training task execution is achieved under multiple frameworks, saving development time and labor costs.

CN113935427BActive Publication Date: 2025-04-08BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111234368.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2025-04-08
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

In the prior art, developers need to learn controllers of multiple model training frameworks, resulting in excessive development time and labor costs.

Method used

It provides a general controller that can be used for a variety of model training frameworks by configuring framework identification and framework operation information in training tasks. The controller obtains the role object information in the model training framework, creates corresponding instance objects, and runs these instance objects to realize the operation of the model training framework.

Benefits of technology

Developers only need to learn a general controller to implement training tasks using multiple model training frameworks, saving development time and labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113935427B_ABST
    Figure CN113935427B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, device, electronic device and storage medium for executing a training task, and belongs to the field of computer technology. The method includes: obtaining a training task through a controller, obtaining a model training framework indicated by a framework identifier through the controller, determining a role object indicated by at least one role object information in the model training framework as an associated role object of the training task through the controller, creating an instance object for each role object based on a set of functions corresponding to the associated role object, and running the instance object corresponding to each associated role object. The method provided by the embodiment of the present disclosure, the training task specifies the framework identifier of the model training framework and the role object information corresponding to the associated role object associated with the training task, and the operation of the model training framework can be realized through the controller and the training task. Only by learning the general controller, the training tasks using multiple model training frameworks can be realized, saving labor costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for executing a training task. Background Art

[0002] With the development of computer technology, network models are being used more and more widely. When training a network model, it is usually necessary to run the model training framework through the controller to train the network model.

[0003] There are many types of model training frameworks at present, and different model training frameworks correspond to different controllers. If developers need to train a network model based on any model training framework, they need to first learn the controller corresponding to the model training framework, and then use the controller and the model training framework to train a network model. This training method requires developers to spend a lot of time learning and consumes a lot of manpower costs. Summary of the invention

[0004] The present disclosure provides a method, device, electronic device and storage medium for executing a training task, which saves manpower costs.

[0005] According to one aspect of an embodiment of the present disclosure, a method for executing a training task is provided, the method comprising:

[0006] Acquire a training task through a controller, the training task being used to train a network model, the training task including a framework identifier and framework operation information, the framework operation information including at least one role object information;

[0007] Obtaining, by means of the controller, a model training framework indicated by the framework identifier, wherein the model training framework includes the at least one role object and a function set corresponding to each role object, wherein the function set includes a function for training the network model;

[0008] By means of the controller, the role object indicated by the at least one role object information in the model training framework is determined as an associated role object of the training task, and based on the function set corresponding to the associated role object, an instance object is created for each role object, wherein the instance object includes a function in the corresponding function set;

[0009] Run the instance object corresponding to each associated role object.

[0010] In some embodiments, the framework operation information further includes a first instance number corresponding to each role object information; and the creating instance objects for each associated role object based on the function set corresponding to the associated role object includes:

[0011] Based on the first instance number corresponding to each role object information and the function set corresponding to each associated role object, instance objects corresponding to the first instance number are created for each associated role object.

[0012] In some embodiments, the framework operation information includes a plurality of the role object information and dependencies between the plurality of the role object information; and the operation of the instance object corresponding to each associated role object includes:

[0013] Running instance objects corresponding to first-type role objects among the plurality of associated role objects, where the first-type role objects are role objects that are not dependent on other role objects;

[0014] When the instance object corresponding to the first type of role object has been run, the instance object corresponding to the second type of role object that depends on the first type of role object is run, where the second type of role object is a role object that depends on other role objects among the multiple associated role objects.

[0015] In some embodiments, both the instance object and the function set corresponding to the second-type role object include a dependency function, and the dependency function indicates the first-type role object on which the second-type role object depends; and when the instance object corresponding to the first-type role object has been run, running the instance object corresponding to the second-type role object that depends on the first-type role object includes:

[0016] Run the dependency function in the instance object corresponding to the second type of role object;

[0017] By means of the dependency function, the instance object corresponding to the first type of role object that the second type of role object depends on is monitored;

[0018] When it is determined that the instance object has been run, the instance object corresponding to the second-type role object is run.

[0019] In some embodiments, monitoring the instance object corresponding to the first type of role object that the second type of role object depends on through the dependency function includes:

[0020] By means of the dependency function, an address of an instance object corresponding to the first type of role object on which the second type of role object depends is monitored, wherein the address is cached by the controller when the instance object corresponding to the first type of role object runs successfully;

[0021] When it is determined that the instance object has been run, running the instance object corresponding to the second-type role object includes:

[0022] In response to monitoring the address, the instance object corresponding to the second-type role object is run.

[0023] In some embodiments, after running the instance object corresponding to each role object, the method further includes:

[0024] A communication service is created for each of the associated role objects, where the communication service is used to implement communication between instance objects corresponding to at least one associated role object.

[0025] In some embodiments, after running the instance object corresponding to each associated role object, the method further includes:

[0026] In response to any instance object failing to run, and the framework running information including a failure restart parameter corresponding to the associated role object to which the instance object belongs, restarting the instance object.

[0027] In some embodiments, the framework operation information further includes a state determination strategy, the state determination strategy indicating the state of the instance object corresponding to the role object indicated by the at least one role object information, and a strategy for determining the state of the training task; after running the instance object corresponding to each associated role object, the method further includes:

[0028] The controller uses the state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task.

[0029] In some embodiments, the state determination strategy includes a first strategy corresponding to each role object information and a second strategy corresponding to the training task, wherein the first strategy is a strategy for determining the state of the associated role object by the state of the instance object corresponding to the associated role object indicated by the role object information, and the second strategy is a strategy for determining the state of the training task by the state of the associated role object;

[0030] The controller uses the state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task, including:

[0031] By means of the controller, the first strategy corresponding to each role object information is adopted to process the state of the instance object corresponding to each associated role object respectively, so as to obtain the state of each associated role object;

[0032] The controller adopts the second strategy to process the state of each associated role object to obtain the state of the training task.

[0033] In some embodiments, the controller uses the state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task, including:

[0034] Through the controller, at each target time interval, the state determination strategy is adopted to process the state of the instance object corresponding to at least one associated role object to obtain the updated state of the training task.

[0035] In some embodiments, the method further comprises:

[0036] In response to the status of the training task being an end state, stopping the running of the model training framework.

[0037] In some embodiments, obtaining the training task through the controller includes:

[0038] Obtaining, by the controller, the training task to be processed from a task queue corresponding to the controller;

[0039] After the state of the training task is in the end state and the model training framework is stopped, the method further includes:

[0040] Clear the data generated when running the model training framework.

[0041] In some embodiments, the framework operation information further includes the first instance number corresponding to each role object information; after running the instance object corresponding to each associated role object, the method further includes:

[0042] By means of the controller, based on the first instance number corresponding to each role object information, the second instance number of the instance object corresponding to each associated role object is verified;

[0043] Through the controller, when the first instance number and the second instance number corresponding to any associated role object are different, the instance object corresponding to the associated role object is updated based on the difference between the first instance number and the second instance number, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number.

[0044] In some embodiments, when a first instance number and a second instance number corresponding to any associated role object are different, updating the instance object corresponding to the associated role object based on the difference between the first instance number and the second instance number so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number, by the controller, includes:

[0045] By means of the controller, when the second instance number corresponding to the associated role object is less than the first instance number, instance objects of the difference number are created for the associated role object, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number; or

[0046] By means of the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, instance objects of the difference number are deleted from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number.

[0047] In some embodiments, the controller, when the second number of instances corresponding to the associated role object is greater than the first number of instances, deletes the instance objects of the difference number from the instance objects corresponding to the associated role object so that the instance number of the instance objects corresponding to the associated role object is equal to the first number of instances, comprises:

[0048] By means of the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, instance objects with the difference number and failed to run are deleted from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number; or

[0049] By means of the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, the instance objects with the difference number and the shortest running time are deleted from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number.

[0050] In some embodiments, before obtaining, by the controller, the model training framework indicated by the framework identifier, the method further includes:

[0051] Verifying the training task by the controller;

[0052] The method of obtaining, by the controller, a model training framework indicated by the framework identifier includes:

[0053] In response to successful verification of the training task, the model training framework indicated by the framework identifier is obtained through the controller.

[0054] In some embodiments, the training task further includes an address corresponding to the framework identifier; and obtaining, by the controller, a model training framework indicated by the framework identifier includes:

[0055] The model training framework is obtained through the controller from the address corresponding to the framework identifier.

[0056] According to another aspect of an embodiment of the present disclosure, a device for executing a training task is provided, the device comprising:

[0057] An acquisition unit is configured to execute acquisition of a training task through a controller, wherein the training task is used to train a network model, the training task includes a framework identifier and framework operation information, and the framework operation information includes at least one role object information;

[0058] The acquisition unit is further configured to execute, through the controller, acquiring a model training framework indicated by the framework identifier, wherein the model training framework includes the at least one role object and a function set corresponding to each role object, and the function set includes a function for training the network model;

[0059] A creating unit is configured to execute, through the controller, determining the role object indicated by the at least one role object information in the model training framework as an associated role object of the training task, and based on the function set corresponding to the associated role object, creating an instance object for each associated role object, wherein the instance object includes a function in the corresponding function set;

[0060] The running unit is configured to execute the instance object corresponding to each associated role object.

[0061] In some embodiments, the framework operation information also includes the first instance number corresponding to each role object information; the creation unit is configured to execute through the controller, based on the first instance number corresponding to each role object information and the function set corresponding to each associated role object, to create the corresponding first instance number of instance objects for each associated role object.

[0062] In some embodiments, the framework operation information includes a plurality of the role object information and dependencies between the plurality of the role object information; the operation unit includes:

[0063] An operation subunit is configured to execute and run instance objects corresponding to first-type role objects among the plurality of associated role objects, where the first-type role objects are role objects that do not depend on other role objects;

[0064] The running subunit is further configured to execute, when the instance object corresponding to the first type of role object has been run, an instance object corresponding to a second type of role object that depends on the first type of role object, wherein the second type of role object is a role object that depends on other role objects among the multiple associated role objects.

[0065] In some embodiments, the instance object and function set corresponding to the second-class role object both include a dependency function, wherein the dependency function indicates the first-class role object on which the second-class role object depends; the running subunit is configured to execute the dependency function in the instance object corresponding to the second-class role object; monitor the instance object corresponding to the first-class role object on which the second-class role object depends through the dependency function; and run the instance object corresponding to the second-class role object when it is determined that the instance object has been running.

[0066] In some embodiments, the running sub-unit is configured to execute through the dependency function, monitor the address of the instance object corresponding to the first type of role object that the second type of role object depends on, and the address is cached by the controller when the instance object corresponding to the first type of role object runs successfully; in response to monitoring the address, run the instance object corresponding to the second type of role object.

[0067] In some embodiments, the creating unit is further configured to create a communication service for each of the associated role objects, wherein the communication service is used to implement communication between instance objects corresponding to at least one associated role object.

[0068] In some embodiments, the apparatus further comprises:

[0069] The restart unit is configured to execute, in response to any instance object failing to run, and the framework running information includes a failure restart parameter corresponding to the associated role object to which the instance object belongs, restarting the instance object.

[0070] In some embodiments, the framework operation information further includes a state determination strategy, the state determination strategy indicating a state of an instance object corresponding to a role object indicated by the at least one role object information, and a strategy for determining a state of the training task; the device further includes:

[0071] The determination unit is configured to execute, through the controller, using the state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task.

[0072] In some embodiments, the state determination strategy includes a first strategy corresponding to each role object information and a second strategy corresponding to the training task, wherein the first strategy is a strategy for determining the state of the associated role object by the state of the instance object corresponding to the associated role object indicated by the role object information, and the second strategy is a strategy for determining the state of the training task by the state of the associated role object;

[0073] The determination unit is configured to execute, through the controller, the first strategy corresponding to the information of each role object, to process the state of the instance object corresponding to each associated role object, respectively, to obtain the state of each associated role object; and through the controller, the second strategy is adopted to process the state of each associated role object, to obtain the state of the training task.

[0074] In some embodiments, the determination unit is configured to execute, through the controller, at each target duration, using the state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the updated state of the training task.

[0075] In some embodiments, the apparatus further comprises:

[0076] A stopping unit is configured to stop running the model training framework in response to the state of the training task being an end state.

[0077] In some embodiments, the acquisition unit is configured to acquire the training task to be processed from the task queue corresponding to the controller through the controller;

[0078] The device also includes:

[0079] The cleaning unit is configured to clean up the data generated when running the model training framework.

[0080] In some embodiments, the framework operation information further includes the number of first instances corresponding to each role object information; and the device further includes:

[0081] A verification unit is configured to verify the second instance number of the instance object corresponding to each associated role object based on the first instance number corresponding to each role object information through the controller;

[0082] An updating unit is configured to execute, through the controller, when a first instance number and a second instance number corresponding to any associated role object are different, updating the instance object corresponding to the associated role object based on the difference between the first instance number and the second instance number, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number.

[0083] In some embodiments, the update unit is configured to execute, through the controller, when the second instance number corresponding to the associated role object is less than the first instance number, creating instance objects of the difference number for the associated role object so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number; or, through the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, deleting instance objects of the difference number from the instance object corresponding to the associated role object so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number.

[0084] In some embodiments, the update unit is configured to execute, through the controller, when the second number of instances corresponding to the associated role object is greater than the first number of instances, delete the instance objects with the difference number and failed to run from the instance objects corresponding to the associated role object, so that the instance number of instance objects corresponding to the associated role object is equal to the first number of instances; or, through the controller, when the second number of instances corresponding to the associated role object is greater than the first number of instances, delete the instance objects with the difference number and the shortest running time from the instance objects corresponding to the associated role object, so that the instance number of instance objects corresponding to the associated role object is equal to the first number of instances.

[0085] In some embodiments, the apparatus further comprises:

[0086] A verification unit, configured to verify the training task through the controller;

[0087] The operation unit is configured to execute, in response to successful verification of the training task, obtaining, through the controller, a model training framework indicated by the framework identifier.

[0088] In some embodiments, the training task also includes an address corresponding to the framework identifier; the acquisition unit is configured to execute, through the controller, acquiring the model training framework from the address corresponding to the framework identifier.

[0089] According to another aspect of the embodiments of the present disclosure, an electronic device is provided, the electronic device comprising:

[0090] processor;

[0091] a memory for storing instructions executable by the processor;

[0092] Wherein, the processor is configured to execute the instructions to implement the above-mentioned method for executing the training task.

[0093] According to another aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method for executing the training task described in the above aspects.

[0094] According to another aspect of an embodiment of the present disclosure, a computer program product is provided. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the method for executing the training task described in the above aspects.

[0095] The execution method, device, electronic device and storage medium of the training task provided by the embodiment of the present disclosure provide a universal controller that can be applied to multiple model training frameworks. When any model training framework is needed to train a network model, only one training task needs to be configured, in which the framework identifier and framework operation information of the model training framework to be used are specified, and the role object information corresponding to the associated role object contained in the model training framework and associated with the training task is configured in the framework operation information, so that through the controller, based on the framework operation information and the function set corresponding to each associated role object in the model training framework, a corresponding instance object is created for each associated role object, and the instance object corresponding to each associated role object contains the function in the corresponding function set, so that when the instance object corresponding to each associated role object is run, each instance object runs the contained function, thereby realizing the operation of the model training framework, so as to realize the model training task later. Based on this method, developers only need to learn the universal controller to realize the training tasks using multiple model training frameworks, and no longer need to learn the controller corresponding to each model training framework, which saves development time and thus saves labor costs.

[0096] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0098] Figure 1 It is a schematic diagram showing an implementation environment according to an exemplary embodiment.

[0099] Figure 2 The figure is a flowchart of a method for executing a training task according to an exemplary embodiment.

[0100] Figure 3 The figure is a flowchart of another method for executing a training task according to an exemplary embodiment.

[0101] Figure 4 The figure is a flowchart showing the operation of a model training framework according to an exemplary embodiment.

[0102] Figure 5 The present invention is a flowchart showing a method of determining a status of a training task according to an exemplary embodiment.

[0103] Figure 6 The figure is a flow chart showing a tuning process according to an exemplary embodiment.

[0104] Figure 7 The figure is a flowchart of executing a training task according to an exemplary embodiment.

[0105] Figure 8 is a flowchart showing another tuning process according to an exemplary embodiment.

[0106] Fig. 9 It is a block diagram of a device for executing a training task according to an exemplary embodiment.

[0107] Fig.10 It is a block diagram of another apparatus for executing a training task according to an exemplary embodiment.

[0108] Fig.11 It is a block diagram of a terminal according to an exemplary embodiment.

[0109] Fig.12 It is a block diagram of a server according to an exemplary embodiment. DETAILED DESCRIPTION

[0110] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0111] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned figure descriptions are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0112] The terms "at least one", "a plurality", "each", and "any" used in the present disclosure include one, two, or more than two, a plurality includes two or more than two, each refers to each of the corresponding plurality, and any refers to any one of the plurality. For example, a plurality of role objects includes three role objects, and each refers to each of the three role objects, and any refers to any one of the three role objects, which can be the first role object, or the second role object, or the third role object.

[0113] It should be noted that the user information involved in this disclosure (including but not limited to user device information, user personal information, etc.) is all information authorized by the user or fully authorized by all parties.

[0114] The method provided in the embodiments of the present disclosure is performed by an electronic device. In some embodiments, the electronic device includes a terminal or a server. In some embodiments, the terminal is a terminal of various types such as a mobile phone, a tablet computer, a computer, etc. In some embodiments, the server is a server, or a server cluster composed of several servers, or a cloud computing service center.

[0115] In some embodiments, the electronic device is provided as a server. Figure 1 It is a schematic diagram of an implementation environment provided according to an exemplary embodiment, the implementation environment includes: a terminal 101 and a server 102, a network connection is established between the terminal 101 and the server 102, and the terminal 101 can interact with the server 102 through the network connection.

[0116] The terminal 101 is used to configure the training task, and can also request the server 102 to execute the training task by interacting with the server 102. The server 102 is configured with a general controller, and the acquired training task can be executed through the controller. The terminal 101 obtains the configured training task, sends a task training request to the server 102, and the task training request carries the training task. The server 102 receives the task training request and executes the training task carried by the task training request through the controller.

[0117] In some embodiments, the terminal 101 is installed with a target application, and the server 102 provides services for the target application. The terminal 101 configures a training task based on a task template in the target application, and sends a task training request to the server 102 based on the target application. The task training request carries the training task. The server 102 receives the task training request, adds the training task carried by the task training request to the task queue corresponding to the controller, obtains the training task to be processed from the task queue through the controller, and executes the training task.

[0118] Figure 2 is a flowchart of a method for executing a training task according to an exemplary embodiment. Figure 2 The method is performed by an electronic device and comprises the following steps:

[0119] 201. The electronic device obtains a training task through a controller, where the training task is used to train a network model, and the training task includes a framework identifier and framework operation information.

[0120] In an embodiment of the present disclosure, the controller is used to run any model training framework, and the model training framework is used to train a network model. The model training framework is an arbitrary framework, for example, the model training framework is an AI (Artificial Intelligence) training framework. The training task is used to train a network model, and the framework identifier included in the training task indicates the model training framework used to train the network model. The framework running information included in the training task includes at least one role object information, and the role object information indicates the role object in the model training framework. Subsequently, through the controller, the model training framework indicated by the framework identifier can be run based on the framework running information to train a network model.

[0121] 202. The electronic device obtains the model training framework indicated by the framework identifier through the controller.

[0122] The model training framework includes at least one role object and a function set corresponding to each role object, and the function set includes functions for training network models. When the model training framework is subsequently run, the functions in the function set corresponding to the role object associated with the training task are run to train the network model corresponding to the training task. Through the controller, the model training framework indicated by the framework identifier in the training task can be obtained so that the obtained model training framework can be subsequently run.

[0123] 203. The electronic device, through a controller, determines the role object indicated by at least one role object information in the model training framework as an associated role object of the training task, and creates an instance object for each associated role object based on a function set corresponding to the associated role object, wherein the instance object contains functions in the corresponding function set.

[0124] Since the framework operation information includes at least one role object information, which indicates the associated role object associated with the training task in the model training framework, and the model training framework includes a function set corresponding to each role object, the controller can determine the function set corresponding to each associated role object based on the framework operation information, and create a corresponding instance object for each associated role object, so that the instance object corresponding to each associated role object contains the function in the function set corresponding to the associated role object. Subsequently, when the model training framework is running, that is, the function in the function set corresponding to each associated role object is run, the training process of the network model can be realized, thereby training the network model.

[0125] 204. The electronic device runs the instance object corresponding to each associated role object.

[0126] The electronic device realizes the operation of the model operation framework by running the instance object corresponding to each associated role object, so that each instance object can run the included functions and train the network model based on the running functions. In the embodiment of the present disclosure, the training task indicates the model training framework of the object and the framework operation information corresponding to the model training framework. The model training framework can be run through the controller and the framework operation information, thereby realizing the versatility of the controller. Through the controller, the model training framework is run based on the framework operation information, so that a network model can be trained based on the running model training framework.

[0127] The method provided by the embodiment of the present disclosure provides a universal controller that can be applied to multiple model training frameworks. When any model training framework is needed to train a network model, only one training task needs to be configured. The framework identifier and framework operation information of the model training framework to be used are specified in the training task. The role object information corresponding to the associated role object contained in the model training framework and associated with the training task is configured in the framework operation information, so that through the controller, based on the framework operation information and the function set corresponding to each associated role object in the model training framework, a corresponding instance object is created for each associated role object. The instance object corresponding to each associated role object contains the function in the corresponding function set, so that when the instance object corresponding to each associated role object is run, each instance object runs the contained function, thereby realizing the operation of the model training framework, so as to realize the model training task later. Based on this method, developers only need to learn the universal controller to realize the training tasks using multiple model training frameworks, and no longer need to learn the controller corresponding to each model training framework, which saves development time and thus saves labor costs.

[0128] In some embodiments, the framework operation information further includes the first instance number corresponding to each role object information; based on the function set corresponding to the associated role object, creating an instance object for each associated role object respectively includes:

[0129] Based on the first instance number corresponding to each role object information and the function set corresponding to each associated role object, instance objects corresponding to the first instance number are created for each associated role object.

[0130] The method provided by the embodiment of the present disclosure allows the user to configure any number of instances for each associated role object through simple configuration for training tasks corresponding to any model training framework. Through the universal controller provided by the present disclosure, based on the first number of instances and a set of functions corresponding to each associated role object, a corresponding number of instance objects can be created for each associated role object to ensure the operating environment required for the training task. This process does not require the user to configure the logical code for creating instance objects for each associated role object, thereby ensuring the universality of the training task configuration, saving development time, and thus saving labor costs.

[0131] In some embodiments, the framework operation information includes multiple role object information and dependencies between the multiple role object information; running the instance object corresponding to each associated role object includes:

[0132] Run the instance object corresponding to the first type of role object among the multiple associated role objects, where the first type of role object is a role object that does not depend on other role objects;

[0133] When the instance object corresponding to the first type of role object has been run, the instance object corresponding to the second type of role object that depends on the first type of role object is run, and the second type of role object is a role object that depends on other role objects among multiple associated role objects.

[0134] By configuring the dependency relationship between each role object information in the model training in the training task, the instance objects corresponding to each associated role object can be run in sequence according to the dependency order between the role object information, thereby ensuring the accuracy of the model training framework.

[0135] In some embodiments, both the instance object and the function set corresponding to the second-class role object include a dependency function, and the dependency function indicates the first-class role object on which the second-class role object depends; when the instance object corresponding to the first-class role object has been run, running the instance object corresponding to the second-class role object that depends on the first-class role object includes:

[0136] Run the dependency function in the instance object corresponding to the second type of role object;

[0137] Through the dependency function, monitor the instance object corresponding to the first type of role object that the second type of role object depends on;

[0138] When it is determined that the instance object has been run, run the instance object corresponding to the second type of role object.

[0139] For the second-type role objects that depend on other role objects, the instance objects corresponding to the second-type role objects contain dependency functions. A monitoring method is adopted to monitor the instance objects corresponding to the dependent role objects through the dependency functions to ensure that the instance objects corresponding to the second-type role objects can be run in time, thereby ensuring the operating efficiency of the model training framework.

[0140] In some embodiments, monitoring the instance object corresponding to the first type of role object that the second type of role object depends on through the dependency function includes:

[0141] Through the dependency function, the address of the instance object corresponding to the first type of role object that the second type of role object depends on is monitored. The address is cached by the controller when the instance object corresponding to the first type of role object runs successfully.

[0142] When it is determined that the instance object has been run, the instance object corresponding to the second type of role object is run, including:

[0143] In response to the monitored address, the instance object corresponding to the second type of role object is run.

[0144] The address of the instance object corresponding to the dependent role object is monitored through the dependency function to determine whether the dependent role object has been running, so that the instance object corresponding to the second type of role object can be run in time, thereby ensuring the operating efficiency of the model training framework.

[0145] In some embodiments, after running the instance object corresponding to each associated role object, the method further includes:

[0146] A communication service is created for each associated role object, and the communication service is used to implement communication between instance objects corresponding to at least one associated role object.

[0147] By creating a communication service for each associated role object, multiple instance objects can communicate with each other during the subsequent operation of the model training framework, thereby ensuring the normal progress of the training task.

[0148] In some embodiments, after running the instance object corresponding to each associated role object, the method further includes:

[0149] In response to any instance object failing to run, and the framework running information includes a failure restart parameter corresponding to the associated role object to which the instance object belongs, restart the instance object.

[0150] In the disclosed embodiments, failure restart parameters corresponding to each associated role object can be configured in the training task, and the running status of each instance object can be monitored so that when any instance object fails to run and has a corresponding failure restart parameter, the instance object can be restarted. The restarted instance object can run the included functions to ensure the normal operation of the training task and improve the efficiency of training the network model.

[0151] In some embodiments, the framework operation information further includes a state determination strategy, the state determination strategy indicates a state of an instance object corresponding to a role object indicated by at least one role object information, and a strategy for determining a state of a training task; after running the instance object corresponding to each associated role object, the method further includes:

[0152] The controller uses a state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task.

[0153] The method provided by the embodiment of the present disclosure configures a state determination strategy in the training task, and the state determination strategy indicates a strategy for determining the state of the training task by the state of the instance object corresponding to the role object indicated by at least one role object information. During the operation of the model training framework, the controller can monitor the state of each instance object and the state of the training task, adopt the state determination strategy, and determine the state of the training task based on the state of each instance object to determine whether the training task is completed, thereby realizing the monitoring of the training task.

[0154] In some embodiments, the state determination strategy includes a first strategy corresponding to each role object information and a second strategy corresponding to the training task, the first strategy is a strategy for determining the state of the associated role object by the state of the instance object corresponding to the associated role object indicated by the role object information, and the second strategy is a strategy for determining the state of the training task by the state of the associated role object;

[0155] The controller uses a state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task, including:

[0156] By means of the controller, the first strategy corresponding to each role object information is adopted to process the state of the instance object corresponding to each associated role object respectively, so as to obtain the state of each associated role object;

[0157] Through the controller, the second strategy is adopted to process the state of each associated role object to obtain the state of the training task.

[0158] By configuring strategies for determining different states in the training task, during the running of the model training framework, the controller can use different strategies to monitor different types of states, thereby realizing the monitoring of the training task.

[0159] In some embodiments, the controller uses a state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task, including:

[0160] Through the controller, at each target duration, a state determination strategy is adopted to process the state of the instance object corresponding to at least one associated role object to obtain the updated state of the training task.

[0161] In the process of running the model training framework, the controller updates the status of the training task every target time interval to ensure that the status of the training task matches the current process, thereby ensuring the accuracy of the status of the training task.

[0162] In some embodiments, the method further comprises:

[0163] In response to the training task being in an ending state, the model training framework is stopped.

[0164] In the process of running the model training framework, by monitoring the status of the training task, once it is determined that the status of the training task is ended, the running model training framework is stopped, thus avoiding the situation where the training task has ended but still occupies resources, thereby saving resources.

[0165] In some embodiments, obtaining a training task through a controller includes:

[0166] Through the controller, obtain the training tasks to be processed from the task queue corresponding to the controller;

[0167] In response to the training task being in an end state, after stopping the model training framework, the method further includes:

[0168] Clear the data generated when running the model training framework.

[0169] After the training task is completed, clear the data generated when running the model training framework to save storage resources.

[0170] In some embodiments, the framework running information further includes the first instance number corresponding to each role object information; after running the instance object corresponding to each associated role object, the method further includes:

[0171] By means of the controller, based on the first instance number corresponding to each role object information, the second instance number of the instance object corresponding to each associated role object is verified;

[0172] Through the controller, when the first instance number and the second instance number corresponding to any associated role object are different, the instance object corresponding to the associated role object is updated based on the difference between the first instance number and the second instance number, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number.

[0173] In the process of running the model training framework, the controller verifies the number of instance objects corresponding to each associated role object and the number required in the training task to ensure that the number of instance objects corresponding to each associated role object matches the required number, thereby ensuring the accuracy of the operating environment provided for the model training framework and providing support for the training of the network model.

[0174] In some embodiments, by the controller, when the first instance number and the second instance number corresponding to any associated role object are different, based on the difference between the first instance number and the second instance number, the instance object corresponding to the associated role object is updated so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number, including:

[0175] By means of the controller, when the second instance number corresponding to the associated role object is less than the first instance number, creating instance objects of the difference number for the associated role object, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number; or

[0176] By means of the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, instance objects of the difference number are deleted from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number.

[0177] When the number of instance objects corresponding to any associated role object is different from the required number, different methods are used to update the instance objects corresponding to the associated role object to ensure that the number of instance objects matches the required number, thereby ensuring the accuracy of the model training framework.

[0178] In some embodiments, when the second instance number corresponding to the associated role object is greater than the first instance number, deleting instance objects of the difference number from the instance objects corresponding to the associated role object so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number, by the controller, includes:

[0179] By means of the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, the instance objects with the difference number and failed to run are deleted from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number; or

[0180] Through the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, the instance object with the difference number and the shortest running time is deleted from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number.

[0181] When the number of instance objects corresponding to the associated role object is greater than the required number, different methods can be used to delete the instance objects, which enriches the methods of deleting instance objects and ensures that the number of instance objects matches the required number, thereby ensuring the accuracy of the model training framework.

[0182] In some embodiments, before obtaining, by the controller, the model training framework indicated by the framework identifier, the method further includes:

[0183] Verify the training task through the controller;

[0184] Through the controller, obtain the model training framework indicated by the framework identifier, including:

[0185] In response to successful verification of the training task, a model training framework indicated by the framework identifier is obtained through the controller.

[0186] Before running the model training framework, the training task is verified to ensure that the training task meets the requirements, thereby ensuring that the model training framework can be run normally in the future, avoiding problems during the operation process, and reducing the error rate.

[0187] In some embodiments, the training task further includes an address corresponding to the framework identifier; obtaining, by the controller, a model training framework indicated by the framework identifier, including:

[0188] Get the model training framework from the address corresponding to the framework identifier through the controller.

[0189] The model training framework is obtained by configuring the address of the model training framework, thereby ensuring the convenience of obtaining the model training framework.

[0190] In the above Figure 2 On the basis of the illustrated embodiment, a controller is used to create multiple instance objects for the model training framework, and the operation of the model training framework is realized by running multiple instance objects. During the operation of the model training framework, the status of the training task is obtained. After the training task is completed, the model training framework is stopped and the data generated during the operation is cleared. The detailed process is described in the following embodiment.

[0191] Figure 3 is a flowchart of a method for executing a training task according to an exemplary embodiment. Figure 3 , performed by the electronic device, including the following steps:

[0192] 301. The electronic device obtains the training task to be processed from the task queue corresponding to the controller through the controller.

[0193] Among them, the controller is a general controller for running a model training framework, for example, the controller is AresOperator (a controller). The training task is used to train an artificial intelligence neural network model, for example, the training task is AresJob (a training task). The framework identifier included in the training task indicates the model training framework corresponding to the training task. In some embodiments, the framework identifier includes at least one of the framework name of the model training framework or the storage address corresponding to the training framework. In some embodiments, different model training frameworks belong to different framework types, and the framework identifier is the framework type of the model training framework. The framework operation information in the training task includes at least one role object information, and the at least one role object information indicates the role object associated with the training task in the model training framework. In some embodiments, the role object information includes the name or role object identifier of the corresponding role object. The training task is to be represented by a structure that matches the controller. For example, the structure that matches the controller is a structure defined by AresJob (a structural form). In some embodiments, the training task can be represented by a file in any format, for example, the training task is represented by a file in YAML (a format for expressing data serialization) format, or, in JSON (a lightweight data exchange format) format. In some embodiments, the training task is represented in the form of a file, and the training task file includes a framework identification field and a framework operation information field, the framework identification field includes a framework identification, and the framework operation information field includes framework operation information. Among them, the training task file includes multiple fields, different fields contain different information, and each field can be represented in any form. For example, the framework identification field and the framework operation information field are both stored in the training task file in the form of configuration.

[0194] In the disclosed embodiment, the controller corresponds to a task queue, which includes at least one training task to be processed, each training task is used to train a network model, and different training tasks may be used to train different network models. The framework identifiers contained in different training tasks may be different, that is, the task queue may include training tasks for training different network models based on different model training frameworks, and the controller can execute the training tasks in the task queue respectively and complete each training task in turn.

[0195] In the disclosed embodiment, the controller is a universal controller for executing training tasks, which is equivalent to the operation entry of the model training framework. For training tasks containing framework identifiers of different model training frameworks, the model training framework corresponding to the training task can be run through the controller and the training task to ensure that the model training framework can run, so that a network model can be trained based on the running model training framework, which is applicable to a variety of different model training frameworks, thereby realizing the universality of the controller.

[0196] In some embodiments, the framework operation information also includes first framework information and second framework information, wherein the first framework information indicates the state expected to be achieved when the model training framework is running, and the second framework information is the information to be monitored during the operation of the model framework.

[0197] For example, the first framework information includes at least one of a scheduling strategy, available ports, framework-specific parameters, role object definitions, and a second strategy. Among them, the scheduling strategy indicates a strategy for scheduling instance objects corresponding to the model training framework. For example, the scheduling strategy indicates whether to use the default scheduler or the group scheduler. The scheduling strategy can indicate how the instance objects created for the model training framework are distributed on different servers. For example, the default scheduler is the scheduler in Kubernetes (a container orchestration engine), and the group scheduler is the scheduler corresponding to the model training framework. Framework-specific parameters are used to configure parameters unique to the model training framework. In the disclosed embodiment, different model training frameworks may include the same parameters or may include parameters unique to each model training framework. Therefore, framework-specific parameters are configured in the first framework information to configure parameters unique to each model training framework. Based on the characteristic parameters of the framework, the controller can support the parameters of the custom model training framework. For the model training framework independently developed by the user, when configuring the training task, the unique parameters of the independently developed model training framework are configured in the characteristic parameters of the framework, so that the operation of the model training framework independently developed by the user can be realized based on the controller later, so that the method provided by the embodiment of the present disclosure can be applied not only to the general model training framework, but also to the model training framework independently developed by the user. The available port indicates the number of available ports of the model training framework, the role object defines the parameters for configuring the role objects included in the model training framework, and the second strategy indicates the strategy for determining the status of the training task based on the status of the associated role object.

[0198] For another example, the scheduling strategy includes a minimum available value, a queue, and a priority class. The minimum available value indicates the number of minimum available instance objects in the scheduling strategy, and the queue indicates the resource group used when scheduling the instance object. That is, when scheduling the instance object, it is necessary to implement it based on the resource group indicated by the queue. The priority class indicates the priority level between the data that the instance object needs to process. Based on the minimum available value, queue, and priority class in the scheduling strategy, the instance object corresponding to the model training framework can be scheduled, so that the network model can be trained based on the running instance object.

[0199] For another example, the role object definition includes the first instance number corresponding to the role object information, the definition of the instance object corresponding to the role object information, the instance object restart strategy corresponding to the role object information, the first strategy, and the dependency relationship between the multiple role object information included in the model training framework. Among them, the first instance number is the number of instances of the instance objects expected to be created for the associated role object when the model training framework is running. The instance object definition is used to configure the meaning of the instance object corresponding to the associated role object. For example, the instance object definition includes the container required to create the instance object, the function contained in the instance object, and the operating environment in which the instance object is located. The instance object restart strategy indicates the strategy for restarting after the instance fails to run. For example, the instance object restart strategy corresponding to the role object information indicates whether the instance object corresponding to the associated role object indicated by the role object information is restarted after the failure of running. The first strategy indicates a strategy for determining the state of the associated role object based on the state of the instance object corresponding to the associated role object indicated by the role object information. The dependency indicates the dependency between multiple role objects. For example, the dependency is DependencySpec (a dependency). For example, the plurality of associated role objects include associated role object 1 , associated role object 2 , and associated role object 3 . The associated role object 1 depends on the associated role object 2 , and the associated role object 2 depends on the associated role object 3 .

[0200] For example, the second framework information includes at least one of the status of the training task, the status of the role object, the start time, the running time, and the completion time. The status of the training task is the current state of the training task, such as the status of the training task includes the pending state, the starting state, the running state, and the end state, and the end state includes the success state or the failure state. The start time indicates the time when the training task starts to start, the running time is the time when the training task starts to run, and the completion time is the time when the training task is completed.

[0201] For another example, in the process of running the model training framework, the status of the role object expected to be monitored includes the current status of the role object, the reason for the current status, the information of the current status, the time of the last status change, the number of instance objects in the running state, the number of instance objects in the successful state, the number of instance objects in the failed state, the number of instance objects in the waiting state, the number of instance objects in the unknown state, and the number of instance objects in the ending state. Among them, the current status of the role object includes the starting state, the running state, the successful state or the failed state. The reason for the current state and the information of the current state are used to describe the current state of the role object. For example, the current state of the role object is: the running state, the reason for the current state is that the instance object corresponding to the role object is running, and the information of the current state is that the model training framework is running. The time of the last status change indicates the time when the status of the role object was last updated. The number of instance objects in the running state, the number of instance objects in the successful state, the number of instance objects in the failed state, the number of instance objects in the waiting state, the number of instance objects in the unknown state and the number of instance objects in the ending state respectively represent the number of instance objects in different states in the instance objects corresponding to the role objects. Among them, the state of the instance corresponding to the role object includes at least one of the running state, the successful state, the failed state, the waiting state, the unknown state and the ending state. The running state indicates that the instance object is running, the successful state indicates that the instance object has been successfully completed, the failed state indicates that the instance object has failed to run, the waiting state indicates that the instance object is in a state of waiting to be started or waiting to be created, and the ending state indicates that the instance object is running and is about to run. The unknown state indicates that the state of the instance object cannot be monitored at present. For example, the server where the instance object is located is in an abnormal state, and the current state of the instance object cannot be monitored through the controller. Therefore, it is determined that the instance object is in an unknown state.

[0202] In some embodiments, the training task is generated based on the task template corresponding to the controller. The task template is used to indicate the parameters contained in the training task that the controller can execute, and these parameters are data structures in the task template. For example, the task template includes a framework identification template and a framework operation information template. When the user needs the controller to execute a training task, based on the task template corresponding to the controller, the task template is configured to obtain a training task, and then the training task is submitted to the task queue corresponding to the controller, and the controller subsequently executes the training task.

[0203] In a possible implementation of the above embodiment, the user configures the task template based on the parameters in the model training framework to be used in the training task to obtain the training task, and the framework operation information in the training task is the information and control strategy contained in the model training framework. For example, the user obtains the task template, determines the parameters to be configured in the task template, fills them in the task template based on the parameters of the model training framework to be used, and uses the filled task template as the training task.

[0204] In some embodiments, the model training framework includes information for training the network model. For example, the model training framework includes functions used to train the network model and data corresponding to the functions. When the model training framework is running, the functions in the model training framework are run, and the data corresponding to the functions are processed by the running functions, so as to train the network model.

[0205] In some embodiments, the controller is a plug-in in a container orchestration engine, and 301 includes: running the controller while running the container orchestration engine; and obtaining, through the controller, training tasks to be processed from a task queue corresponding to the controller.

[0206] The container orchestration engine is used to orchestrate multiple containers, for example, the container orchestration engine is Kubernetes. The container orchestration engine has multiple functions, and the controller is developed based on the container orchestration engine, which is equivalent to one of the multiple functions of the container orchestration engine.

[0207] In a possible implementation of the above embodiment, the electronic device is provided as a server, and a method of adding a training task to a task queue includes: a client corresponding to the container orchestration engine is installed on the terminal, and the terminal sends a task training request to the server based on the client, and the task training request carries the training task; after the server receives the task training request based on the container orchestration engine, the server adds the training task carried by the task training request to the task queue corresponding to the controller.

[0208] In the disclosed embodiment, the server provides services for the container orchestration engine, and the server can provide task training services based on the container orchestration engine. The user configures the training task through the terminal, and the terminal sends the configured training task to the server through the client corresponding to the container orchestration engine. The server adds the training task to the task queue corresponding to the controller through the container orchestration engine, so that the controller can obtain the training task to be processed from the task queue for training.

[0209] For example, the task training request sent by the user terminal to the server based on the client also carries a controller identifier. After receiving the task training request, the server adds the training task to the task queue corresponding to the controller indicated by the controller identifier.

[0210] It should be noted that the embodiment of the present disclosure obtains the training task from the task queue, while in another embodiment, there is no need to execute step 301, and other methods can be adopted to obtain the training task through the controller.

[0211] 302. The electronic device obtains, through a controller, a model training framework indicated by a framework identifier in the training task.

[0212] In the disclosed embodiment, the training task includes a framework identifier, that is, the training task specifies the model training framework to be used when executing the training task. The controller obtains the model training framework indicated by the framework identifier so that the model training framework can be run later to train a network model.

[0213] In some embodiments, 302 includes: the electronic device obtains the model training framework from the address corresponding to the framework identifier through a controller.

[0214] In the disclosed embodiment, the training task also includes an address corresponding to the framework identifier, and the model training framework indicated by the framework identifier is stored at the address. The electronic device obtains the model training framework from the address through the controller. The model training framework is obtained by configuring the address of the model training framework, thereby ensuring the convenience of obtaining the model training framework.

[0215] 303. The electronic device verifies the training task through the controller.

[0216] In the disclosed embodiment, before executing the training task, the training task needs to be verified. The training task will be executed only if the verification is successful, so as to avoid errors in the process of executing the training task, thereby reducing the error rate of the training task.

[0217] In some embodiments, 303 includes: performing format verification on the training task through the controller, and determining that the training task verification has passed in response to the format of the training task meeting the requirements, and determining that the training task verification has failed in response to the format of the training task not meeting the requirements.

[0218] In the disclosed embodiment, the training task includes a framework identifier and framework operation information. Both the framework identifier and the framework operation information have corresponding formats. The training task is format checked to verify whether the training task configuration is accurate.

[0219] In a possible implementation of the above embodiment, the training task includes multiple fields, and different fields represent different information. The process of format checking the training task includes: format checking the multiple fields, and determining that the training task has passed the verification in response to the formats of the multiple fields meeting the requirements, and determining that the training task has failed the verification in response to the format of any field not meeting the requirements. Format checking is performed on multiple fields to determine whether the training task meets the format requirements. For example, the training task includes the first instance number corresponding to the role object information, and the first instance number should be an integer greater than 0. If the number in the field representing the first instance number in the training task is less than 0, it means that the format of the field does not meet the format requirements, and it is determined that the training task has failed the verification.

[0220] In some embodiments, the training task includes multiple fields, the multiple fields include a default field, and the method further includes: through the controller, checking the multiple fields in the training task, and in response to any default field being empty, filling the field with a default value.

[0221] In an embodiment of the present disclosure, multiple fields in a training task include a default field, and the default field has a default value. When configuring a training task, a user can fill in any value that meets the format requirements in the default field, or can not fill in the default field. If the user fills in a value in the default field, when the training task is subsequently executed, the model training framework will be run according to the filled value in the default field; if the user does not fill in the default field, when the training task is verified, the default value corresponding to the default field is filled in the default field, and when the training task is subsequently executed, the model training framework will be run according to the default value in the default field.

[0222] For example, the default field is the first policy field, and the default value of the first policy field is: for multiple instance objects corresponding to the associated role object, if any instance object fails to run, the associated role object fails to run; if the fill value in the first policy field in the training task indicates that for multiple instance objects corresponding to the associated role object, the multiple instance objects all fail to run, then the associated role object fails to run, and when the status of the associated role object is subsequently determined based on the status of the multiple instance objects, it is determined according to the filled value; if the first policy field in the training task is empty, the corresponding default value is filled in the first policy field, and when the status of the associated role object is subsequently determined based on the status of the multiple instance objects, it is determined according to the default value.

[0223] It should be noted that the embodiment of the present disclosure first obtains the model training framework and then verifies the training task, while in another embodiment, the training task can be verified through the controller first, and when the training task is verified successfully, the model training framework indicated by the framework identifier is obtained through the controller.

[0224] 304. In response to successful verification of the training task, the electronic device, through a controller, determines the role object indicated by at least one role object information in the model training framework as an associated role object of the training task, and based on the function set corresponding to the associated role object, creates a corresponding first number of instance objects for each associated role object, and the instance objects contain functions in the corresponding function set.

[0225] In an embodiment of the present disclosure, the framework running information includes at least one role object information and a first instance number corresponding to each role object information, each role object information indicates a role object in the model training framework, and the role object indicated by the at least one role object information is a role object associated with the training task in the model training framework, that is, each role object information indicates an associated role object. The first instance number is the number of instance objects specified by each role object information, that is, it indicates the number of instance objects expected to be created for each associated role object when running the model training framework, and the instance objects are used to run the included functions. The model training framework includes a function set corresponding to each role object, and the function set includes functions for training network models; subsequently, when the model training framework is running, that is, running the functions in the function set corresponding to each associated role object, the network model training process can be implemented, thereby training a network model.

[0226] For each associated role object, the controller creates a corresponding first instance number of instance objects for the associated role object based on the first instance number corresponding to the role object information and the function set corresponding to the associated role object indicated by the role object information, and the instance object contains the functions in the function set corresponding to the associated role object. For example, if the first instance number corresponding to any role object information is 3, the controller creates 3 instance objects for the associated role object indicated by the role object information, and each instance object contains the functions in the function set corresponding to the associated role object. In the disclosed embodiment, the model training framework includes a function set corresponding to each role object, and the training task has specified the associated role objects associated with the training task and the first instance number corresponding to each associated role object. According to the first instance number corresponding to each associated role object, a corresponding number of instance objects are created for each associated role object, and the object instance corresponding to each associated role object is subsequently run, that is, each object instance runs the contained function, thereby realizing the running of the model training framework.

[0227] In some embodiments, the number of at least one role information may be the same as or different from the number of role objects included in the model training framework. If the number of at least one role information is the same as the number of role objects included in the model training framework, it means that all role objects in the model training framework are associated with the training task, that is, each role object in the model training framework is an associated role object; if the number of at least one role information is different from the number of role objects included in the model training framework, it means that some role objects in the model training framework are associated with the training task, that is, some role objects in the model training framework are associated role objects.

[0228] In some embodiments, the training task also includes a scheduling strategy, then 304 includes: in response to the successful verification of the training task, the electronic device adopts the scheduling strategy through the controller, and based on the first instance number corresponding to each role object information and the function set corresponding to each associated role object, creates a corresponding first instance number of instance objects for each associated role object, and deploys the instance object corresponding to at least one associated role object on different servers.

[0229] In the disclosed embodiment, the scheduling strategy indicates the strategy for scheduling instance objects corresponding to the model training framework. When creating an instance object for each associated role object in the model training framework, the scheduling strategy is adopted, and the created instance objects can be deployed on different servers. After that, the instance objects on different servers are run, thereby realizing the operation of the model training framework. By adopting a scheduling strategy to deploy multiple instance objects on different servers, the requirements for server configuration when executing training tasks can be reduced, and the running speed of instance objects can also be improved.

[0230] It should be noted that the embodiment of the present disclosure first verifies the training task. Only when the training task verification is successful will the controller be used to create the corresponding first number of instance objects for each associated role object. In another embodiment, there is no need to execute 303-304. After obtaining the model training framework, the controller is used directly to create the corresponding first number of instance objects for each associated role object based on the first number of instances corresponding to each role object information and the function set corresponding to each associated role object.

[0231] 305. The electronic device runs the instance object corresponding to each associated role object.

[0232] The electronic device realizes the operation of the model operation framework by running the instance object corresponding to each associated role object, so that each running instance object can run the included function and train the network model based on the running function. Through the universal controller provided by the present disclosure, at least one role object information and the first instance number corresponding to each role object information are configured in the training task, and a corresponding number of instance objects can be created for the associated role objects indicated by each role object information, so that the instance object can run the function in the corresponding function set. Running the instance object corresponding to each associated role object is equivalent to realizing the operation of the model training framework, which is simple to configure and can save development time, thereby saving labor costs.

[0233] In some embodiments, the framework operation information includes multiple role object information and dependencies between the multiple role object information; the process of running the instance object corresponding to each associated role object includes the following 3051-3052:

[0234] 3051. The electronic device runs an instance object corresponding to a first type of role object among multiple associated role objects.

[0235] Among them, the first type of role object is a role object that does not depend on other role objects. In the embodiment of the present disclosure, the framework operation information includes multiple role object information, among which there is a dependency relationship between the multiple role object information. For example, the multiple role object information includes role object information 1 and role object information 2, and role object information 1 depends on role object information 2. Based on the dependency relationship between the multiple role object information, the associated role objects indicated by the multiple role object information are divided into the first type of role objects and the second type of role objects. The first type of role objects are role objects that do not depend on other role objects, and the second type of role objects are role objects that depend on other role objects. When running instance objects corresponding to multiple associated role objects, according to the dependency relationship between the multiple associated role objects, the first type of role objects that do not depend on other role objects are run first.

[0236] 3052. When the instance object corresponding to the first-type role object has been run, the electronic device runs the instance object corresponding to the second-type role object that depends on the first-type role object.

[0237] Among them, the second-class role object is a role object that depends on other role objects among multiple associated role objects. For any second-class role object, if the instance object corresponding to the first-class role object that the second-class role object depends on has been run, the second-class role object is run. By configuring the dependency relationship between the information of each role object in model training in the training task, the instance objects corresponding to each associated role object can be run in sequence according to the dependency order between the information of each role object, thereby ensuring the accuracy of the operation of the model training framework.

[0238] In some embodiments, the first type of role object that the second type of role object depends on corresponds to multiple instance objects, and 3052 includes: running the second type of role object when the multiple instance objects corresponding to the first type of role object are all running.

[0239] In some embodiments, the instance object and function set corresponding to the second-class role object both include a dependency function, and the dependency function indicates the first-class role object on which the second-class role object depends; the 3052 includes: running the dependency function in the instance object corresponding to the second-class role object; monitoring the instance object corresponding to the first-class role object on which the second-class role object depends through the dependency function; and running the instance object corresponding to the second-class role object when it is determined that the instance object has been running.

[0240] In an embodiment of the present disclosure, the instance object corresponding to the second type of role object includes a dependency function, and the function set corresponding to the second type of role object also includes the dependency function, and the dependency function indicates the first type of role object on which the second type of role object depends. In some embodiments, the dependency function in the function set corresponding to the second type of role object is added in the function set based on the dependency relationship between multiple role object information before creating the instance object corresponding to the second type of role object. When creating an instance object for the second type of role object, the instance object created based on the added function set includes the dependency function. For example, through the controller, based on the dependency relationship between multiple role object information in the training task, the dependency function is added to the function set corresponding to the second type of role object. After that, based on the first number of instances corresponding to each role object information and the function set corresponding to each associated role object, the instance objects corresponding to the first number of instances are created for each associated role object, and the instance objects include the functions in the corresponding function set, that is, the instance objects corresponding to the second type of role include the dependency function. For another example, the controller is a plug-in in the container orchestration engine. Through the controller, the initContainer (a type of container) method provided by the container orchestration engine is adopted to add a dependency function to the function set corresponding to the second type of role object based on the dependency between multiple role object information in the training task.

[0241] In the disclosed embodiment, after the corresponding instance object is created for each associated role object, the instance object corresponding to each associated role object is started at the same time. For the instance object corresponding to the first type of role object that does not depend on other role objects, the instance object runs normally according to the function contained in the instance object. For the instance object corresponding to the second type of role object that depends on other role objects, when starting the instance object, the dependency function in the instance object is run first, and the instance object corresponding to the role object that the second type of role object depends on is monitored through the dependency function. When it is monitored that the instance objects corresponding to the role objects that the second type of role object depends on have all run, the instance object will continue to run, and then run successfully, so that the instance object is switched from the startup state to the running state.

[0242] For the second-type role objects that depend on other role objects, the instance objects corresponding to the second-type role objects contain dependency functions. A monitoring method is adopted to monitor the instance objects corresponding to the dependent role objects through the dependency functions to ensure that the instance objects corresponding to the second-type role objects can be run in time, thereby ensuring the operating efficiency of the model training framework.

[0243] In a possible implementation of the above embodiment, the second-class role object corresponds to multiple instance objects, each instance object contains the dependency function, and in the process of running the multiple instance objects corresponding to the second-class role object, the dependency function in each instance object is run, and the instance object corresponding to the first-class role object on which the second-class role object depends is monitored through the dependency function in each instance object; when it is determined that the instance object corresponding to the first-class role object on which the second-class role object depends has been run, each instance object corresponding to the second-class role object is run.

[0244] When there are multiple instance objects corresponding to the second-class role object, different instance objects respectively monitor based on the included dependency functions, and when it is determined that the instance object corresponding to the first-class role object on which the second-class role object depends has been run, each instance object corresponding to the second-class role object is run.

[0245] In a possible implementation of the above embodiment, the second-class role object corresponds to multiple instance objects, each instance object contains the dependency function, and in the process of running the multiple instance objects corresponding to the second-class role object, the dependency function in each instance object is run, and the instance object corresponding to the first-class role object on which the second-class role object depends is monitored through the dependency function in each instance object; when the dependency function in any instance object determines that the instance object has been run, each instance object corresponding to the second-class role object is run.

[0246] In the case where there are multiple instance objects corresponding to the second-class role object, different instance objects respectively monitor based on the included dependency functions, and when any dependency function monitors that the instance object corresponding to the first-class role object on which the second-class role object depends has been run, the multiple instance objects corresponding to the second-class role object are run. For example, when any dependency function monitors that the instance object corresponding to the first-class role object on which the second-class role object depends has been run, the dependency function notifies each instance object corresponding to the second-class role object and runs the multiple instance objects corresponding to the second-class role object.

[0247] In a possible implementation of the above embodiment, the address of the instance object corresponding to the first type of role object that the second type of role object depends on is monitored through a dependency function, and in response to the monitored address, the instance object corresponding to the second type of role object is run.

[0248] Among them, the address of the instance object is cached by the controller when the instance object corresponding to the first type of role object runs successfully. In the embodiment of the present disclosure, after each instance object runs successfully, the address of the instance object is cached through the controller, and the dependency function in the instance object corresponding to the second type of role object that depends on other role objects monitors the address of the instance object corresponding to the role object that the second type of role object depends on. When the address is monitored, it indicates that the instance object has been run, and then the instance object corresponding to the second type of role object will be run. The address of the instance object corresponding to the role object on which it depends is monitored through the dependency function to determine whether the role object on which it depends has been run, so that the instance object corresponding to the second type of role object can be run in time, thereby ensuring the running efficiency of the model training framework.

[0249] For example, Pytorch (a model training framework) includes workers (a role object) and masters (a role object). Workers need to obtain the address of the instance object corresponding to the master, run the instance object corresponding to the master first, and then run the instance object corresponding to the worker after the instance object corresponding to the master is running. In addition, workers communicate with the master based on the address of the instance object corresponding to the master. For another example, MPI (a model training framework) includes workers (a role object) and launchers (a role object). The instance object corresponding to the Launcher needs to obtain the addresses of the instance objects corresponding to all workers and wait until all workers are running before the instance object corresponding to the Launcher will run. Based on the address of the instance object corresponding to the worker, execution instructions are sent to the instance object corresponding to the worker, that is, communication between the instance object corresponding to the worker and the instance object corresponding to the launcher is realized.

[0250] For example, the process of monitoring the address of an instance object through a dependency function includes: through the controller, after any instance object runs successfully, the address of the instance object is cached in the cache server, after the dependency function in the instance object corresponding to the second-class role object runs, through the dependency function, a query request is sent to the cache server at each target duration, the cache server sends the cache information corresponding to the training task to the dependency function based on the query request, receives the cache information through the dependency function, queries whether the cache information includes the address of each instance object corresponding to the role object that the second-class role object depends on, and in response to the cache information including the address of each instance object corresponding to the role object that the second-class role object depends on, runs the instance object corresponding to the second-class role object. Among them, the target duration is an arbitrary duration. By adopting a polling mechanism, the dependency function interacts with the cache server to ensure that the instance object corresponding to the second-class role object can run in a timely manner.

[0251] For example, the process of monitoring the address of an instance object through a dependency function includes: through the controller, after any instance object runs successfully, the address of the instance object is cached in the cache server, after the dependency function in the instance object corresponding to the second-class role object runs, through the dependency function, a query request is sent to the cache server at each target time interval, the cache server queries the address of the instance object corresponding to the role object that the second-class role object depends on based on the query request, after querying the address of the instance object corresponding to the role object that the second-class role object depends on, a confirmation message is sent to the dependency function, and after obtaining the confirmation message through the dependency function, the instance object corresponding to the second-class role object is run. The confirmation message indicates that the instance object corresponding to the role object that the second-class role object depends on has been run.

[0252] For example, if the controller is a plug-in in a container orchestration engine, the process of caching the address of the instance object through the controller includes: obtaining the address of the running instance object through the container orchestration engine, sending the address to the controller, and caching the address of the instance object in the cache server through the controller.

[0253] For another example, training task 1 includes role object information 1 and role object information 2. The number of instance objects corresponding to role object information 1 is 1, and the number of instance objects corresponding to role object information 2 is 3. Role object information 1 depends on role object 2. When the three instance objects corresponding to role object information 2 have all run successfully, the container orchestration engine obtains the addresses of the three instance objects corresponding to the associated role object indicated by role object information 2, and sends the addresses to the controller, which writes the addresses to the cache server. The dependency function in the instance object corresponding to the associated role object indicated by role object information 1 polls the cache server, and when it is determined that the three instance objects corresponding to the associated role object indicated by role object information 2 have all run, the instance object corresponding to the associated role object indicated by role object information 1 is run.

[0254] like Figure 4 As shown, Figure 4It is shown that the training task includes a launcher and a worker, the first instance number corresponding to the launcher is 1, the first instance number corresponding to the worker is 3, the launcher depends on the worker, and the controller is a plug-in in the container orchestration engine. Through the controller, before creating instance objects for the launcher and the worker, based on the dependency relationship between the launcher and the worker, a dependency function is added to the function set corresponding to the launcher, and then based on the function set corresponding to the launcher, an instance object (i.e., instance object 1) is created for the launcher, and based on the function set corresponding to the worker, three instance objects (i.e., instance object 2, instance object 3, and instance object 4) are created for the worker, and the three instance objects corresponding to the worker are run. Through the container orchestration engine, the instance information of the instance object corresponding to the worker is obtained, and the instance information of the instance object corresponding to the worker is sent to the controller. The controller caches the instance information of the instance object corresponding to the worker, which includes the address of the instance object, in the cache server. Run the initializer (a dependency function) module in the instance object corresponding to the launcher. Through the initializer module, poll the cache server, wait for all the instance objects corresponding to the worker to run, and write the addresses and other information of the instance objects corresponding to all the workers into the hostfile (host file) required by MPI (a model training framework). The instance objects corresponding to the launcher and the instance objects corresponding to the worker can communicate with each other.

[0255] It should be noted that in the embodiment of the present disclosure, when the training task is successfully verified, an instance object corresponding to each associated role object is first created, and then the created instance object is run, so as to represent the operation of the model training framework. In another embodiment, there is no need to execute steps 304-305, and other methods can be adopted. In response to the successful verification of the training task, the model training framework is run through the controller based on the framework operation information.

[0256] It should be noted that the embodiment of the present disclosure represents the operation of the model training framework by first verifying the training task and then running the instance object created for each associated role object. In another embodiment, there is no need to execute steps 303-305, and other methods can be adopted to run the model training framework through the controller based on the framework operation information.

[0257] In some embodiments, after step 305, the method further includes: creating a communication service for each associated role object, the communication service being used to implement communication between instance objects corresponding to at least one associated role object.

[0258] In the disclosed embodiment, the model training framework includes at least one role object. Instance objects corresponding to different role objects may need to communicate with each other. Therefore, a communication service is created for each associated role object. Based on the communication server corresponding to each associated role object, communication between instance objects corresponding to different associated role objects can be achieved. By creating a communication service for each associated role object, multiple instance objects can communicate with each other during the subsequent operation of the model training framework, thereby ensuring the normal progress of the training task.

[0259] In a possible implementation of the above embodiment, the controller is a plug-in in a container orchestration engine. The container orchestration engine provides a communication service object. Through the controller, a communication service is created for each associated role object based on the communication service object.

[0260] For example, the container orchestration engine is Kubernetes, and Kubernetes provides a native Service (communication service) object. The controller creates a communication service for each associated role object through the Service object. For example, the communication service created for each associated role object is an instance domain name (FQDN, Fully Qualifed Domain Name). Using the generated instance domain name, instance objects corresponding to different associated role objects can communicate with each other.

[0261] In some embodiments, after step 305, the method further includes: in response to any instance object failing to run, and the framework running information includes a failure restart parameter corresponding to the associated role object to which the instance object belongs, restarting the instance object.

[0262] Among them, the failure restart parameter indicates that when the instance object corresponding to the associated role object fails to run, the instance object is restarted. In the embodiment of the present disclosure, after running the instance object corresponding to each associated role object, due to the abnormality of the server where the instance object is located or the abnormality of the function contained in the instance object, the instance object corresponding to the associated role object will fail to run. During the running process, the running status of each instance object is monitored by the controller. If any instance object fails to run and the associated role object to which the instance object belongs corresponds to has a failure restart parameter, the instance object is restarted to ensure the normal operation of the model training framework.

[0263] In the disclosed embodiments, failure restart parameters corresponding to each associated role object can be configured in the training task, and the running status of each instance object can be monitored so that when any instance object fails to run and has a corresponding failure restart parameter, the instance object can be restarted. The restarted instance object can run the included functions to ensure the normal operation of the training task and improve the efficiency of training the network model.

[0264] In the disclosed embodiment, in the process of running the model training framework through the controller, a fault-tolerant processing mechanism is adopted. When the instance object fails to run and has a failure restart parameter, the instance object that failed to run is restarted. Through this fault-tolerant mechanism, the failure of any instance object leading to the failure of the training task is avoided, thereby improving the success rate of the training task.

[0265] 306. The electronic device processes the state of the instance object corresponding to each associated role object by using a state determination strategy through a controller to obtain the state of the training task.

[0266] In an embodiment of the present disclosure, the framework operation information also includes a state determination strategy, which indicates the state of the instance object corresponding to the role object indicated by at least one role object information, and determines the strategy for determining the state of the training task. In some embodiments, the state determination strategy is configured by the developer. During the operation of the model training framework, the states of different instance objects may be different, and the states of the instance objects include startup state, running state, completion state, failure state, etc. Since running instance objects corresponding to multiple associated role objects is equivalent to running the model training framework, the state determination strategy is adopted, and based on the state of each instance object, the state of the entire training task can be determined, thereby realizing the state monitoring of the training task.

[0267] In some embodiments, the state determination strategy includes a first strategy corresponding to each role object information and a second strategy corresponding to the training task, the first strategy is a strategy for determining the state of the associated role object by the state of the instance object corresponding to the associated role object indicated by the role object information, and the second strategy is a strategy for determining the state of the training task by the state of the associated role object; 306 includes: through the controller, using the first strategy corresponding to each role object information, respectively processing the state of the instance object corresponding to each associated role object, to obtain the state of each associated role object; through the controller, adopting the second strategy, processing the state of each associated role object, to obtain the state of the training task.

[0268] Among them, each role object information corresponds to a first strategy, and the first strategies corresponding to different role object information may be the same or different. For any role object information, determine the state of the instance object corresponding to the associated role object indicated by the role object information, and through the controller, adopt the first strategy corresponding to the role object information, based on the state of the instance object corresponding to the associated role object, determine the state corresponding to the associated role object. According to the above method, the state corresponding to each associated role object can be determined, and through the controller, adopt the second strategy, based on the states of multiple associated role objects, determine the state of the entire training task. By configuring strategies for determining different states in the training task, in the process of running the model training framework, different types of states can be displayed for monitoring by adopting different strategies through the controller, thereby realizing the monitoring of the training task.

[0269] For example, the first policy corresponding to a role object information is: if any instance object fails, the associated role object indicated by the role object information fails. Then, if the state of any instance object corresponding to the associated role object is running, and the states of the other instance objects are running or successful, the state of the associated role object is running; if the state of any instance object corresponding to the associated role object is failed, and the states of the other instance objects are successful, the state of the associated role object is failed; if the states of all instance objects corresponding to the associated role object are successful, the state of the associated role object is successful. For another example, the first policy corresponding to a role object information is: if any instance object succeeds, the associated role object indicated by the role object information succeeds. Then, if all instance objects corresponding to the associated role object fail, the state of the associated role object is failed; if the state of at least one instance object corresponding to the associated role object is running, and the states of the other instance objects are running or failed, the state of the associated role object is running; if the state of at least one instance object corresponding to the associated role object is successful, the state of the associated role object is successful.

[0270] For example, the second strategy corresponding to the training task is: if any associated role object fails, the training task fails. Then, if the status of at least one associated role object is running, and the status of the remaining associated role objects is successful, the status of the training task is successful; if the status of any associated role object is failed, the status of the training task is failed. For another example, the second strategy corresponding to the training task is: if any associated role object succeeds, the training task succeeds. If the status of at least one associated role object is running, and the status of the remaining associated role objects is running or failed, the status of the training task is running; if the status of any associated role object is successful, the status of the training task is successful.

[0271] For example, a training task includes PS (role object 1), Hub (role object 2) and Train (role object 3), as well as the first strategy corresponding to each role object and the second strategy corresponding to the training task. The first strategy corresponding to PS is that if any instance object fails, the associated role object fails; the first strategy corresponding to Hub is that if any instance object fails, the associated role object fails; the first strategy corresponding to Train is that if any instance object fails, the associated role object fails, and if all instance objects succeed, the associated role object succeeds; the second strategy corresponding to the training task is that if any associated role object fails, the training task fails. During the operation of the model training framework, the operating status of the instance objects corresponding to each associated role object is monitored as follows: Figure 5 As shown, instance objects 1, 2, and 3 corresponding to PS are all in the running state. The first strategy corresponding to PS is adopted to determine that the state of PS is in the running state; instance object 4 corresponding to Hub is in the successful state, and the corresponding instance object 5 is in the failed state. The first strategy corresponding to Hub is adopted to determine that the state of Hub is the failed state; instance object 6 corresponding to Train is in the successful state. The first strategy corresponding to Train is adopted to determine that the state of Train is the successful state. Based on the state of PS, the state of Hub, and the state of Train, the second strategy is adopted to determine that the state of the training task is the failed state.

[0272] It should be noted that the embodiment of the present disclosure is explained by taking the acquisition of the state of a training task once as an example, while in another embodiment, during the operation of the model framework, the state of the training task can be iteratively updated at each target duration interval according to the above 306. In some embodiments, through the controller, at each target duration interval, a state determination strategy is adopted to process the state of the instance object corresponding to at least one associated role object to obtain the updated state of the training task. Among them, the target duration is an arbitrary duration. Since the state of each instance object will change during the operation of the model framework, which will cause the state of the training task to change, the state of the training task is updated in an iterative update manner to ensure that the acquired state of the training task always matches the actual operation of the model training framework. Through the controller, the state of the training task is updated once at each target duration interval, thereby ensuring that the state of the training task matches the current process, thereby ensuring the accuracy of the state of the training task.

[0273] 307. In response to the training task being in an end state, the electronic device stops running the model training framework.

[0274] In the embodiments of the present disclosure, the status of the training task includes multiple types. When the status of the training task is an end state, it indicates that the current training task has ended, and the model training framework is stopped. In some embodiments, the end state includes a success state or a failure state. The success state indicates that the training task has succeeded, and the failure state indicates that the training task has failed. When the status of the training task is a success state, it indicates that the network model has been trained and a trained network model has been obtained; when the status of the training task is a failure state, it indicates that the training network model has failed and a trained network model has not been obtained. In the process of running the model training framework, through the controller, the status of the training task can be determined based on the status of each instance object to determine whether the training task is completed, thereby realizing the monitoring of the training task.

[0275] In some embodiments, the training task includes a storage address of the network model, and the output address is used to store the successfully trained network model. In response to the status of the training task being a successful status, a trained network model is obtained and the network model is stored at the storage address.

[0276] In some embodiments, the model training framework includes a storage address, and when the status of the training task is a success state, the trained network model is stored at the output address through the output function in the model training framework. The output function is used to output the trained network model. When the operation of the model training framework ends and the status of the training task is a success state, indicating that the network model has been trained, the trained network model is stored at the storage address through the output function.

[0277] 308. The electronic device clears the data generated when running the model training framework.

[0278] When the training task is completed, clear the data generated when running the model training framework to save storage resources.

[0279] In some embodiments, step 308 includes: clearing the instance object created for the training task and the information cached in the cache server. The information cached in the cache server is stored by the controller when executing the training task. For example, the information stored in the cache server is the address of the instance object.

[0280] It should be noted that the above embodiment is described with one training task, while in another embodiment, the task queue includes multiple training tasks to be processed, and the multiple training tasks are arranged in the order of . The controller obtains a training task from the task queue, executes the training task according to 302-308 above, and obtains the next training task from the training task after the training task is completed, and executes the next training task according to 302-308 above. The disclosed embodiment is described with the example that the controller executes only one training task at a time, while in another embodiment, the controller can execute multiple training tasks at the same time, and the controller obtains multiple training tasks from the task queue, and obtains multiple training tasks from the task queue after the multiple training tasks are completed, and executes the newly obtained multiple training tasks.

[0281] The method provided by the embodiment of the present disclosure provides a universal controller that can be applied to multiple model training frameworks. When any model training framework is needed to train a network model, only one training task needs to be configured. The framework identifier and framework operation information of the model training framework to be used are specified in the training task. The role object information corresponding to the associated role object contained in the model training framework and associated with the training task is configured in the framework operation information, so that through the controller, based on the framework operation information and the function set corresponding to each associated role object in the model training framework, a corresponding instance object is created for each associated role object. The instance object corresponding to each associated role object contains the function in the corresponding function set, so that when the instance object corresponding to each associated role object is run, each instance object runs the contained function, thereby realizing the operation of the model training framework, so as to realize the model training task later. Based on this method, developers only need to learn the universal controller to realize the training tasks using multiple model training frameworks, and no longer need to learn the controller corresponding to each model training framework, which saves development time and thus saves labor costs.

[0282] In addition, the embodiment of the present disclosure provides a universal task template, and developers only need to implement simple configuration of the fields in the task template. Based on the task template, the operation entrances of various model training frameworks can be unified, and the parameters in various different model training frameworks can be unified to the greatest extent, thereby realizing a universal controller that provides services for multiple model training frameworks, thereby reducing development costs.

[0283] In addition, by configuring the dependencies between multiple role object information contained in the model training framework in the training task, a unified solution for the startup dependencies between associated role objects is implemented. The dependency function is injected into the instance object so that when the instance objects corresponding to different associated role objects are started, they are started in the order specified by the dependencies between the roles, which can ensure the normal operation of the model training framework.

[0284] In addition, the task template provided by the present invention adopts functional features required by various model training frameworks, such as fault-tolerant processing mechanism, deduction mechanism between the state of instance objects and the state of associated role objects, and deduction mechanism between the state of associated role objects and the state of training tasks, so that training tasks can be performed using the general controller provided by the present invention by simple configuration based on the task template, thereby realizing the versatility of the controller.

[0285] In the above Figure 3 On the basis of the illustrated embodiment, in the process of running the model training framework, the running model training framework can also be tuned once at every target time interval to iteratively update the status of the training task. The iterative update process is detailed in the following embodiment.

[0286] Figure 6 is a flowchart of a tuning process according to an exemplary embodiment. Figure 6 , performed by the electronic device, the tuning process includes the following steps:

[0287] 601. The electronic device verifies, through a controller, the second instance number of the instance object corresponding to each associated role object based on the first instance number corresponding to each role object information.

[0288] Among them, the first number of instances is included in the training task, and the first number of instances is the number of instances specified by the user for the associated role object, to indicate how many instance objects the user expects the associated role object to have when the model training framework is running. The number of instances corresponding to the associated role object is the number of instance objects that currently exist corresponding to the associated role object in the case of the model training running framework. In the embodiment of the present disclosure, during the operation of the instance object corresponding to each associated role object, due to the failure of the server where the instance object is located or other reasons, the instance object is lost or increased. Therefore, during the tuning process of the running model training framework by the controller, it is necessary to verify the number of instance objects corresponding to each associated role object and the number of instance objects specified for each associated role object to determine whether the number of instances specified for each associated role object is equal to the second number of instance objects that currently exist corresponding to each associated role object.

[0289] 602. When the first instance number and the second instance number corresponding to any associated role object are different, the electronic device updates the instance object corresponding to the associated role object based on the difference between the first instance number and the second instance number through the controller, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number.

[0290] For any associated role object, when the first instance number and the second instance number corresponding to the associated role object are different, the instance object corresponding to the associated role object is updated based on the difference between the first instance number and the second instance number, so that the instance number of the updated instance object corresponding to the associated role object is equal to the first instance number, that is, after the instance object corresponding to the associated role object is updated, the number of instance objects corresponding to the associated role object and currently existing is equal to the first instance number. In the process of running the model training framework, the number of instance objects corresponding to each associated role object is verified by the controller with the number required in the training task to ensure that the number of instance objects corresponding to each associated role object matches the required number, thereby ensuring the accuracy of the operating environment provided for the model training framework and providing support for the training of the network model.

[0291] In some embodiments, step 602 includes the following two methods:

[0292] The first method: through the controller, when the second instance number corresponding to the associated role object is less than the first instance number, create instance objects of the difference number for the associated role object, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number.

[0293] For example, the second instance number corresponding to the associated role object is 2, and the first instance number corresponding to the associated role object is 3, that is, the difference between the number of instance objects corresponding to the associated role object and currently existing and the first instance number is 1, then another instance object is created for the associated role object, so that the number of instance objects corresponding to the associated role object and currently existing is 3.

[0294] In some embodiments, the first method includes: using a scheduling strategy through the controller to create the difference number of instance objects for the associated role object, so that the number of instance objects corresponding to the associated role object is equal to the first number of instances.

[0295] The scheduling strategy indicates a strategy for distributing instance objects on different servers when creating instance objects. The controller uses the scheduling strategy to create instance objects of the difference number for the associated role object and deploy them on some servers so that the instance objects created on the server can run.

[0296] The second method: through the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, the instance objects of the difference number are deleted from the instance objects corresponding to the associated role object to make the instance number of the instance objects corresponding to the associated role object equal to the first instance number.

[0297] For example, the second instance number corresponding to the associated role object is 4, and the corresponding first instance number is 2, that is, the difference between the number of instance objects corresponding to the associated role object and currently existing and the first instance number is 2, then 2 instance objects are deleted from the 4 instance objects corresponding to the associated role object so that the instance number of instance objects corresponding to the associated role object is 2.

[0298] In some embodiments, when deleting instance objects of the difference number from the instance objects corresponding to the associated role object, the instance objects are selected for deletion according to the operation status of each instance object, that is, the process of deleting the instance objects includes the following two items:

[0299] Item 1: Through the controller, when the number of second instances corresponding to the associated role object is greater than the number of first instances, the instance objects with the difference number and that have failed to run are deleted from the instance objects corresponding to the associated role object, so that the number of instance objects corresponding to the associated role object is equal to the first number of instances.

[0300] In the embodiment of the present disclosure, an instance object may fail to run during its operation. If the instance data of an instance object corresponding to any associated role object is greater than the first instance number, the instance object that failed to run is deleted from the instance object corresponding to the associated role object to ensure that the instance number of the instance object corresponding to the associated role object is equal to the first instance number, and the instance objects that failed to run in the instance objects corresponding to the remaining associated role objects are reduced as much as possible.

[0301] Item 2: Through the controller, when the number of second instances corresponding to the associated role object is greater than the number of first instances, the instance objects with the difference number and the shortest running time are deleted from the instance objects corresponding to the associated role object, so that the number of instance objects corresponding to the associated role object is equal to the first number of instances.

[0302] In the embodiments of the present disclosure, each instance object has a corresponding running time. The longer the running time, the longer the normal operation time of the instance object. The shorter the running time, the time period in which the instance object was created or the instance object failed to run. Therefore, the instance objects with short running time are deleted to ensure that the instance objects corresponding to the associated role objects run as normally as possible, thereby ensuring the normal operation of the model training framework.

[0303] When the number of instance objects corresponding to the associated role object is greater than the required number, different methods can be used to delete the instance objects, which enriches the methods of deleting instance objects and ensures that the number of instance objects matches the required number, thereby ensuring the accuracy of the model training framework.

[0304] It should be noted that the embodiment of the present disclosure is only described separately with the above two items, and the above two items can be combined, that is, through the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, the instance objects with the difference number and the shortest running time or failed to run are deleted from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number. Since the number of instance objects corresponding to the associated role object that failed to run may be less than the difference number, when deleting the instance objects corresponding to the associated role object, the instance objects that failed to run are deleted, and then, according to the running time of the remaining instance objects of the associated role object, the instance objects with the shortest running time are deleted, so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number.

[0305] When the number of instance objects corresponding to any associated role object is different from the required number, different methods are used to update the instance objects corresponding to the associated role object to ensure that the number of instance objects matches the required number, thereby ensuring the accuracy of the model training framework.

[0306] 603. The electronic device restarts the instance object through the controller in response to the failure of any instance object to run, and the framework running information includes the failure restart parameter corresponding to the associated role object to which the instance object belongs.

[0307] Among them, the failure restart parameter corresponding to the role object information indicates that the instance object corresponding to the associated role object indicated by the role object information is restarted when it fails. If any instance object is detected to fail to run, and the associated role object to which the instance object belongs has a failure restart parameter, the instance object is restarted to ensure the normal operation of the model training framework.

[0308] In some embodiments, step 603 includes: the electronic device, through the controller, traverses the running status of the instance object corresponding to each associated role object, and in response to detecting that any instance object fails to run and the framework running information includes the failure restart parameters corresponding to the associated role object to which the instance object belongs, restarts the instance object; in response to detecting that any instance object fails to run and the framework running information does not include the failure restart parameters corresponding to the associated role object to which the instance object belongs, does not restart the instance object.

[0309] 604. The electronic device detects the state of each instance object and the number of instance objects corresponding to each associated role object through the controller, determines the state of each associated role object and the number of instances of the corresponding instance objects based on the first strategy corresponding to each role object information, and determines the state of the training task based on the second strategy corresponding to the training task and the state of each associated role object.

[0310] By detecting the state of each instance object and based on the first policy corresponding to each role object information and the state of the instance object corresponding to each associated role object, the state corresponding to each associated role object is determined.

[0311] 605. The electronic device caches the status of each associated role object and the status of the training task through the controller.

[0312] During the operation of the model training framework, the running model training framework is tuned to monitor the status of each associated role object and the status of the training task during the operation of the model training framework, and the monitored status is cached so that the execution status of the training task can be viewed through the cached status.

[0313] In some embodiments, the electronic device is provided as a server, and the terminal sends a status query request to the server, the status query request carries a training task identifier, the server receives the status query request, queries the status of the training task indicated by the training task identifier and the status of each associated role object corresponding to the training task, and sends the queried status to the terminal. The terminal receives the status sent by the server and displays it.

[0314] The terminal is a terminal for providing training tasks. The user interacts with the server through the terminal and can view the execution status of the training tasks, thereby realizing the monitoring of the training tasks.

[0315] In some embodiments, the framework operation parameters include second framework information, which is information to be monitored during the operation of the model framework. The second framework information is updated based on the status of each associated role object and the status of the training task.

[0316] For example, the second framework information includes the status of the training task, the status of the associated role object, the start time, the running time, and the completion time. The current status of the training task, the current status of each associated role object, the start time of the training task, the running time of the training task, and the completion time of the training task are updated in the second framework information.

[0317] For another example, the second framework information also includes the reason why the associated role object is in the current state, information about the current state, the time of the most recent state change, the number of instance objects in the running state, the number of instance objects in the successful state, the number of instance objects in the failed state, the number of instance objects in the waiting state, the number of instance objects in the unknown state, and the number of instance objects in the terminated state. The information in the second framework information is updated based on the state of each associated role object and the state of the instance object corresponding to each associated role object.

[0318] It should be noted that the embodiment of the present disclosure is explained by performing a tuning process on the running model training framework during the operation of the model training framework, while in another embodiment, during the operation of the model training framework, a tuning process is performed on the running model training framework at each target duration interval, that is, at each target duration interval, the state of the instance object corresponding to each associated role object is detected, and based on the state of the instance object corresponding to each associated role object, the state of each associated role object and the number of instances of the instance object corresponding to each object, as well as the state of the training task are determined, and the second framework information is updated based on the determined information.

[0319] It should be noted that the embodiment of the present disclosure is described with reference to a single tuning process. In another embodiment, there is no need to perform the above tuning process, and other methods can be adopted. During the operation of the model training framework, the controller obtains the updated status of the training task based on the status of the instance object corresponding to each associated role object at each target duration.

[0320] Based on the above Figure 3 and Figure 4 The embodiment shown provides a training task execution process, such as Figure 7 As shown, the process includes:

[0321] Step 1: Obtain the pending training task from the task queue through the controller. When it is determined that the training task has not been deleted, obtain the model training framework indicated by the framework identifier in the training task, and execute the following steps 2-4; when it is determined that the training task has been deleted, no longer execute the following steps 2-4 and clear the training task.

[0322] After the user submits a training task, the user can cancel the training task. Therefore, after canceling the training task, the training task in the task queue will not disappear. Only after the controller obtains the training task, it will query whether there is a task cancellation request for the training task object. If a task cancellation request corresponding to the training task is queried, it means that the training task has been deleted, and the training task will be cleared.

[0323] Step 2: Use the controller to configure the default fields in the training task and perform format verification on multiple fields in the training task. When it is determined that the training task meets expectations, based on the framework running information in the training task, create a corresponding number of instance objects for each associated role object associated with the training task in the model training framework. According to the dependency relationship between the information of multiple role objects, run the instance object corresponding to each associated role object to realize the operation of the model training framework.

[0324] Step 3: Through the controller, during the operation of the model training framework, the running model training framework is tuned once at every target time interval to iteratively update the status of the training task.

[0325] Among them, the tuning process is as described above Figure 6 and Figure 8 shown.

[0326] Step 4: After the training task is completed, clear the data generated by running the model training framework.

[0327] Fig. 9 is a block diagram of a device for executing a training task according to an exemplary embodiment. Fig. 9 , the device comprises:

[0328] An acquisition unit 901 is configured to acquire a training task through a controller, where the training task is used to train a network model, and the training task includes a framework identifier and framework operation information, where the framework operation information includes at least one role object information;

[0329] The acquisition unit 901 is further configured to execute, through the controller, acquiring a model training framework indicated by a framework identifier, the model training framework including at least one role object and a function set corresponding to each role object, the function set including a function for training a network model;

[0330] A creation unit 902 is configured to execute, through a controller, determining a role object indicated by at least one role object information in a model training framework as an associated role object of a training task, and based on a function set corresponding to the associated role object, creating an instance object for each associated role object, wherein the instance object includes a function in the corresponding function set;

[0331] The running unit 903 is configured to execute the instance object corresponding to each associated role object.

[0332] In some embodiments, the framework operation information also includes the first instance number corresponding to each role object information; the creation unit 902 is configured to execute through the controller, based on the first instance number corresponding to each information role object and the function set corresponding to each associated role object, to create the corresponding first instance number of instance objects for each associated role object.

[0333] In some embodiments, the framework operation information includes multiple role object information and the dependency relationship between the multiple role object information; Fig.10 As shown, the operation unit 903 includes:

[0334] The running subunit 9031 is configured to execute and run an instance object corresponding to a first type of role object among the multiple associated role objects, where the first type of role object is a role object that does not depend on other role objects;

[0335] The running subunit 9031 is also configured to execute, when the instance object corresponding to the first type of role object has been run, the instance object corresponding to the second type of role object that depends on the first type of role object, where the second type of role object is a role object that depends on other role objects among multiple associated role objects.

[0336] In some embodiments, the instance object and function set corresponding to the second-class role object both include a dependency function, and the dependency function indicates the first-class role object on which the second-class role object depends; the running sub-unit 9031 is configured to execute the dependency function in the instance object corresponding to the second-class role object; through the dependency function, monitor the instance object corresponding to the first-class role object on which the second-class role object depends; and when it is determined that the instance object has been running, run the instance object corresponding to the second-class role object.

[0337] In some embodiments, the running sub-unit 9031 is configured to execute a dependency function to monitor the address of the instance object corresponding to the first-class role object that the second-class role object depends on, where the address is cached by the controller when the instance object corresponding to the first-class role object runs successfully; in response to monitoring the address, run the instance object corresponding to the second-class role object.

[0338] In some embodiments, the creating unit 902 is further configured to create a communication service for each associated role object, where the communication service is used to implement communication between instance objects corresponding to at least one associated role object.

[0339] In some embodiments, Fig.10 As shown, the device also includes:

[0340] The restart unit 904 is configured to execute, in response to any instance object failing to run, and the framework running information includes a failure restart parameter corresponding to the associated role object to which the instance object belongs, restarting the instance object.

[0341] In some embodiments, the framework operation information further includes a state determination strategy, the state determination strategy indicating the state of the instance object corresponding to the role object indicated by at least one role object information, and the strategy for determining the state of the training task; Fig.10 As shown, the device also includes:

[0342] The determination unit 905 is configured to execute, through the controller, using a state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task.

[0343] In some embodiments, the state determination strategy includes a first strategy corresponding to each role object information and a second strategy corresponding to the training task, the first strategy is a strategy for determining the state of the role object by the state of the instance object corresponding to the associated role object indicated by the role object information, and the second strategy is a strategy for determining the state of the training task by the state of the associated role object;

[0344] The determination unit 905 is configured to execute through the controller, adopt the first strategy corresponding to each role object information, process the state of the instance object corresponding to each associated role object respectively, and obtain the state of each associated role object; through the controller, adopt the second strategy, process the state of each associated role object, and obtain the state of the training task.

[0345] In some embodiments, the determination unit 905 is configured to execute through the controller, at each target duration, using a state determination strategy to process the state of an instance object corresponding to at least one associated role object to obtain an updated state of the training task.

[0346] In some embodiments, Fig.10 As shown, the device also includes:

[0347] The stopping unit 906 is configured to execute, in response to the state of the training task being the end state, stopping the running of the model training framework.

[0348] In some embodiments, the acquisition unit 901 is configured to execute, through the controller, acquiring the training task to be processed from the task queue corresponding to the controller;

[0349] like Fig.10 As shown, the device also includes:

[0350] The clearing unit 907 is configured to clear the data generated when running the model training framework.

[0351] In some embodiments, the framework operation information also includes the first instance number corresponding to each role object information; Fig.10 As shown, the device also includes:

[0352] The verification unit 908 is configured to execute, through the controller, verification of the second instance number of the instance object corresponding to each associated role object based on the first instance number corresponding to each role object information;

[0353] The updating unit 909 is configured to execute, through the controller, when the first instance number and the second instance number corresponding to any associated role object are different, updating the instance object corresponding to the associated role object based on the difference between the first instance number and the second instance number, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number.

[0354] In some embodiments, the update unit 909 is configured to execute, through a controller, when the second instance number corresponding to the associated role object is less than the first instance number, creating a difference number of instance objects for the associated role object so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number; or, through a controller, when the second instance number corresponding to the associated role object is greater than the first instance number, deleting the difference number of instance objects from the instance objects corresponding to the associated role object so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number.

[0355] In some embodiments, the update unit 909 is configured to execute, through the controller, when the second number of instances corresponding to the associated role object is greater than the first number of instances, delete the instance objects with the difference number and failed to run from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first number of instances; or, through the controller, when the second number of instances corresponding to the associated role object is greater than the first number of instances, delete the instance objects with the difference number and the shortest running time from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first number of instances.

[0356] In some embodiments, Fig.10 As shown, the device also includes:

[0357] A verification unit 908 is configured to verify the training task through the controller;

[0358] The running unit 903 is configured to execute, in response to successful verification of the training task, obtaining, through the controller, a model training framework indicated by the framework identifier.

[0359] In some embodiments, the training task also includes an address corresponding to the framework identifier; the acquisition unit 901 is configured to execute, through the controller, acquiring the model training framework from the address corresponding to the framework identifier.

[0360] Regarding the device in the above embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.

[0361] In an exemplary embodiment, an electronic device is also provided, the electronic device comprising:

[0362] processor;

[0363] a memory for storing processor-executable instructions;

[0364] The processor is configured to execute execution instructions to implement the steps performed by the electronic device in the above-mentioned method for executing the training task.

[0365] In some embodiments, the electronic device is provided as a terminal. Fig.11 1 is a block diagram of a terminal 1100 according to an exemplary embodiment. The terminal 1100 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The terminal 1100 may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

[0366] The terminal 1100 includes a processor 1101 and a memory 1102 .

[0367] The processor 1101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1101 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1101 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1101 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0368] The memory 1102 may include one or more computer-readable storage media, which may be non-transitory. The memory 1102 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1102 is used to store at least one program code, which is used to be executed by the processor 1101 to implement the execution method of the training task provided in the method embodiment of the present disclosure.

[0369] In some embodiments, the terminal 1100 may also optionally include: a peripheral device interface 1103 and at least one peripheral device. The processor 1101, the memory 1102 and the peripheral device interface 1103 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1103 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1104, a display screen 1105, a camera assembly 1106, an audio circuit 1107, a positioning assembly 1108 and a power supply 1109.

[0370] The peripheral device interface 1103 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1101 and the memory 1102. In some embodiments, the processor 1101, the memory 1102, and the peripheral device interface 1103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1101, the memory 1102, and the peripheral device interface 1103 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0371] The radio frequency circuit 1104 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1104 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1104 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1104 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 1104 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1104 may also include circuits related to NFC (Near Field Communication), which is not limited in the present disclosure.

[0372] The display screen 1105 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1105 is a touch display screen, the display screen 1105 also has the ability to collect touch signals on the surface or above the surface of the display screen 1105. The touch signal can be input to the processor 1101 as a control signal for processing. At this time, the display screen 1105 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 1105 can be one, set on the front panel of the terminal 1100; in other embodiments, the display screen 1105 can be at least two, respectively set on different surfaces of the terminal 1100 or in a folding design; in other embodiments, the display screen 1105 can be a flexible display screen, set on a curved surface or a folding surface of the terminal 1100. Even, the display screen 1105 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1105 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0373] The camera assembly 1106 is used to capture images or videos. Optionally, the camera assembly 1106 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1106 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0374] The audio circuit 1107 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1101 for processing, or input them into the radio frequency circuit 1104 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 1100. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 1101 or the radio frequency circuit 1104 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 1107 may also include a headphone jack.

[0375] The positioning component 1108 is used to locate the current geographical location of the terminal 1100 to implement navigation or LBS (Location Based Service). The positioning component 1108 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system or Russia's Galileo system.

[0376] The power supply 1109 is used to power various components in the terminal 1100. The power supply 1109 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1109 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0377] In some embodiments, the terminal 1100 further includes one or more sensors 1110 , including but not limited to: an acceleration sensor 1111 , a gyroscope sensor 1112 , a pressure sensor 1113 , a fingerprint sensor 1114 , an optical sensor 1115 , and a proximity sensor 1116 .

[0378] The acceleration sensor 1111 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 1100. For example, the acceleration sensor 1111 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 1101 can control the display screen 1105 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 1111. The acceleration sensor 1111 can also be used to collect motion data of games or users.

[0379] The gyro sensor 1112 can detect the body direction and rotation angle of the terminal 1100, and the gyro sensor 1112 can cooperate with the acceleration sensor 1111 to collect the user's 3D actions on the terminal 1100. The processor 1101 can implement the following functions based on the data collected by the gyro sensor 1112: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0380] The pressure sensor 1113 may be provided at the side frame of the terminal 1100 and / or the lower layer of the display screen 1105. When the pressure sensor 1113 is provided at the side frame of the terminal 1100, the user's holding signal of the terminal 1100 may be detected, and the processor 1101 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 1113. When the pressure sensor 1113 is provided at the lower layer of the display screen 1105, the processor 1101 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 1105. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0381] The fingerprint sensor 1114 is used to collect the user's fingerprint, and the processor 1101 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 1114, or the fingerprint sensor 1114 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 1101 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 1114 can be set on the front, back, or side of the terminal 1100. When a physical button or a manufacturer logo is set on the terminal 1100, the fingerprint sensor 1114 can be integrated with the physical button or the manufacturer logo.

[0382] The optical sensor 1115 is used to collect the ambient light intensity. In one embodiment, the processor 1101 can control the display brightness of the display screen 1105 according to the ambient light intensity collected by the optical sensor 1115. Specifically, when the ambient light intensity is high, the display brightness of the display screen 1105 is increased; when the ambient light intensity is low, the display brightness of the display screen 1105 is reduced. In another embodiment, the processor 1101 can also dynamically adjust the shooting parameters of the camera assembly 1106 according to the ambient light intensity collected by the optical sensor 1115.

[0383] The proximity sensor 1116, also called a distance sensor, is disposed on the front panel of the terminal 1100. The proximity sensor 1116 is used to collect the distance between the user and the front of the terminal 1100. In one embodiment, when the proximity sensor 1116 detects that the distance between the user and the front of the terminal 1100 is gradually decreasing, the processor 1101 controls the display screen 1105 to switch from the screen-on state to the screen-off state; when the proximity sensor 1116 detects that the distance between the user and the front of the terminal 1100 is gradually increasing, the processor 1101 controls the display screen 1105 to switch from the screen-off state to the screen-on state.

[0384] Those skilled in the art will understand that Fig.11 The structure shown in the figure does not constitute a limitation on the terminal 1100, and the terminal 1100 may include more or fewer components than those shown in the figure, or combine certain components, or adopt a different component arrangement.

[0385] In some embodiments, the electronic device is provided as a terminal. Fig.12 This is a schematic diagram of the structure of a server according to an exemplary embodiment. The server 1200 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1201 and one or more memories 1202, wherein the memory 1202 stores at least one program code, and the at least one program code is loaded and executed by the processor 1201 to implement the methods provided by the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.

[0386] In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, and when the program code in the storage medium is executed by the processor of the electronic device, the electronic device is enabled to perform the steps performed by the electronic device in the execution method of the above-mentioned training task. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0387] In an exemplary embodiment, a computer program product is also provided. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the steps performed by the terminal or server in the method for executing the above-mentioned training task.

[0388] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0389] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for executing a training task, characterized in that: The method comprises: Acquire a training task through a controller, the training task is used to train a network model, the training task includes a storage address, a framework identifier, a scheduling strategy and framework operation information of the network model, and the framework operation information includes at least one role object information; Obtaining, by means of the controller, a model training framework indicated by the framework identifier, wherein the model training framework includes at least one role object and a function set corresponding to each role object, wherein the function set includes a function for training the network model; By means of the controller, the role object indicated by the at least one role object information in the model training framework is determined as the associated role object of the training task, the scheduling strategy is adopted, and based on the function set corresponding to the associated role object, an instance object is created for each associated role object, and the instance object corresponding to each associated role object is deployed on different servers, the instance object contains the function in the corresponding function set, the instance object is used to run the contained function, and the associated role object is all or part of the role objects in the model training framework; Run the instance object corresponding to each associated role object; In response to the status of the training task being a success status, the trained network model is obtained, and the trained network model is stored at the storage address.

2. The method according to claim 1, characterized in that: The framework operation information also includes the first instance number corresponding to each role object information; the adopting the scheduling strategy, based on the function set corresponding to the associated role object, respectively creating an instance object for each associated role object, and deploying the instance object corresponding to each associated role object on different servers, includes: Adopting the scheduling strategy, based on the first instance number corresponding to each role object information and the function set corresponding to each associated role object, create the first instance number of instance objects corresponding to each associated role object, and deploy the instance objects corresponding to each associated role object on different servers.

3. The method according to claim 2, characterized in that The framework operation information includes a plurality of the role object information and the dependency relationship between the plurality of the role object information; the instance object corresponding to each associated role object is operated, including: Running instance objects corresponding to first-type role objects among the plurality of associated role objects, where the first-type role objects are role objects that are not dependent on other role objects; When the instance object corresponding to the first type of role object has been run, the instance object corresponding to the second type of role object that depends on the first type of role object is run, where the second type of role object is a role object that depends on other role objects among the multiple associated role objects.

4. The method according to claim 3, characterized in that The instance object and the function set corresponding to the second-type role object both include a dependency function, and the dependency function indicates the first-type role object on which the second-type role object depends; and when the instance object corresponding to the first-type role object has been run, running the instance object corresponding to the second-type role object that depends on the first-type role object, comprises: Run the dependency function in the instance object corresponding to the second type of role object; By means of the dependency function, the instance object corresponding to the first type of role object that the second type of role object depends on is monitored; When it is determined that the instance object has been run, the instance object corresponding to the second-type role object is run.

5. The method according to claim 4, characterized in that The monitoring of the instance object corresponding to the first type of role object that the second type of role object depends on through the dependency function includes: By means of the dependency function, an address of an instance object corresponding to the first type of role object on which the second type of role object depends is monitored, wherein the address is cached by the controller when the instance object corresponding to the first type of role object runs successfully; When it is determined that the instance object has been run, running the instance object corresponding to the second-type role object includes: In response to monitoring the address, the instance object corresponding to the second-type role object is run.

6. The method according to claim 1, characterized in that After running the instance object corresponding to each associated role object, the method further includes: A communication service is created for each of the associated role objects, where the communication service is used to implement communication between instance objects corresponding to at least one associated role object.

7. The method according to claim 1, characterized in that After running the instance object corresponding to each associated role object, the method further includes: In response to any instance object failing to run, and the framework running information including a failure restart parameter corresponding to the associated role object to which the instance object belongs, restarting the instance object.

8. The method according to claim 1, characterized in that The framework operation information further includes a state determination strategy, the state determination strategy indicating a state of an instance object corresponding to a role object indicated by the at least one role object information, and a strategy for determining a state of the training task; After running the instance object corresponding to each associated role object, the method further includes: The controller uses the state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task.

9. The method according to claim 8, characterized in that The state determination strategy includes a first strategy corresponding to each role object information and a second strategy corresponding to the training task, wherein the first strategy is a strategy for determining the state of the associated role object by the state of the instance object corresponding to the associated role object indicated by the role object information, and the second strategy is a strategy for determining the state of the training task by the state of the associated role object; The controller uses the state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task, including: By means of the controller, the first strategy corresponding to each role object information is adopted to process the state of the instance object corresponding to each associated role object respectively, so as to obtain the state of each associated role object; The controller adopts the second strategy to process the state of each associated role object to obtain the state of the training task.

10. The method according to claim 8, characterized in that The controller uses the state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task, including: The controller processes the state of the instance object corresponding to the at least one associated role object by adopting the state determination strategy at each target time interval to obtain the updated state of the training task.

11. The method according to claim 8, characterized in that The method further comprises: In response to the status of the training task being an end state, stopping the running of the model training framework.

12. The method according to claim 11, characterized in that The obtaining of the training task through the controller includes: Obtaining, by the controller, the training task to be processed from a task queue corresponding to the controller; After the state of the training task is in the end state and the model training framework is stopped, the method further includes: Clear the data generated when running the model training framework.

13. The method according to claim 1, characterized in that The framework operation information also includes the number of first instances corresponding to each role object information; After running the instance object corresponding to each associated role object, the method further includes: By means of the controller, based on the first instance number corresponding to each role object information, the second instance number of the instance object corresponding to each associated role object is verified; Through the controller, when the first instance number and the second instance number corresponding to any associated role object are different, the instance object corresponding to the associated role object is updated based on the difference between the first instance number and the second instance number, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number.

14. The method according to claim 13, characterized in that The controller, when a first instance number and a second instance number corresponding to any associated role object are different, updates the instance object corresponding to the associated role object based on the difference between the first instance number and the second instance number, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number, including: By means of the controller, when the second instance number corresponding to the associated role object is less than the first instance number, instance objects of the difference number are created for the associated role object, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number; or By means of the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, instance objects of the difference number are deleted from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number.

15. The method according to claim 14, characterized in that The method of deleting, by the controller, instance objects of the difference number from the instance objects corresponding to the association role object when the second instance number corresponding to the association role object is greater than the first instance number, so that the instance number of the instance objects corresponding to the association role object is equal to the first instance number, comprises: By means of the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, instance objects with the difference number and failed to run are deleted from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number; or By means of the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, the instance objects with the difference number and the shortest running time are deleted from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number.

16. The method according to any one of claims 1 to 15, characterized in that: Before obtaining, by the controller, the model training framework indicated by the framework identifier, the method further includes: Verifying the training task by the controller; The step of obtaining, by the controller, a model training framework indicated by the framework identifier includes: In response to successful verification of the training task, the model training framework indicated by the framework identifier is obtained through the controller.

17. The method according to any one of claims 1 to 15, characterized in that: The training task also includes an address corresponding to the framework identifier; and obtaining, by the controller, a model training framework indicated by the framework identifier, includes: The model training framework is obtained through the controller from the address corresponding to the framework identifier.

18. A training task execution device, characterized in that: The device comprises: An acquisition unit is configured to execute acquisition of a training task through a controller, wherein the training task is used to train a network model, and the training task includes a storage address, a framework identifier, a scheduling strategy, and framework operation information of the network model, and the framework operation information includes at least one role object information; The acquisition unit is further configured to execute, through the controller, acquiring a model training framework indicated by the framework identifier, wherein the model training framework includes at least one role object and a function set corresponding to each role object, and the function set includes a function for training the network model; A creation unit is configured to execute, through the controller, determining the role object indicated by the at least one role object information in the model training framework as the associated role object of the training task, adopting the scheduling strategy, and creating an instance object for each associated role object based on the function set corresponding to the associated role object, and deploying the instance object corresponding to each associated role object on different servers, wherein the instance object contains the function in the corresponding function set, and the instance object is used to run the contained function, and the associated role object is all or part of the role objects in the model training framework; An operation unit, configured to execute and run the instance object corresponding to each associated role object; The device also includes a unit for executing the following steps: in response to the status of the training task being a success status, obtaining the trained network model, and storing the trained network model at the storage address.

19. The device according to claim 18, characterized in that The framework operation information also includes the first instance number corresponding to each role object information; the creation unit is configured to execute the scheduling strategy, based on the first instance number corresponding to each role object information and the function set corresponding to each associated role object, create the corresponding first instance number of instance objects for each associated role object, and deploy the instance objects corresponding to each associated role object on different servers.

20. The device according to claim 19, characterized in that The framework operation information includes a plurality of the role object information and dependency relationships between the plurality of the role object information; The operation unit comprises: An operation subunit is configured to execute and run instance objects corresponding to first-type role objects among the plurality of associated role objects, where the first-type role objects are role objects that do not depend on other role objects; The running subunit is further configured to execute, when the instance object corresponding to the first type of role object has been run, an instance object corresponding to a second type of role object that depends on the first type of role object, wherein the second type of role object is a role object that depends on other role objects among the multiple associated role objects.

21. The device according to claim 20, characterized in that The instance object and function set corresponding to the second-type role object both include a dependency function, wherein the dependency function indicates the first-type role object on which the second-type role object depends; the running subunit is configured to execute the dependency function in the instance object corresponding to the second-type role object; through the dependency function, monitor the instance object corresponding to the first-type role object on which the second-type role object depends; and when it is determined that the instance object has been running, run the instance object corresponding to the second-type role object.

22. The device according to claim 21, characterized in that The running sub-unit is configured to execute through the dependency function, monitor the address of the instance object corresponding to the first type of role object that the second type of role object depends on, and the address is cached by the controller when the instance object corresponding to the first type of role object runs successfully; in response to monitoring the address, run the instance object corresponding to the second type of role object.

23. The device according to claim 18, characterized in that The creation unit is further configured to create a communication service for each of the association role objects, wherein the communication service is used to implement communication between instance objects corresponding to at least one association role object.

24. The device according to claim 18, characterized in that The device also includes: The restart unit is configured to execute, in response to any instance object failing to run, and the framework running information includes a failure restart parameter corresponding to the associated role object to which the instance object belongs, restarting the instance object.

25. The device according to claim 18, characterized in that The framework operation information further includes a state determination strategy, the state determination strategy indicating the state of the instance object corresponding to the role object indicated by the at least one role object information, and a strategy for determining the state of the training task; the device further includes: The determination unit is configured to execute, through the controller, using the state determination strategy to process the state of the instance object corresponding to at least one associated role object to obtain the state of the training task.

26. The device according to claim 25, characterized in that The state determination strategy includes a first strategy corresponding to each role object information and a second strategy corresponding to the training task, wherein the first strategy is a strategy for determining the state of the associated role object by the state of the instance object corresponding to the associated role object indicated by the role object information, and the second strategy is a strategy for determining the state of the training task by the state of the associated role object; The determining unit is configured to execute, through the controller, using the first strategy corresponding to each role object information, to process the state of the instance object corresponding to each associated role object, so as to obtain the state of each associated role object; The controller adopts the second strategy to process the state of each associated role object to obtain the state of the training task.

27. The device according to claim 25, characterized in that The determination unit is configured to execute, through the controller, at each target time interval, using the state determination strategy to process the state of the instance object corresponding to the at least one associated role object to obtain the updated state of the training task.

28. The device according to claim 25, characterized in that The device also includes: A stopping unit is configured to stop running the model training framework in response to the state of the training task being an end state.

29. The device according to claim 28, characterized in that The acquisition unit is configured to acquire the training task to be processed from the task queue corresponding to the controller through the controller; The device also includes: The cleaning unit is configured to clean up the data generated when running the model training framework.

30. The device according to claim 18, characterized in that The framework operation information also includes the first instance number corresponding to each role object information; the device also includes: A verification unit is configured to verify the second instance number of the instance object corresponding to each associated role object based on the first instance number corresponding to each role object information through the controller; An updating unit is configured to execute, through the controller, when a first instance number and a second instance number corresponding to any associated role object are different, updating the instance object corresponding to the associated role object based on the difference between the first instance number and the second instance number, so that the instance number of the instance object corresponding to the associated role object is equal to the first instance number.

31. The device according to claim 30, characterized in that The updating unit is configured to execute, through the controller, when the second instance number corresponding to the associated role object is less than the first instance number, creating instance objects of the difference number for the associated role object so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number; or, through the controller, when the second instance number corresponding to the associated role object is greater than the first instance number, deleting instance objects of the difference number from the instance objects corresponding to the associated role object so that the instance number of the instance objects corresponding to the associated role object is equal to the first instance number.

32. The device according to claim 31, characterized in that The updating unit is configured to execute, through the controller, when the second number of instances corresponding to the associated role object is greater than the first number of instances, deleting the instance objects with the difference number and failed to run from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first number of instances; or, through the controller, when the second number of instances corresponding to the associated role object is greater than the first number of instances, deleting the instance objects with the difference number and the shortest running time from the instance objects corresponding to the associated role object, so that the instance number of the instance objects corresponding to the associated role object is equal to the first number of instances.

33. The device according to any one of claims 18 to 32, characterized in that The device also includes: A verification unit, configured to verify the training task through the controller; The operation unit is configured to execute, in response to successful verification of the training task, obtaining, through the controller, a model training framework indicated by the framework identifier.

34. The device according to any one of claims 18 to 32, characterized in that The training task also includes an address corresponding to the framework identifier; the acquisition unit is configured to execute, through the controller, acquiring the model training framework from the address corresponding to the framework identifier.

35. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method for executing the training task as described in any one of claims 1 to 17.

36. A non-transitory computer-readable storage medium, characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for executing a training task as described in any one of claims 1 to 17.

37. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for executing a training task as described in any one of claims 1 to 17 is implemented.

Citation Information

Patent Citations

  • Distributed machine learning task starting method, system and device and storage medium

    CN111352664A