Reinforcement learning training method, device, electronic device and storage medium

By determining matching sub-models in the preset reinforcement learning model and allocating resources in the container cluster, the problem of resource waste and low efficiency in the deep reinforcement learning training process is solved, and efficient parallel processing and a widely applicable reinforcement learning training method are achieved.

CN113469372BActive Publication Date: 2024-09-13BEIJING SENSETIME TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing deep reinforcement learning training process requires a large amount of computing resources and takes a long time, and the training system needs to be redesigned and built for new environments or problems, resulting in resource waste and inefficiency.

Method used

By determining the reinforcement learning sub-model that matches the target training task in the preset reinforcement learning model, and allocating computing resources in the container cluster, multiple training tasks can be processed in parallel to ensure that there is no impact between tasks, and through the elements of interactive data Separate storage of data and full data optimizes data transmission.

Benefits of technology

It improves the versatility and training efficiency of the reinforcement learning model, reduces the demand for computing resources, shortens the training time, and improves the resource utilization of the entire cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113469372B
    Figure CN113469372B
Patent Text Reader

Abstract

The present disclosure provides a reinforcement learning training method, device, electronic device and storage medium, wherein the method comprises: obtaining a target training task; determining a reinforcement learning sub-model to be trained in a preset reinforcement learning model based on an interactive environment of the target training task; allocating computing resources to the target training task in a container cluster, and determining training data in the interactive data; the interactive data comprises: data generated during the interaction process between an intelligent agent matching the target training task and the interactive environment; and training the reinforcement learning sub-model based on the computing resources and the training data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of computers, and in particular, to a reinforcement learning training method, device, electronic device, and storage medium. Background Art

[0002] Deep reinforcement learning has become the core technology route for decision-making intelligence in artificial intelligence research. Research and application based on deep reinforcement learning have reached a level comparable to or even exceeding that of humans in many fields, and related technologies can be applied to any scenario that requires decision-making and planning in all industries.

[0003] However, the entire training process of these large-scale reinforcement learning training and evaluation technologies requires a huge amount of computing resources and the training process takes a long time. Moreover, for a new environment or a new problem, the algorithm needs to be redesigned and implemented, and the entire training system needs to be rebuilt according to specific needs. Therefore, the existing training process requires a large number of deep reinforcement learning researchers and distributed system engineers to go through repeated iterations to obtain a specialized training system. Summary of the invention

[0004] The embodiments of the present disclosure at least provide a reinforcement learning training method, device, electronic device and storage medium.

[0005] In a first aspect, an embodiment of the present disclosure provides a reinforcement learning training method, comprising: obtaining a target training task; determining a reinforcement learning sub-model to be trained in a preset reinforcement learning model based on an interactive environment of the target training task; allocating computing resources for the target training task in a container cluster, and determining training data in the interactive data; the interactive data comprising: data generated during the interaction process between an intelligent agent matching the target training task and the interactive environment; and training the reinforcement learning sub-model based on the computing resources and the training data.

[0006] In the embodiment of the present disclosure, after the target training task is acquired, by determining the reinforcement learning sub-model that matches the interactive environment indicated in the target training task in the preset reinforcement learning model, the technical solution of the present disclosure can be applied to reinforcement learning models in various interactive environments, thereby expanding the scope of use of the technology of the present disclosure. At the same time, by allocating corresponding computing resources to the target training task through the container cluster, and training the reinforcement learning sub-model through the computing resources and training data, it is also possible to realize parallel processing of multiple target training tasks, and it is also possible to ensure that there is no influence between the various target training tasks, so as to ensure the normal execution of the target training task.

[0007] In an optional implementation, the reinforcement learning sub-model is trained based on the computing resources and the training data, including: determining target metadata based on the computing resources, wherein the target metadata is the metadata of the interaction data; searching for target interaction data matching the target metadata in an interaction data queue; and using the target interaction data as the training data to train the reinforcement learning sub-model.

[0008] In an optional implementation, determining the target metadata based on the computing resources includes: determining a metadata control node assigned by the container cluster to the target training task based on the computing resources; the metadata control node is used to manage metadata of interaction data between the intelligent agent and the corresponding interaction environment; and selecting the target metadata in the metadata control node.

[0009] In an optional implementation, the interaction data queue is stored in a device memory of a device deployed by the container cluster.

[0010] In the above implementation, the interactive data is separated into metadata and full data. After the data generator generates new interactive data, it only needs to send the metadata containing basic information to the centralized metadata control node (that is, the coordinator control node), and the specific full data is transmitted through the intermediate storage device (interactive data queue). When the trainer is loaded into the metadata, the interactive data is loaded from the intermediate storage device to avoid data pressure on the centralized coordinator. In response to various changing environments, the bandwidth pressure of the coordinator control node is always within a constant range, and the intermediate storage device can use different storage media for data of different sizes and generation frequencies to balance efficiency and resource utilization.

[0011] In an optional implementation, allocating computing resources to the target training task in the container cluster and determining the training data in the interaction data includes: determining the resource demand for the target training task; allocating the computing resources to the target training task according to the remaining resources of each working node in the container cluster, and determining the training data in the interaction data.

