Distributed processing method, device and equipment

By parsing and executing distributed reinforcement learning tasks submitted by users, using cluster resource objects and Volcano scheduling mode, it solves the problem that the distributed reinforcement learning training framework cannot support cloud native deployment, and achieves low threshold and efficient execution of cloud native training.

CN118780342APending Publication Date: 2024-10-15THE FOURTH PARADIGM BEIJING TECH CO LTD

Patent Information

Application Number
CN202311785462.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-22
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

The existing distributed reinforcement learning training framework cannot support cloud native deployment and training, and requires a lot of professional knowledge, which raises the threshold for use.

Method used

By obtaining distributed reinforcement learning tasks submitted by users, parsing them into resource objects that can be recognized by the cluster, and calling cluster resources to execute tasks based on these resource objects, supporting multi-container deployment and GPU resource scheduling, using Volcano's Gang Scheduling scheduling mode and cluster native A distributed data set orchestration and acceleration engine that provides distributed file services.

Benefits of technology

It supports cloud-native deployment and training while lowering the threshold for use, simplifying the execution process of distributed reinforcement learning tasks, suitable for ordinary scientific research teams and small startups, and reducing hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118780342A_ABST
    Figure CN118780342A_ABST
Patent Text Reader

Abstract

The invention relates to a distributed processing method, device and equipment. Obtaining a distributed reinforcement learning task submitted by a user, wherein the distributed reinforcement learning task defines at least one role, the number of copies corresponding to each role and resource information required by each role; analyzing the distributed reinforcement learning task into a resource object which can be identified by a cluster; and calling a cluster resource based on the resource object to execute the distributed reinforcement learning task. Therefore, a user only needs to submit the distributed reinforcement learning task, and the distributed reinforcement learning task can be automatically deployed and executed in the cluster, so that the use threshold can be reduced while cloud native deployment and training are supported.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of distributed processing technology, and in particular to a distributed processing method, device and equipment related to distributed reinforcement learning. Background Art

[0002] Reinforcement Learning (RL) is currently a very promising artificial intelligence (AI) technology.

[0003] Reinforcement learning is widely used in game agents, robotic control, and industrial optimization scenarios.

[0004] Training powerful reinforcement learning agents requires the deployment of a variety of hardware resources and a large number of servers, which places high demands on the infrastructure of the training framework.

[0005] Since ordinary scientific research teams and small startups cannot afford the high hardware costs, choosing to use cloud servers as training platforms makes large-scale reinforcement learning training possible.

[0006] However, most existing distributed reinforcement learning training frameworks cannot support cloud-native deployment and training, and require users to have a lot of professional knowledge, which greatly increases the threshold for use. Summary of the invention

[0007] One technical problem that the present disclosure aims to solve is that the distributed reinforcement learning training framework cannot support cloud-native deployment and training.

[0008] According to a first aspect of the present disclosure, a distributed processing method is provided, comprising: obtaining a distributed reinforcement learning task submitted by a user, wherein the distributed reinforcement learning task defines at least one role, the number of copies corresponding to each of the roles, and resource information required for each of the roles; parsing the distributed reinforcement learning task into a resource object that can be recognized by a cluster; and calling cluster resources based on the resource object to execute the distributed reinforcement learning task.

[0009] Optionally, calling cluster resources based on the resource object to execute the distributed reinforcement learning task includes: deploying multiple containers in the cluster based on the resource object; and executing the distributed reinforcement learning task by running the multiple containers, wherein each role corresponds to at least one container.

[0010] Optionally, the multiple containers are deployed using the Gang Scheduling mode of Volcano.

[0011] Optionally, the resource information includes GPU resources, and the method further includes: using a cluster device plug-in to provide a scheduling service for the GPU resources in the cluster.

[0012] Optionally, the method further includes: utilizing a cluster-native distributed data set orchestration and acceleration engine to mount the distributed file system in a required container to provide distributed file services for the container.

[0013] Optionally, the method further includes: adding resources required by a user-declared distributed deep learning framework to the distributed reinforcement learning task, so as to execute the distributed reinforcement learning task in the cluster using the distributed deep learning framework.

[0014] Optionally, the distributed reinforcement learning task is written by a user based on a distributed framework LaunchPad.

[0015] Optionally, the distributed reinforcement learning task further defines a network topology structure of the at least one role, and different roles can be called through a pre-set interface.