[0012] In the above implementation, by determining the computing resources by the resource demand of the target training task and the remaining resources of each working node in the container cluster, the matching computing resources can be accurately determined for the target training task to ensure the normal operation of the target training task.

[0013] In an optional implementation, when the target training task includes multiple sub-training tasks, allocating the computing resources to the target training task according to the remaining resources of each working node in the container cluster, and determining the training data in the interaction data, includes: determining the resource requirement of each sub-training task; allocating sub-computing resources to each sub-training task according to the remaining resources of each working node in the container cluster, and determining the training data matching each sub-training task in the interaction data.

[0014] In the above implementation, by dividing the target training task into multiple sub-training tasks and allocating computing resources to each sub-training task, distributed parallel processing of the multiple sub-training tasks can be achieved to improve the execution efficiency of the target training task.

[0015] In an optional implementation, the interactive environment based on the target training task determines the reinforcement learning sub-model to be trained in the preset reinforcement learning model, including: obtaining a target screening dimension; the target screening dimension includes at least one of the following: model type, training algorithm, data processing format, model scale data; based on the target screening dimension, screening is performed in multiple preset reinforcement learning models to obtain the reinforcement learning sub-model.

[0016] In the above implementation, by using the target screening dimension set above, screening is performed among multiple preset reinforcement learning models, and a reinforcement learning sub-model that is more in line with the target training task can be screened out, so that the technical solution of the present disclosure can be applied to a wider range of interactive environments.

[0017] In an optional embodiment, each of the preset reinforcement learning models includes at least one network module; the screening based on the target screening dimension to obtain the reinforcement learning sub-model includes: based on the target screening dimension, screening to obtain multiple target network modules from multiple network modules corresponding to the multiple preset reinforcement learning models; determining the connection relationship between the multiple target network modules; and determining the reinforcement learning sub-model based on the connection relationship and the multiple target network modules.

[0018] In the above implementation, by screening the target network module that matches the target training task from the network modules included in each preset reinforcement learning module, the search range can be expanded in the preset reinforcement learning module, thereby searching for a reinforcement learning sub-model that better meets the target training task.

[0019] In an optional embodiment, the interactive environment includes multiple interactive environments of different types; the method also includes: determining the data demand for the training data; creating multiple synchronization processes for the interactive environment when the data demand meets a preset quantity requirement; acquiring the interaction data between the intelligent agent and the interactive environment in the interactive environment through the multiple synchronization processes, and using the determined interaction data as the training data.

[0020] In the above implementation, by creating multiple synchronization processes for the interactive environment, the efficiency of acquiring interactive data can be accelerated, thereby shortening the training time of the reinforcement learning sub-model and improving the training efficiency of the reinforcement sub-learning model.

[0021] In an optional implementation, the method further includes: during the process of training the reinforcement learning sub-model, detecting the training status of the target training task; and when it is detected that the training status fails, re-training the reinforcement learning sub-model.

[0022] In the above implementation, a corresponding automatic recovery and restart mechanism is provided for the interruption and exception of the target training task. Through this recovery and restart mechanism, the training task can be run stably for a long time, and the use of all computing resources can be scheduled from the cluster perspective, thereby improving the resource utilization of the entire cluster.

[0023] In a second aspect, an embodiment of the present disclosure provides a reinforcement learning training device, comprising: an acquisition unit for acquiring a target training task; a first determination unit for determining a reinforcement learning sub-model to be trained in a preset reinforcement learning model based on the interactive environment of the target training task; a resource allocation unit for allocating computing resources for the target training task in a container cluster; a second determination unit for determining training data in the interactive data; the interactive data comprising: data generated during the interaction process between an intelligent agent matching the target training task and the interactive environment; a training unit for training the reinforcement learning sub-model based on the computing resources and the training data.

[0024] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.

[0025] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.

[0026] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0028] Figure 1 A flowchart of a reinforcement learning training method provided by an embodiment of the present disclosure is shown;

[0029] Figure 2 A flowchart showing a specific method for determining a reinforcement learning sub-model to be trained in a preset reinforcement learning model based on the interactive environment of the target training task in the reinforcement learning training method provided by an embodiment of the present disclosure;

[0030] Figure 3 A flowchart showing a specific method for allocating computing resources for the target training task in a container cluster and determining training data in interactive data in the reinforcement learning training method provided by an embodiment of the present disclosure;

[0031] Figure 4 A schematic diagram of a reinforcement learning training device provided by an embodiment of the present disclosure is shown;

[0032] Figure 5 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0034] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0035] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0036] Research has found that the entire training process of these large-scale reinforcement learning training and evaluation technologies requires a huge amount of computing resources and the training process lasts a long time. Moreover, for a new environment or a new problem, the algorithm needs to be redesigned and implemented, and the entire training system needs to be rebuilt according to specific needs. Therefore, the existing training process requires a large number of deep reinforcement learning researchers and distributed system engineers to go through repeated iterations to obtain a specialized training system.

[0037] Based on the above research, the present disclosure provides a reinforcement learning training method, device, electronic device and storage medium. In an embodiment of the present disclosure, after obtaining the target training task, by determining the reinforcement learning sub-model that matches the interactive environment indicated in the target training task in the preset reinforcement learning model, the technical solution of the present disclosure can be applied to reinforcement learning models in various interactive environments, thereby expanding the scope of use of the technology of the present disclosure. At the same time, by allocating corresponding computing resources to the target training task through a container cluster, and training the reinforcement learning sub-model through the computing resources and training data, it is also possible to realize parallel processing of multiple target training tasks, and it is also possible to ensure that there is no influence between the target training tasks, so as to ensure the normal execution of the target training task.

[0038] First, the words that may appear in the technical solution of the present disclosure are explained.

[0039] Reinforcement learning: also known as reinforcement learning and evaluation learning, is an agent learning in a trial-and-error manner, with rewards obtained through interaction with the environment to guide behavior, with the goal of enabling the agent to obtain the maximum reward value.

[0040] Several basic elements of reinforcement learning: environment, agent, reward, and action. Below, the principles and ideas of reinforcement learning are explained in combination with the above elements:

[0041] Assume that the brain represents the above-mentioned intelligent agent, and the trainer of the neural network can operate the intelligent agent to make decisions, that is, to select a suitable action (Action) A1. Assume that the earth represents the environment to be studied, which contains the corresponding state model. After the control brain chooses to execute action A1, the state (State) of the environment will change. At this time, it can be found that the state of the environment has changed from S{t} to S{t+1}, and the delayed reward (Reward) R{t+1} for the brain taking action A1 is also obtained. Then, the brain can continue to choose the next suitable action, and then the state of the environment will change again, and there will be a new reward value.

[0042] To facilitate understanding of this embodiment, a reinforcement learning training method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the reinforcement learning training method provided in the embodiment of the present disclosure is generally an electronic device with certain computing capabilities. In some possible implementations, the reinforcement learning training method can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0043] See also Figure 1 FIG. 1 is a flowchart of a reinforcement learning training method provided by an embodiment of the present disclosure, wherein the method includes steps S101 to S107, wherein:

[0044] S101: Obtain a target training task.

[0045] Here, the number of target training tasks may be one or more. For different target training tasks, the processing objects of the reinforcement learning model to be trained may be different or the same.

[0046] For example, multiple target training tasks include target training task A and target training task B, wherein target training task A is used to train a reinforcement learning model that can recognize and process images; target training task B is used to train a reinforcement learning model that can process audio sequences.

[0047] In the disclosed embodiment, the target training task includes task parameters, which are used to indicate the type, scale, accuracy, processing object, operating environment, etc. of the reinforcement learning model to be obtained. For example, the reinforcement learning model is suitable for an autonomous driving environment, and the reinforcement learning model is suitable for a face payment environment.

[0048] S103: Based on the interactive environment of the target training task, determine the reinforcement learning sub-model to be trained in the preset reinforcement learning model.

[0049] In the embodiment of the present disclosure, multiple reinforcement learning models may be preset, that is, preset reinforcement learning models, and the preset reinforcement learning models specifically include the following types of models:

[0050] DQN (Deep Q-Learning) series models based on value functions and related derivative models; related models based on policy gradients and value functions; Monte Carlo tree search models suitable for discrete decision spaces in board game environments; VPN / Muzero models for modeling reinforcement learning models; imitation learning models that combine human expert data and strategies; inverse reinforcement learning related models BC / GAIL (Generative adversarial imitation learning) / SQIL; HER (Hindsight Experience Replay) and related models for sparse reward problems; RND (Random Network Distillation) / Bebold related models for solving exploration difficulties; Qmix model family of multi-agent reinforcement learning algorithms for multi-agent problems.

[0051] In addition to the reinforcement learning model described above, other reinforcement learning models may also be selected. For example, the preset reinforcement learning model may be a reinforcement learning model pre-built by a neural network trainer.

[0052] Here, the multiple preset reinforcement learning models are not fixed, and the user can update the preset reinforcement learning in real time. The update here includes at least one of the following: deleting, adding, and modifying any preset reinforcement learning model.

[0053] The modification here can be understood as adjusting the structure of the preset reinforcement learning model, for example, adding part of the structure, deleting part of the structure, adjusting part of the structure, etc.

[0054] S105: Allocate computing resources for the target training task in the container cluster, and determine training data in the interaction data; the interaction data includes: data generated during the interaction process between an intelligent agent matching the target training task and the interaction environment.

[0055] In the embodiment of the present disclosure, the container cluster may be a Kubernetes container cluster, which includes a master node and at least one worker node, and corresponding computing resources, such as a GPU and a CPU, are deployed on each worker node.

[0056] S107: Training the reinforcement learning sub-model based on the computing resources and the training data.

[0057] In the process of training the reinforcement learning sub-model through training data, the network parameters of the reinforcement learning sub-model can be adjusted according to the training results.