[0016] Optionally, the at least one role includes: a trainer, used to train a reinforcement learning algorithm based on training data; and / or an actor, used to interact with the environment to obtain training data; and / or an environment simulator, used to provide an environment for agent interaction.

[0017] Optionally, the method also includes: maintaining an opponent pool, wherein the opponent pool stores one or more previously trained intelligent agents, wherein the actor is used to use the intelligent agents in the opponent pool to perform self-combat by interacting with the environment according to a predetermined self-combat strategy to obtain self-combat training data, and the trainer is used to train the reinforcement learning algorithm based on the self-combat training data.

[0018] Optionally, the method further includes: creating a development machine in the cluster, and exposing the development machine to the outside of the cluster, so that a user can write and submit the distributed reinforcement learning task through the development machine.

[0019] Optionally, creating a development machine in the cluster includes: creating the development machine by running a development machine image in a container in the cluster.

[0020] Optionally, the development machine image also has a built-in dedicated command line tool for quickly building a corresponding image based on the current development machine system state. The method also includes: in response to a command issued by the user through the command line tool, building and saving a new development machine image based on the file system state of the current development machine.

[0021] Optionally, the method further includes: deploying the cluster using server resources of a cloud vendor; and flexibly using cloud server resources in the process of executing the distributed reinforcement learning task.

[0022] According to a second aspect of the present disclosure, a distributed processing device is provided, including: an acquisition module, used to acquire a distributed reinforcement learning task submitted by a user, wherein the distributed reinforcement learning task defines at least one role, the number of copies corresponding to each of the roles, and resource information required for each of the roles; a parsing module, used to parse the distributed reinforcement learning task into a resource object that can be recognized by a cluster; and a calling module, used to call cluster resources based on the resource object to execute the distributed reinforcement learning task.

[0023] Optionally, the calling module deploys multiple containers in the cluster based on the resource object, and executes the distributed reinforcement learning task by running the multiple containers, wherein each of the roles corresponds to at least one container.

[0024] Optionally, the calling module deploys the multiple containers using the Gang Scheduling mode of Volcano.

[0025] Optionally, the resource information includes GPU resources, and the calling module uses a cluster device plug-in to provide scheduling services for GPU resources in the cluster.

[0026] Optionally, the calling module utilizes the cluster's native distributed data set orchestration and acceleration engine to mount the distributed file system in the required container to provide distributed file services for the container.

[0027] Optionally, the device also includes: an adding module, used to add resources required by the distributed deep learning framework declared by the user to the distributed reinforcement learning task, so as to perform the distributed reinforcement learning task in the cluster using the distributed deep learning framework.

[0028] Optionally, the distributed reinforcement learning task is written by a user based on a distributed framework LaunchPad.

[0029] Optionally, the distributed reinforcement learning task further defines a network topology structure of the at least one role, and different roles can be called through a pre-set interface.

[0030] Optionally, the at least one role includes: a trainer, used to train a reinforcement learning algorithm based on training data; and / or an actor, used to interact with the environment to obtain training data; and / or an environment simulator, used to provide an environment for agent interaction.

[0031] Optionally, the device also includes: a maintenance module, used to maintain an opponent pool, wherein the opponent pool stores one or more previously trained intelligent agents, wherein the actor is used to use the intelligent agents in the opponent pool to perform self-combat by interacting with the environment according to a predetermined self-combat strategy to obtain self-combat training data, and the trainer is used to train a reinforcement learning algorithm based on the self-combat training data.

[0032] Optionally, the device further includes: a development machine management module, which is used to create a development machine in the cluster and expose the development machine to the outside of the cluster, so that a user can write and submit the distributed reinforcement learning task through the development machine.

[0033] Optionally, the development machine management module creates a development machine by running a development machine image in a container in the cluster.

[0034] Optionally, the development machine image also has a built-in dedicated command line tool for quickly building a corresponding image based on the current development machine system status. The development machine management module responds to commands issued by the user through the command line tool to build and save a new development machine image based on the file system status of the current development machine.

[0035] Optionally, the device also includes: a deployment module, used to deploy the cluster using server resources of a cloud vendor; and a resource utilization module, used to flexibly use cloud server resources in the process of executing the distributed reinforcement learning task.

[0036] According to a third aspect of the present disclosure, a computing device is provided, comprising: a processor; and a memory on which executable codes are stored, and when the executable codes are executed by the processor, the processor executes the method described in the first aspect above.

[0037] According to a fourth aspect of the present disclosure, a computer program product is provided, comprising an executable code, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the method as described in the first aspect above.

[0038] According to a fifth aspect of the present disclosure, a non-temporary machine-readable storage medium is provided, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor executes the method described in the first aspect above.

[0039] The present disclosure obtains the distributed reinforcement learning task submitted by the user, parses the distributed reinforcement learning task into a resource object that the cluster can recognize, and calls the cluster resources based on the resource object to execute the distributed reinforcement learning task. Based on the present disclosure, the user only needs to submit the distributed reinforcement learning task, and the distributed reinforcement learning task can be automatically deployed and executed in the cluster, so it can support cloud-native deployment and training while lowering the usage threshold. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components in the exemplary embodiments of the present disclosure.

[0041] Figure 1 A schematic flow chart of a distributed processing method according to an embodiment of the present disclosure is shown.

[0042] Figure 2 A schematic diagram of a resource object LpJob is shown.

[0043] Figure 3 A structural diagram of a distributed reinforcement learning framework is shown.

[0044] Figure 4 A schematic diagram of the framework design of the distributed reinforcement learning training algorithm is shown.

[0045] Figure 5 A schematic structural diagram of a distributed processing device according to an embodiment of the present disclosure is shown.

[0046] Figure 6 A schematic diagram of the structure of a computing device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0047] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0048] The frameworks, tools, etc. used in the present disclosure are all based on research purposes, and those skilled in the art may replace similar frameworks, tools, etc. as needed.

[0049] Figure 1 A schematic flow chart of a distributed processing method according to an embodiment of the present disclosure is shown. Figure 1The method shown can be implemented in software via a computer program, and can also be executed via a specifically configured computing device.

[0050] See also Figure 1 , in step S110, the distributed reinforcement learning task submitted by the user is obtained.

[0051] The distributed reinforcement learning task defines at least one role, the number of replicas corresponding to each role, and the resource information required by each role. Exemplarily, the at least one role may include but is not limited to: a trainer, used to train the reinforcement learning algorithm based on training data; and / or an actor, used to interact with the environment to obtain training data; and / or an environment simulator, used to provide an environment for intelligent agent interaction.

[0052] The distributed reinforcement learning task may be a reinforcement learning code written by a user. The distributed reinforcement learning task may also define the network topology of the at least one role. The network topology may be used to characterize the calling relationship between different roles. Different roles may call each other through a pre-set interface.

[0053] In some embodiments, the distributed reinforcement learning task can be a program code (such as a Program object) written by a user based on an application programming interface (such as a Python API) provided by the distributed framework LaunchPad. Distributed reinforcement learning tasks can also be referred to as LpJob tasks. LaunchPad is a programming model that simplifies the process of defining and starting distributed computing instances. LaunchPad is a practical, user-friendly, and expressive framework. LaunchPad can describe the topology of a distributed system as a graph data structure, so that each node in the graph represents a service.

[0054] In step S120, the distributed reinforcement learning task is parsed into resource objects that can be recognized by the cluster.

[0055] Cluster can refer to K8s (Kubernetes) cluster. K8s is an open source container orchestration engine, which can be regarded as a server management program. K8s regards everything as a resource. Parsing distributed reinforcement learning tasks into resource objects that can be recognized by the cluster, that is, parsing distributed reinforcement learning tasks into resource types (such as Job) that can be recognized by the cluster. Resource objects can describe distributed reinforcement learning tasks in a way that can be understood by the cluster.

[0056] Taking into account the heterogeneity of distributed reinforcement learning, this paper designs a resource object LpJob based on the design of LaunchPad to describe complex heterogeneous scenario tasks on the K8s platform. Figure 2 A schematic diagram of a resource object LpJob is shown.

[0057] See also Figure 2 In LpJob, you can freely set multiple roles and their network topology. Different roles can asynchronously call each other's methods through pre-set interfaces. At the same time, you can set copies for each role so that multiple roles can work at the same time. And for each role, you can set the type of resources it needs, such as CPU, memory, GPU, mounted file system, etc.