[0058] In the embodiment of the present disclosure, after the target training task is acquired, by determining the reinforcement learning sub-model that matches the interactive environment indicated in the target training task in the preset reinforcement learning model, the technical solution of the present disclosure can be applied to reinforcement learning models in various interactive environments, thereby expanding the scope of use of the technology of the present disclosure. At the same time, by allocating corresponding computing resources to the target training task through the container cluster, and training the reinforcement learning sub-model through the computing resources and training data, it is also possible to realize parallel processing of multiple target training tasks, and it is also possible to ensure that there is no influence between the various target training tasks, so as to ensure the normal execution of the target training task.

[0059] It can be seen from the above description that in the embodiment of the present disclosure, first, a target training task for the reinforcement learning model is obtained, and then a reinforcement learning sub-model is determined in the preset reinforcement learning model based on the interactive environment of the target training task.

[0060] like Figure 2 As shown, for the above step S103, based on the interactive environment of the target training task, the reinforcement learning sub-model to be trained is determined in the preset reinforcement learning model, which specifically includes the following steps:

[0061] Step S1031, obtaining a target screening dimension; the target screening dimension includes at least one of the following: model type, training algorithm, data processing format, model scale data;

[0062] Step S1032: Based on the target screening dimension, screening is performed among multiple preset reinforcement learning models to obtain the reinforcement learning sub-model.

[0063] In the embodiment of the present disclosure, a model search space may be preset, and the preset reinforcement learning model is a part or all of the models in the model search space.

[0064] For example, when it is determined that a smaller-scale reinforcement learning model needs to be trained according to the target training task, multiple preset reinforcement learning models that meet the smaller-scale reinforcement learning model can be searched from the model search space. Then, the reinforcement learning sub-model is determined according to the multiple preset reinforcement learning models.

[0065] Here, the task parameters of the target training task can be obtained, and then the target screening dimension can be determined in the task parameters. The target screening dimension can be one or more. For example, the target screening dimension includes at least one of the following: model type, training algorithm, data processing format, and model scale data.

[0066] The model type can be used to characterize the type of input data and the type of output data. For example, the type of input data can be a combination of images, text sequences, voices, numbers, and time series. The type of output data can be discrete, continuous, or composite. The model type can also be used to characterize the number of agents, that is, whether there is one or more agents. The model type can be used to characterize whether autoregression, multi-way branching, and reparameterization techniques are used.

[0067] For example, a corresponding encoding neural network can be selected in a preset reinforcement learning model according to the type of input data, and a corresponding output prediction neural network can be selected in a preset reinforcement learning model according to the type of output data.

[0068] The training algorithm is used to characterize at least one of the following:

[0069] Reward value, advantage function (nstep-td, mc, td-lambda, GAE, vtrace); correction method selected for off-policy training; definition of importance sampling factor; balanced exploration and utilization of agent output actions; choice of optimizer, and correction of abnormal gradient signals.

[0070] The data processing format is used to characterize at least one of the following:

[0071] Whether to normalize the observation space and reward space, and whether to use exponentially weighted average or maximum a posteriori estimation for the normalized statistics, and how to define the quality indicators of training data, including: the freshness of the samples, their importance, and the number of times the samples can be reused.

[0072] In the above implementation, by using the target screening dimension set above, screening is performed among multiple preset reinforcement learning models, and a reinforcement learning sub-model that is more in line with the target training task can be screened out, so that the technical solution of the present disclosure can be applied to a wider range of interactive environments.

[0073] In an optional implementation, when each of the preset reinforcement learning models includes at least one network module, step S1032, based on the target screening dimension, screening is performed among multiple preset reinforcement learning models to obtain the reinforcement learning sub-model, and specifically further includes the following steps:

[0074] (1) Based on the target screening dimension, multiple target network modules are screened from multiple network modules corresponding to the multiple preset reinforcement learning models;

[0075] (2) determining the connection relationship between the multiple target network modules;

[0076] (3) Determine the reinforcement learning sub-model based on the connection relationship and the multiple target network modules.

[0077] In the embodiment of the present disclosure, for each preset reinforcement learning module, at least one network module may be included. For example, for the preset reinforcement learning module A, network module A1, network module A2, and network module A3 may be included. For the preset reinforcement learning module B, network module B1, network module B2, and network module B3 may be included. For the preset reinforcement learning module C, network module C1, network module C2, and network module C3 may be included.

[0078] At this time, at least one target network module can be obtained by screening out the multiple network models included in the multiple preset reinforcement learning modules. For example, network module A1, network module B2, network module C1 and network module C2 can be obtained by screening out.

[0079] After determining at least one target network module, a connection relationship between the at least one target network module may be determined.

[0080] In an optional implementation, the connection relationship between at least one target network module may be determined based on the connection relationship between each network module included in the model search space.

[0081] In another optional implementation, the connection relationship between at least one target network module may be determined according to the module function of each target network module in at least one target network module.

[0082] After at least one target network module is determined, a reinforcement learning sub-model may be determined based on the connection relationship and the at least one target network module.

[0083] In the disclosed embodiment, the network module may be a convolutional layer module, a pooling layer module, a normalization layer module, an attention module, or the like.