[0058] For the parsing and processing of LpJob in k8s, a service for managing LpJob can be designed, which can be called LpJob manager. LpJob manager can continuously detect the status of LpJob in the cluster. For newly created LpJob tasks, they can be parsed into resource types that k8s can recognize and automatically deployed. For completed LpJob tasks, corresponding resources can be cleaned up.

[0059] In step S130, cluster resources are called based on the resource object to execute the distributed reinforcement learning task.

[0060] The resource object describes the distributed reinforcement learning task to be performed. For example, see Figure 2 , the resource object LpJob describes the roles involved in the distributed reinforcement learning task, the number of copies of each type of role, and the resource information required for each type of role. Therefore, the cluster resources can be orchestrated and scheduled accordingly based on the resource objects to call the cluster resources to execute the distributed reinforcement learning task. Exemplarily, multiple containers can be deployed in the cluster, and the execution of the distributed reinforcement learning task can be achieved by running these multiple containers. Among them, at least one container can be deployed for each role, and the container is used to execute the task corresponding to the role.

[0061] In summary, the present disclosure uses the cluster as a cloud-native framework for distributed learning, and accordingly designs an easy-to-use cloud-native solution for distributed reinforcement learning training. Based on the present disclosure, users only need to submit distributed reinforcement learning tasks, and the distributed reinforcement learning tasks can be automatically deployed and executed in the cluster, so it can support cloud-native deployment and training while lowering the threshold for use.

[0062] In artificial intelligence scenarios, usually multiple containers of a distributed reinforcement learning task need to be executed simultaneously, so the scheduling mode for these tasks should be: either all containers can be successfully deployed at the same time, or none of them are deployed. This scheduling mode can be called Gang Scheduling. Since the native scheduling method of k8s does not support this mode, this disclosure proposes that Volcano can be used to process the call of the LpJob resource object. That is, Volcano's Gang Scheduling scheduling mode can be used to deploy a group (i.e., multiple) containers corresponding to the same resource object LpJob. Specifically, either resources are allocated to all roles in LpJob at the same time, or no resources are allocated.

[0063] In deep learning scenarios, the use of GPUs is essential. That is, distributed reinforcement learning tasks may involve the use of GPUs. For example, the resource information required for each role defined in the distributed reinforcement learning task may include but is not limited to GPU resources. However, the native K8s cluster does not support scheduling of GPU resources.

[0064] To this end, the present disclosure proposes that this function can be supported based on additional extended services. Exemplarily, a cluster device plug-in can be used to provide a scheduling service for GPU resources in the cluster. When executing step S130, the cluster device plug-in can be used to schedule the GPU resources in the cluster to meet the GPU resource requirements of the distributed reinforcement learning task.

[0065] In some embodiments, the cluster device plug-in can be a k8s-device-plugin plug-in. Under the action of the k8s-device-plugin plug-in, the required number of GPUs can also be used as a resource type in K8s. In some embodiments, the cluster device plug-in can also be an open source OpenAI OSvGPU scheduler plug-in. Based on the k8s-device-plugin plug-in, the OpenAI OSvGPU scheduler plug-in further adds the splitting of GPUs, allowing multiple tasks to use the same GPU, and can use part of the system's virtual memory as video memory, further improving the cluster's ability to use GPUs. Both k8s-device-plugin and OpenAI OSvGPU scheduler are open source components. The specific structure and working principle of k8s-device-plugin and OpenAI OSvGPU scheduler will not be described in detail in this disclosure.

[0066] In a distributed scenario, different containers corresponding to the same task often need to share cache file contents. For example, in a deep learning scenario, a dataset needs to be shared for each training container. To this end, the present disclosure proposes that a distributed file system can be mounted in the required container using the cluster's native distributed dataset orchestration and acceleration engine to provide distributed file services for the container.

[0067] Taking K8s as an example, the cluster-native distributed data set orchestration and acceleration engine can refer to Fluid. The distributed file system can refer to JuiceFS. That is, Fluid and JuiceFS can be used to provide a low-latency, high-consistency file system for the cluster. JuiceFS is a distributed file system designed for cloud environments and compatible with POSIX, HDFS, and S3 protocols. It can build a highly consistent distributed file system that is fully compatible with POSIX through an object storage and metadata engine. Fluid is an open source K8s-native distributed data set orchestration and acceleration engine that provides the ability to manage JuiceFS as a K8s resource object. In the cluster, by dividing different read and write scenarios, JuiceFS with different parameters can be mounted in the required container using Fluid to provide distributed file services for it.

[0068] In some embodiments, the present disclosure can also adapt some existing mainstream distributed deep learning frameworks (such as torchrun, deepspeed, etc.) to support users to use some mainstream distributed deep learning frameworks. Exemplarily, the present disclosure can add the resources required by the user-declared distributed deep learning framework to the distributed reinforcement learning task, so as to perform the distributed reinforcement learning task in the cluster using the distributed deep learning framework. Specifically, the user can automatically add the resources required by the framework to the created LpJob by declaring the distributed framework type, and perform the required preparations for the created container. torchrun is a very useful tool in PyTorch, which can help us run and manage the training process more conveniently. deepspeed is a deep learning training optimization tool developed by Microsoft, which aims to improve training speed and save resources through distributed training and mixed precision technology. It is an open source Python library that can run on multiple platforms.

[0069] The distributed processing method disclosed in the present invention can be implemented as a large-scale distributed reinforcement learning framework based on cloud native.

[0070] Figure 3 A structural diagram of a distributed reinforcement learning framework is shown.

[0071] See also Figure 3, the distributed reinforcement learning framework can also be called a distributed system. The distributed reinforcement learning framework can mainly include three parts: the user development machine, the task manager, and the distributed file system. In the entire distributed system, users can use the development machine to build the reinforcement learning code into a distributed reinforcement learning task (such as an LpJob task) through the Python API and upload it to the cluster. In other words, users can use the Python API provided by LaunchPad to build a Program object that defines the content of LpJob. For the user development machine, please refer to the description below.

[0072] The task manager (such as LpJob manager) can include a task parser (such as LpJob parser) and Volcano. The task parser can be used to convert the distributed reinforcement learning task into an LpJob resource object and upload it to the k8s cluster, and then Volcano can be used for resource scheduling.

[0073] In some embodiments, an opponent pool may also be maintained. The opponent pool stores one or more previously trained agents. The actor may use the agents in the opponent pool to perform self-combat according to a predetermined self-combat strategy by interacting with the environment to obtain self-combat training data. The trainer may train a reinforcement learning algorithm based on the self-combat training data. Different trainers may share neural network parameters using the NVIDIA Collective Communication Library (NCCL).

[0074] Exemplarily, the present disclosure also designs a distributed reinforcement learning training algorithm framework. Figure 4 A schematic diagram of the framework design of the distributed reinforcement learning training algorithm is shown.

[0075] See also Figure 4 There are two main modules in this framework, namely trainer and actor. The trainer is mainly used to receive training data and then train the reinforcement learning algorithm. The actor mainly uses the neural network parameters trained by the trainer to interact with the environment and collect training data.

[0076] The data server in the framework is used to help store and transmit data. In addition, the distributed framework also maintains an opponent pool. The opponent pool stores trained historical models, which are sampled through self-combat strategies to interact with the environment and generate self-combat data. The framework can use gRPC for data transmission and NCCL for sharing neural network parameters on the GPU. gRPC is a modern open source high-performance remote procedure call (RPC) framework. Because the framework has good module decoupling capabilities, it supports one-click switching between local operation and multi-machine distributed operation without the need for algorithm developers to modify any code.

[0077] In the scenario of large-scale distributed reinforcement learning, users need to spend a lot of time to configure the corresponding development environment. In order to reduce the user's development cost, the present disclosure can also create a development machine in the cluster and expose the development machine to the outside of the cluster so that the user can write and submit distributed reinforcement learning tasks through the development machine. Exemplarily, a development machine can be created by running a development machine image in a container in the cluster. The development machine image can also have a built-in dedicated command line tool for quickly building a corresponding image based on the current development machine system state. The present disclosure can also build and save a new development machine image based on the file system state of the current development machine in response to a command issued by the user through a command line tool.

[0078] Therefore, the distributed reinforcement learning training framework disclosed in the present invention can also include a dedicated user development machine, which is convenient for users to quickly verify algorithms and perform secondary development in the K8s environment. In addition, by innovatively introducing the DockerinDocker technology in the K8s cluster, users can build a new image based on the file system status of the current development machine with a simple command, which is convenient for the subsequent reuse of the existing operating environment configuration in the distributed training process. DockerinDocker is a technology that runs a Docker container inside a Docker container.