[0084] In the above implementation, by screening the target network module that matches the target training task from the network modules included in each preset reinforcement learning module, the search range can be expanded in the preset reinforcement learning module, thereby searching for a reinforcement learning sub-model that better meets the target training task.

[0085] In an optional embodiment, if Figure 3 As shown, for the above step S105, computing resources are allocated to the target training task in the container cluster, and training data is determined in the interactive data, specifically including the following steps:

[0086] Step S1051, determining the resource requirement for the target training task;

[0087] Step S1052: Allocate the computing resources to the target training task according to the remaining resources of each working node in the container cluster, and determine the training data in the interaction data.

[0088] In the disclosed embodiment, the resource requester (e.g., a neural network trainer) can edit the Pod configuration file to indicate the resource requirements of the computing module requested to be allocated by the resource requester through the information contained in the Pod configuration file. Here, the resource requirements can be understood as the number of GPUs, the number of CPUs, and the amount of memory space required to perform the target training task.

[0089] In an embodiment of the present disclosure, the computing module may be a container, which may be created on a working node of a container cluster to execute the above-mentioned target training task.

[0090] After determining the resource demand, the remaining resources of each working node in the container cluster can be determined, and then, a working node whose remaining resources is greater than the resource demand can be determined among multiple working nodes, and computing resources can be allocated to the target training task in the determined working node.

[0091] For a target training task, one or more computing modules can be assigned to it. When multiple computing modules are assigned, the multiple computing modules can be deployed on different working nodes. At this time, it can be set to execute the target training task simultaneously through multiple computing modules to achieve distributed execution of the target training task.

[0092] For different target training tasks, the computing modules assigned to them can be deployed on different working nodes respectively. Through this processing method, it can be ensured that there is no impact between the target training tasks, so as to ensure the normal execution of the target training tasks.

[0093] In an embodiment of the present disclosure, when it is determined that all working nodes in the container cluster are in a working state, or when it is determined that the remaining resources of the working nodes in the container cluster are less than the required resources, computing resources can be allocated to the target training task after other training tasks are completed.

[0094] In the above implementation, by determining the computing resources by the resource demand of the target training task and the remaining resources of each working node in the container cluster, the matching computing resources can be accurately determined for the target training task to ensure the normal operation of the target training task.

[0095] In an optional implementation, when the target training task includes multiple sub-training tasks, step S1052 allocates the computing resources to the target training task according to the remaining amount of resources of each working node in the container cluster, and determines the training data in the interaction data, specifically including the following steps:

[0096] (1) Determine the resource requirement of each of the sub-training tasks;

[0097] (2) Allocate sub-computing resources to each sub-training task according to the remaining resources of each working node in the container cluster, and determine the training data matching each sub-training task in the interaction data.

[0098] In an embodiment of the present disclosure, the target training task may be divided into a plurality of sub-training tasks if the target training task meets a task division condition.

[0099] The target training task meets the task division conditions, including at least one of the following situations:

[0100] The remaining resources of the working nodes in the container cluster are less than the resource requirements of the target training task;

[0101] The target training task contains multiple model branches that need to be trained with different training data;

[0102] The target training task includes multiple training stages, and each training stage corresponds to different training data.

[0103] Based on this, when dividing the target training task into multiple sub-training tasks, the target training task can be divided into multiple sub-training tasks in a manner that different sub-training tasks correspond to different training data.

[0104] After dividing the target training task into multiple sub-training tasks, the resource requirement of each sub-training task can be determined, so as to allocate sub-computing resources to each sub-training task according to the remaining resources of each working node in the container cluster.

[0105] In the disclosed embodiment, after allocating sub-computing resources to each sub-training task, matching training data for each sub-training task can also be determined in the interaction data. Then, the network model corresponding to each sub-training task is trained through the sub-computing resources and the training data.

[0106] In an optional implementation, the step S107, training the reinforcement learning sub-model based on the computing resources and the training data, specifically includes the following process:

[0107] (1) Determining target metadata based on the computing resources, wherein the target metadata is metadata of the interaction data, specifically comprising the following steps:

[0108] Based on the computing resources, the metadata control node assigned by the container cluster to the target training task is determined; the metadata control node is used to manage the metadata of the interaction data between the intelligent agent and the corresponding interaction environment; then, the target metadata is selected in the metadata control node.

[0109] (2) Searching for target interaction data matching the target metadata in an interaction data queue; wherein the interaction data queue is stored in a device memory of a device deployed by the container cluster.

[0110] (3) Using the target interaction data as the training data, the reinforcement learning sub-model is trained to obtain a target reinforcement learning module.

[0111] The required training data for different interactive environments and different reinforcement learning algorithms vary greatly. For example, the size of the interactive data will change in different interactive environments, and the frequency of the interactive data will also change. For example, in the field of games, the frequency of change of interactive data is faster, while in the field of Go, the frequency of change of interactive data is slower, and a set of interactive data is often generated after a game of Go is finished.