[0079] The user development machine can mainly include the following two modules: the development machine management module and the development machine image. The development machine management module is responsible for the management of the life cycle of the user development machine. The development machine image is responsible for providing the user with the corresponding development environment.

[0080] The development machine management module can complete the management operations of the corresponding development machine by calling the K8s API. When the user creates a development machine, the management module can help the user create the corresponding namespace (Namespace) in the K8s environment, and create and configure the distributed storage resources required by the user, and create and configure a K8s Pod resource object to run the corresponding image of the development machine. In addition, the management module can also create the corresponding network resource (Service) in the K8s cluster and expose the development machine to the outside of the cluster through the NodePort mode. When the user destroys the development machine, the management module can help the user clean up the resources occupied by the development machine in the K8s cluster, including deleting the corresponding Pod and Service resource objects, and cleaning up the remaining data information in the distributed storage system.

[0081] The environment information and software dependencies required to run the distributed framework can be pre-configured inside the development machine image. At the same time, OpenSSHServer is run in the image to facilitate users to log in through the SSH protocol, realizing low-cost remote operation of the development machine. At the same time, in order to further reduce the cost of building images for users in subsequent development, the development machine can also have a built-in dedicated command line tool (commit.sh) for quickly building the corresponding image based on the current development machine system status. OpenSSHServer is a free open source software for the SSH (Secure Shell) protocol. The software that provides this protocol also includes Telnet. It is an encrypted network transmission protocol. OpenSSH can encrypt data during remote control and file transfer, and thereby replace the original similar services.

[0082] In some embodiments, the cluster can also be deployed using the server resources of cloud vendors, and cloud server resources can be used flexibly during the execution of distributed reinforcement learning tasks. Elastic use of cloud server resources means that cloud server resources of corresponding size can be used according to the resource requirements of distributed reinforcement learning tasks.

[0083] Since building a large-scale distributed reinforcement learning system requires a large amount of server resources, directly purchasing the corresponding hardware resources requires a huge amount of money. Ordinary scientific research teams and small startups are often daunted by such asset-intensive businesses. In order to solve this problem, the framework supports the cloud server deployment model, which greatly reduces the initial capital investment required for running job tasks. Since each cloud vendor can provide a relatively standard K8s cluster, it is possible to build a framework operating system on different cloud vendors.

[0084] For example, in terms of server resource deployment, by introducing IaC (Infrastruction as Code) tools such as Terraform, the framework can use the Provider mechanism of the Terraform tool to use K8s cluster configuration templates made for different Providers to achieve the function of creating and managing standard K8s clusters on different cloud vendors. After the K8s cluster is deployed, the scheduling system and storage system plug-ins required by the distributed reinforcement learning framework are deployed in the cluster of the corresponding cloud environment through helm. Terraform is a deployment technology that can safely and efficiently establish, change, and version infrastructure. It is driven by configuration files, defines the components (infrastructure) to be managed in the file, and generates an executable plan to complete the creation, incremental changes and continuous management of the defined components by executing this plan. Terraform can not only manage Iaas resources, but also manage higher-level services such as DNS resolution, SaaS applications, etc. IaC (Infrastructure as Code) is a way to define infrastructure as code. It defines the configuration parameters of the infrastructure by using descriptive languages ​​such as YAML or JSON, and then sends them to the master server, management API or code repository through instruction files. The IaC platform creates and configures the infrastructure according to the instructions of the developer. IaC can solve the problem of environmental drift in the CD pipeline, and make application deployment no longer blocked by waiting for infrastructure, and system administrators do not need to manage time-consuming manual processes. Terraform's Provider mechanism is a plug-in mechanism that allows Terraform to interact with cloud providers, SaaS providers, and other APIs. Provider is essentially a logical abstraction of the API of the upstream cloud vendor, responsible for understanding API interactions and exposing resources. Each Provider will have a set of resource types and / or datasources that Terraform can manage. When using Terraform, you must declare which providers are needed so that Terraform can install and use them. Some Providers need to be configured before use, such as endpoint URLs or cloud regions.

[0085] For example, in terms of scheduling of service resources, by utilizing the K8s cluster type of ElasticKubernetesService supported by cloud vendors, the reinforcement learning framework can flexibly use cloud server resources in executing job tasks. At the same time, the resulting cost overhead can be calculated according to the actual container resources used. Users of the framework can focus more on improving the efficiency of job tasks without having to worry about the additional cost overhead caused by scheduling logic issues.

[0086] In summary, the present disclosure provides an easy-to-use cloud-native solution for distributed reinforcement learning training. The present disclosure implements the startup and orchestration of distributed training programs based on k8s, and also includes CPU and GPU resource scheduling. The present disclosure provides a set of Python APIs for distributed scheduling, which lowers the threshold for developers to use k8s scheduling. The present disclosure designs a set of distributed reinforcement learning algorithm libraries based on the Python API, which provides an algorithm framework for reinforcement learning training. The present disclosure also proposes supporting distributed storage, user development machines, cloud deployment and other modules to further reduce the user usage threshold and resource isolation.

[0087] The distributed processing method disclosed in the present invention may also be implemented as a distributed processing device. Figure 5 FIG. 1 is a schematic diagram of the structure of a distributed processing device according to an embodiment of the present disclosure. The functional units of the distributed processing device can be implemented by hardware, software, or a combination of hardware and software that implements the principles of the present disclosure. It can be understood by those skilled in the art that Figure 5 The functional units described may be combined or divided into sub-units to implement the principles of the above invention. Therefore, the description herein may support any possible combination, division, or further limitation of the functional units described herein. The following is a brief description of the functional units that a distributed processing device may have and the operations that each functional unit may perform. For the details involved, please refer to the relevant description above, which will not be repeated here.

[0088] See also Figure 5 , the distributed processing device 500 may include an acquisition module 510, a parsing module 520 and a calling module 530. The acquisition module 510 is used to acquire a distributed reinforcement learning task submitted by a user, and the distributed reinforcement learning task defines at least one role, the number of copies corresponding to each role, and the resource information required by each role. The parsing module 520 is used to parse the distributed reinforcement learning task into a resource object that can be recognized by the cluster. The calling module 530 is used to call the cluster resources based on the resource object to execute the distributed reinforcement learning task.

[0089] In some embodiments, the calling module 530 can deploy multiple containers in the cluster based on resource objects, and perform distributed reinforcement learning tasks by running multiple containers, wherein each role corresponds to at least one container. Exemplarily, the calling module 530 can deploy multiple containers using Volcano's Gang Scheduling scheduling mode. Exemplarily, the resource information may include GPU resources, and the calling module 530 may use a cluster device plug-in to provide scheduling services for GPU resources in the cluster. Exemplarily, the calling module 530 may use the cluster's native distributed data set orchestration and acceleration engine to mount a distributed file system in the required container to provide distributed file services for the container.

[0090] In some embodiments, the distributed processing device 500 may further include an adding module. The adding module is used to add resources required by the distributed deep learning framework declared by the user to the distributed reinforcement learning task, so as to perform the distributed reinforcement learning task in the cluster using the distributed deep learning framework.

[0091] In some embodiments, the distributed processing device 500 may further include a maintenance module. The maintenance module is used to maintain an opponent pool, in which one or more previously trained agents are stored, wherein the actor is used to use the agents in the opponent pool to perform self-combat according to a predetermined self-combat strategy by interacting with the environment to obtain self-combat training data, and the trainer is used to train the reinforcement learning algorithm based on the self-combat training data.

[0092] In some embodiments, the distributed processing device 500 may also include a development machine management module. The development machine management module is used to create a development machine in the cluster and expose the development machine to the outside of the cluster so that users can write and submit distributed reinforcement learning tasks through the development machine. Exemplarily, the development machine management module creates a development machine by running a development machine image in a container in the cluster. Exemplarily, the development machine image also has a built-in dedicated command line tool for quickly building a corresponding image based on the current development machine system state. The development machine management module can respond to commands issued by the user through the command line tool, build a new development machine image based on the file system state of the current development machine and save it.

[0093] In some embodiments, the distributed processing device 500 may further include a deployment module and a resource utilization module. The deployment module is used to deploy a cluster using server resources of a cloud vendor. The resource utilization module is used to flexibly use cloud server resources in the process of executing distributed reinforcement learning tasks.

[0094] Figure 6 A schematic diagram of the structure of a computing device that can be used to implement the above-mentioned distributed processing method according to an embodiment of the present disclosure is shown.

[0095] See also Figure 6 , the computing device 600 includes a memory 610 and a processor 620 .