[0112] Therefore, different interactive environments and different reinforcement learning algorithms will have different requirements for the system, and one system cannot meet the training tasks of multiple environments. In order to shield the above problems, the interactive data can be split into metadata and full data, and the metadata and full data can be stored separately. For example, the metadata can be stored in the metadata control node, and the full data can be stored in the interactive data queue.

[0113] When determining the training data, the target metadata may be randomly selected from the metadata control node first, and then the target interaction data matching the target metadata may be searched in the interaction data queue. Finally, the searched target interaction data may be determined as the training data.

[0114] Since the amount of metadata is small, by splitting the interaction data into metadata and full data, and then searching for metadata to obtain the corresponding interaction data, the technical solution of the present invention will not be limited by the interaction environment and reinforcement learning algorithm, thereby enabling the method to be applied to a wider range of interaction environments.

[0115] It can be seen from the above description that in the embodiment of the present disclosure, the interactive data is separated into two parts: metadata and full data. After the data generator generates new interactive data, it only needs to send the metadata containing basic information to the centralized metadata control node (that is, the coordinator control node), and the specific full data is transmitted through the intermediate storage device (interactive data queue). When the trainer is loaded into the metadata, the interactive data is loaded from the intermediate storage device to avoid data pressure on the centralized coordinator. In response to various changing environments, the bandwidth pressure of the coordinator control node is always within a constant range, and the intermediate storage device can use different storage media for data of different sizes and generation frequencies to transmit, balancing efficiency and resource utilization.

[0116] In an embodiment of the present disclosure, a shared object store may be created in advance in a device memory of a device deployed by the container cluster, and the shared object store is used to store an interaction data queue.

[0117] In actual reinforcement learning training, common file systems (hard disks) and distributed file systems (such as Ceph) have problems such as slow read and write speeds, unstable read and write, and competition for distributed locks. The disclosed technical solution, based on plasma and gRPC, builds a set of cross-machine shared memory object stores in the device memory. Through this shared memory object store, data transmission can be kept in memory as much as possible, greatly improving data transmission efficiency, and supporting corresponding preloading and broadcast mechanisms, which is suitable for some special reinforcement learning data transmission scenarios.

[0118] In the embodiment of the present disclosure, when the interactive environment includes multiple interactive environments of different types, the method further includes the following steps:

[0119] (1) Determine the data requirement of the training data;

[0120] (2) when the data demand meets the preset quantity requirement, creating multiple synchronization processes for the interactive environment;

[0121] (3) Acquire the interaction data between the agent and the interaction environment in the interaction environment through the multiple synchronization processes, and use the determined interaction data as the training data.

[0122] For an interactive environment with a large data demand for training data and a low frequency of generating interactive data, multiple synchronization processes can be created for the interactive environment to obtain the interactive data between the agent and the interactive environment in the interactive environment as training data through multiple synchronization processes.

[0123] For example, in the Go game environment, a training sample is the data of a game of Go. Since a game of Go takes a long time, the frequency of generating interactive data is low, which will seriously affect the training efficiency of the reinforcement learning sub-model.

[0124] At this time, multiple synchronous processes can be created for the Go game environment, and each process is used to generate interaction data between the agent and the Go game environment. For example, 128 sets of interaction data are required in the Go game environment. At this time, 128 synchronous processes can be created, and then the interaction data is generated simultaneously through the 128 synchronous processes to improve the training efficiency of the reinforcement learning sub-model.

[0125] In the embodiment of the present disclosure, the method further includes the following steps:

[0126] (1) During the training of the reinforcement learning sub-model, detecting the training status of the target training task;

[0127] (2) When it is detected that the training state fails, the reinforcement learning sub-model is retrained.

[0128] In an embodiment of the present disclosure, during the process of training the reinforcement learning sub-model, the training status of the target training task can also be detected, wherein the training status is used to characterize whether the training process of the reinforcement learning sub-model is normal.

[0129] When a training state failure is detected, the cause of the failure can be analyzed, and then the reinforcement learning sub-model can be retrained based on the cause of the failure.

[0130] For example, the failure reason may be insufficient allocation of computing resources, or interruption of acquisition of training data.

[0131] After determining the cause of failure, a retraining strategy can be determined based on the cause of failure, for example, adjusting computing resources, adjusting the way training data is generated, etc., and then retraining the reinforcement learning sub-model according to the training strategy.

[0132] In another optional implementation, when it is detected that the training state fails, the training state at the current moment may be retained; thereafter, the reinforcement learning sub-model may continue to be trained according to the recorded training state.

[0133] In the above implementation, a corresponding automatic recovery and restart mechanism is provided for the interruption and exception of the target training task. Through this recovery and restart mechanism, the training task can be run stably for a long time, and the use of all computing resources can be scheduled from the cluster perspective, thereby improving the resource utilization of the entire cluster.

[0134] It can be seen from the above description that the technical solution disclosed in the present invention has the following advantages:

[0135] 1. Universality. The design purpose of the disclosed technical solution is to improve the universality of the reinforcement learning algorithm. The algorithm design and implementation takes into account the universality of coping with various types of environments and the universality of coping with various types of computing resource scales. Only a small amount of algorithm implementation modification and hyperparameter adjustment are required for different environments.