[0096] The processor 620 may be a multi-core processor or may include multiple processors. In some embodiments, the processor 620 may include a general-purpose main processor and one or more special coprocessors, such as a graphics processing unit (GPU), a digital signal processor (DSP), etc. In some embodiments, the processor 620 may be implemented using a customized circuit, such as an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA).

[0097] The memory 610 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, ROM can store static data or instructions required by the processor 620 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at run time. In addition, the memory 610 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 610 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and transient electronic signals transmitted wirelessly or wired.

[0098] The memory 610 stores executable codes, and when the executable codes are processed by the processor 620 , the processor 620 can execute the distributed processing method mentioned above.

[0099] The distributed processing method, apparatus, and device according to the present disclosure have been described above in detail with reference to the accompanying drawings.

[0100] In addition, the method according to the present disclosure may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing the above steps defined in the above method of the present disclosure.

[0101] Alternatively, the present disclosure may also be implemented as a non-temporary machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) on which executable code (or computer program, or computer instruction code) is stored. When the executable code (or computer program, or computer instruction code) is executed by a processor of an electronic device (or computing device, server, etc.), the processor executes the various steps of the above-mentioned method according to the present disclosure.

[0102] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or a combination of both.

[0103] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the system and method according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0104] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A distributed processing method, characterized in that: include: Obtaining a distributed reinforcement learning task submitted by a user, wherein the distributed reinforcement learning task defines at least one role, the number of replicas corresponding to each role, and resource information required by each role; Parsing the distributed reinforcement learning task into a resource object that can be recognized by the cluster; as well as Cluster resources are called based on the resource object to execute the distributed reinforcement learning task.

2. The method according to claim 1, characterized in that Calling cluster resources based on the resource object to execute the distributed reinforcement learning task includes: Deploy multiple containers in the cluster based on the resource object; The distributed reinforcement learning task is performed by running the multiple containers, wherein each role corresponds to at least one container.

3. The method according to claim 2, characterized in that The multiple containers are deployed using the Gang Scheduling mode of Volcano.

4. The method according to claim 3, characterized in that The resource information includes GPU resources. The method further includes: using a cluster device plug-in to provide a scheduling service for the GPU resources in the cluster.

5. The method according to claim 2, characterized in that: Also includes: Utilize the cluster's native distributed data set orchestration and acceleration engine to mount the distributed file system in the required container to provide distributed file services for the container.

6. The method according to claim 1, characterized in that Also includes: Resources required by a distributed deep learning framework declared by a user are added to the distributed reinforcement learning task, so as to execute the distributed reinforcement learning task in a cluster by using the distributed deep learning framework.

7. The method according to claim 1, characterized in that Also includes: A development machine is created in the cluster, and the development machine is exposed to the outside of the cluster, so that a user can write and submit the distributed reinforcement learning task through the development machine.

8. The method according to claim 7, characterized in that Create a development machine in the cluster, including: A development machine is created by running a development machine image in a container in the cluster.

9. The method according to claim 8, characterized in that The development machine image also has a built-in dedicated command line tool for quickly building a corresponding image based on the current development machine system state. The method also includes: In response to a command issued by a user through the command line tool, a new development machine image is constructed and saved based on the file system state of the current development machine.

10. A distributed processing device, characterized in that: include: An acquisition module, used to acquire a distributed reinforcement learning task submitted by a user, wherein the distributed reinforcement learning task defines at least one role, the number of replicas corresponding to each role, and resource information required by each role; A parsing module, used to parse the distributed reinforcement learning task into a resource object that can be recognized by the cluster; as well as A calling module is used to call cluster resources based on the resource object to execute the distributed reinforcement learning task.

Citation Information

Patent Citations

  • Multi-agent reinforcement learning method and system based on population training

    CN112561032A

  • Distributed reinforcement learning system design method based on Kubernetes container cluster

    CN114020413A

  • Distributed training task processing method based on K8s, related equipment and medium

    CN114791856A

  • Distributed training system based on containerization and construction method thereof

    CN115344356A

  • Service orchestration within a distributed pod based system

    US20230359455A1

Cited By

  • Multi-tenant management method and system based on container and Kubernetes

    CN119668886A

  • Multi-tenant management method and system based on container and Kubernetes

    CN119668886B

  • Operation and maintenance platform for multi-agent collaborative decision-making of cloud-oriented electric power information system

    CN121213059A