[0136] 2. Improve the overall efficiency of data production and utilization. Customized optimization is carried out for data transmission, model training, and interactive environment simulation in combination with reinforcement learning features, which significantly improves efficiency compared with similar products.

[0137] 3. Design algorithms and systems from the perspective of multiple training tasks (clusters). The focus is not just on the training efficiency of a single task, but also on scheduling and optimization from the perspectives of resource utilization of the entire cluster and the overall training time of all training tasks.

[0138] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0139] Based on the same inventive concept, a reinforcement learning training device corresponding to the reinforcement learning training method is also provided in the embodiments of the present disclosure. Since the principle of solving the problem by the device in the embodiments of the present disclosure is similar to the above-mentioned reinforcement learning training method in the embodiments of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0140] Reference Figure 4 FIG. 4 is a schematic diagram of a reinforcement learning training device provided by an embodiment of the present disclosure, wherein the device comprises: an acquisition unit 41, a first determination unit 42, a resource allocation unit 43 and a training unit 44; wherein,

[0141] An acquisition unit 41 is used to acquire a target training task;

[0142] A first determining unit 42 is used to determine a reinforcement learning sub-model to be trained in a preset reinforcement learning model based on the interactive environment of the target training task;

[0143] A resource allocation unit 43 is used to allocate computing resources for the target training task in the container cluster; and determine the training data in the interaction data; the interaction data includes: data generated during the interaction process between the intelligent agent matching the target training task and the interaction environment;

[0144] The training unit 44 is used to train the reinforcement learning sub-model based on the computing resources and the training data.

[0145] In the embodiment of the present disclosure, after the target training task is acquired, by determining the reinforcement learning sub-model that matches the interactive environment indicated in the target training task in the preset reinforcement learning model, the technical solution of the present disclosure can be applied to reinforcement learning models in various interactive environments, thereby expanding the scope of use of the technology of the present disclosure. At the same time, by allocating corresponding computing resources to the target training task through the container cluster, and training the reinforcement learning sub-model through the computing resources and training data, it is also possible to realize parallel processing of multiple target training tasks, and it is also possible to ensure that there is no influence between the various target training tasks, so as to ensure the normal execution of the target training task.

[0146] In one possible implementation, the training unit is used to: determine target metadata based on the computing resources, wherein the target metadata is metadata of the interaction data; search for target interaction data matching the target metadata in an interaction data queue; and use the target interaction data as the training data to train the reinforcement learning sub-model.

[0147] In one possible implementation, the training unit is used to: determine the metadata control node assigned by the container cluster to the target training task based on the computing resources; the metadata control node is used to manage the metadata of the interaction data between the intelligent agent and the corresponding interaction environment; and select the target metadata in the metadata control node.

[0148] In a possible implementation, the interaction data queue is stored in a device memory of a device deployed by the container cluster.

[0149] In one possible implementation, the resource allocation unit is used to: determine the resource demand for the target training task; allocate the computing resources to the target training task according to the remaining resources of each working node in the container cluster, and determine the training data in the interaction data.

[0150] In one possible implementation, the resource allocation unit is further used to: when the target training task includes multiple sub-training tasks, determine the resource requirement of each sub-training task; allocate sub-computing resources to each sub-training task according to the remaining resources of each working node in the container cluster, and determine the training data matching each sub-training task in the interaction data.

[0151] In one possible implementation, the first determination unit is used to: obtain a target screening dimension; the target screening dimension includes at least one of the following: model type, training algorithm, data processing format, model scale data; based on the target screening dimension, screen among multiple preset reinforcement learning models to obtain the reinforcement learning sub-model.

[0152] In one possible implementation, the first determination unit is used to: when each of the preset reinforcement learning models includes at least one network module, based on the target screening dimension, screen out multiple target network modules from the multiple network modules corresponding to the multiple preset reinforcement learning models; determine the connection relationship between the multiple target network modules; and determine the reinforcement learning sub-model based on the connection relationship and the multiple target network modules.

[0153] In a possible implementation, the method is also used to: determine the data demand for the training data when the interaction environment includes multiple different types of interaction environments; create multiple synchronization processes for the interaction environment when the data demand meets a preset quantity requirement; obtain the interaction data between the intelligent agent and the interaction environment in the interaction environment through the multiple synchronization processes, and use the determined interaction data as the training data.

[0154] In a possible implementation, the method is also used to: detect the training status of the target training task during the training of the reinforcement learning sub-model; and re-train the reinforcement learning sub-model when failure of the training status is detected.

[0155] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0156] Corresponds to Figure 1 The embodiment of the present disclosure also provides an electronic device 500, such as Figure 5 FIG. 5 is a schematic diagram of the structure of an electronic device 500 provided in an embodiment of the present disclosure, including:

[0157] Processor 51, memory 52, and bus 53; memory 52 is used to store execution instructions, including memory 521 and external memory 522; memory 521 here is also called internal memory, which is used to temporarily store operation data in processor 51 and data exchanged with external memory 522 such as hard disk. Processor 51 exchanges data with external memory 522 through memory 521. When the electronic device 500 is running, the processor 51 communicates with the memory 52 through bus 53, so that the processor 51 executes the following instructions:

[0158] Get the target training task;

[0159] Based on the interactive environment of the target training task, determining a reinforcement learning sub-model to be trained in a preset reinforcement learning model;

[0160] Allocating computing resources for the target training task in the container cluster, and determining training data in the interaction data; the interaction data includes: data generated during the interaction process between the intelligent agent matching the target training task and the interaction environment;

[0161] The reinforcement learning sub-model is trained based on the computing resources and the training data.

[0162] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the reinforcement learning training method described in the above method embodiment are executed. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0163] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the reinforcement learning training method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0164] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0165] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

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

[0167] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0168] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0169] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A reinforcement learning training method, characterized in that: include: Get the target training task; The target training task includes task parameters; Based on the interactive environment indicated by the task parameters of the target training task, determining a reinforcement learning sub-model to be trained that matches the interactive environment in a preset reinforcement learning model; Allocating computing resources for the target training task in a container cluster, and determining target metadata based on the computing resources; Searching for target interaction data matching the target metadata in the interaction data stored in the interaction data queue, and using the target interaction data as the training data to train the reinforcement learning sub-model; the interaction data includes: data generated by an agent matching the target training task in the process of interacting with the interaction environment; The target metadata is metadata of the interactive data. The interactive data queue is stored in a device memory of a device deployed by the container cluster. The interactive data queue is used to transmit data of different sizes and generation frequencies using different storage media.

2. The method according to claim 1, characterized in that The determining target metadata based on the computing resources includes: Determine, based on the computing resources, a metadata control node assigned by the container cluster to the target training task; the metadata control node is used to manage metadata of interaction data between the agent and the corresponding interaction environment; The target metadata is selected in the metadata control node.

3. The method according to claim 1, characterized in that The allocating computing resources for the target training task in the container cluster includes: Determining resource requirements for the target training task; The computing resources are allocated to the target training task according to the remaining resources of each working node in the container cluster.

4. The method according to claim 3, characterized in that In a case where the target training task includes multiple sub-training tasks, allocating the computing resources to the target training task according to the remaining amount of resources of each working node in the container cluster includes: Determining the resource requirement of each of the sub-training tasks; According to the remaining amount of resources of each working node in the container cluster, sub-computing resources are allocated to each of the sub-training tasks.

5. The method according to claim 1, characterized in that The step of determining, based on the interactive environment indicated by the task parameters of the target training task, a reinforcement learning sub-model to be trained that matches the interactive environment in a preset reinforcement learning model comprises: Determining a target screening dimension from the task parameters; the target screening dimension comprises at least one of the following: model type, training algorithm, data processing format, model scale data; Based on the target screening dimension, screening is performed among multiple preset reinforcement learning models to obtain the reinforcement learning sub-model that matches the interactive environment.

6. The method according to claim 5, characterized in that Each of the preset reinforcement learning models includes at least one network module; The step of screening a plurality of preset reinforcement learning models based on the target screening dimension to obtain the reinforcement learning sub-model includes: Based on the target screening dimension, multiple target network modules are screened out from multiple network modules corresponding to the preset reinforcement learning model; Determining a connection relationship between the multiple target network modules; Based on the connection relationship and the multiple target network modules, the reinforcement learning sub-model is determined.

7. The method according to claim 1, characterized in that The interactive environment includes multiple different types of interactive environments; the method further includes: Determining the data requirement of the training data; When the data demand meets the preset quantity requirement, creating multiple synchronization processes for the interactive environment; The interaction data between the agent and the interaction environment in the interaction environment is acquired through the multiple synchronization processes, and the determined interaction data is used as the training data.

8. The method according to claim 1, characterized in that The method further comprises: During the training of the reinforcement learning sub-model, detecting the training status of the target training task; When it is detected that the training state fails, the reinforcement learning sub-model is retrained.

9. A reinforcement learning training device, characterized in that: include: An acquisition unit, used for acquiring a target training task; The target training task includes task parameters; A first determining unit, configured to determine, based on the interactive environment indicated by the task parameters of the target training task, a reinforcement learning sub-model to be trained that matches the interactive environment in a preset reinforcement learning model; A resource allocation unit, configured to allocate computing resources to the target training task in the container cluster; a training unit, configured to determine target metadata based on the computing resources; The training unit is further used to search for target interaction data matching the target metadata in the interaction data stored in the interaction data queue, and use the target interaction data as the training data to train the reinforcement learning sub-model; the interaction data includes: data generated by the intelligent agent matching the target training task in the process of interacting with the interaction environment; The target metadata is metadata of the interactive data. The interactive data queue is stored in a device memory of a device deployed by the container cluster. The interactive data queue is used to transmit data of different sizes and generation frequencies using different storage media.

10. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the reinforcement learning training method as described in any one of claims 1 to 8 are performed.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the reinforcement learning training method as described in any one of claims 1 to 8.