Model training method and device based on distributed cluster, electronic equipment and medium

By receiving model training information on the management server, evaluating and allocating resources of heterogeneous computing power components, and generating scheduling strategies to train models on heterogeneous computing power resources, the problem of model training and deployment under heterogeneous resources is solved. Improved model applicability and resource utilization efficiency.

CN118863013APending Publication Date: 2024-10-29NEW H3C AI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410842703.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

Existing technology cannot realize the training and deployment of large models on distributed clusters with heterogeneous computing resources, resulting in limited model training and deployment in scenarios where heterogeneous computing resources are more common.

Method used

By receiving model training information on the management server, the computing power evaluation value of each target computing power component is determined and evaluated, and a scheduling strategy is generated according to the training mode, so that each target computing power component cooperates with each other to train the target model, and during data transmission Data format conversion for compatibility.

Benefits of technology

It realizes the training and deployment of the target model in the scenario of heterogeneous computing resources, improves the applicability of the model, effectively utilizes the computing resources in the distributed cluster, and avoids the waste of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118863013A_ABST
    Figure CN118863013A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a distributed cluster-based model training method and device, electronic equipment and a medium, and the method comprises the steps: converting to-be-transmitted data into a set data format and transmitting the data if any target computing power component transmits data to other target computing power components when the target computing power component cooperates with the other target computing power components to train a target model; therefore, data in different formats transmitted by different target computing power components are uniformly converted into data in the same format, training of the target model in a heterogeneous computing power resource scene is realized, training and deployment of the target model are not limited to a distributed cluster of isomorphic computing power resources any more, and applicability of the target model is improved. Besides, training tasks are allocated to the target computing power components according to the computing power evaluation values of the target computing power components, computing power differences of different types of computing power components are fully considered during task allocation, the computing power of the target computing power components can be utilized to the maximum extent, and waste of computing power resources is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communication technology, and in particular to a distributed cluster-based model training method, device, electronic device and medium. Background Art

[0002] When generating text or images, it is often necessary to use a neural network model (referred to as a big model) with a huge number of parameters and a complex model structure. However, since the computing power resources of the server itself are limited, this big model cannot be deployed and trained on a single server. Therefore, it needs to be trained and deployed through a distributed cluster.

[0003] Currently, training and deploying models through distributed clusters requires the use of computing components such as GPUs from the same manufacturer and model (i.e., using homogeneous computing resources). This results in the inability to train and deploy the above large models using distributed clusters that use computing components from different manufacturers or models (i.e., using heterogeneous computing resources). However, distributed clusters with heterogeneous computing resources are more common, so implementing the training and deployment of large models on distributed clusters with heterogeneous computing resources has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a model training method, device, electronic device and medium based on a distributed cluster to realize the training and deployment of the target model in a heterogeneous computing resource scenario, so as to improve the applicability of large models.

[0005] The embodiment of the present application provides a model training method based on a distributed cluster, wherein one of the servers in the distributed cluster is designated as a management server, and at least one computing component is deployed on any server in the distributed cluster. The method is applied to the management server, and includes:

[0006] Receive model training information; the model training information includes: training mode, and computing power component information; the computing power component information includes at least: the category of required computing power components, and the number of computing power components under each category;

[0007] Determine, based on the computing power component information, a target computing power component that satisfies the computing power component information from computing power components deployed on each server in the distributed cluster;

[0008] Predict the computing power evaluation value of each target computing power component; the computing power evaluation value of any target computing power component is positively correlated with the computing power resources configured for the computing power component;

[0009] Based on the computing power evaluation value of each target computing power component and the training mode, a scheduling strategy that satisfies the training mode is generated, so that each target computing power component cooperates with each other to train the target model based on the scheduling strategy; the scheduling strategy indicates the training tasks assigned to each target computing power component under the training mode; if any target computing power component sends data to other target computing power components when cooperating with other target computing power components to train the target model, the data to be sent is first converted into a set data format and sent; the set data format is a data format supported by all target computing power components.

[0010] As an embodiment, predicting the computing power evaluation value of each target computing power component includes:

[0011] For each target computing power component, determine the first computing power evaluation value and the second computing power evaluation value corresponding to the target computing power component; wherein the first computing power evaluation value is obtained by performing a first specified operation on the evaluation score and weight of each working parameter configured for the target computing power component; the evaluation score of any working parameter is obtained by evaluating the working parameter according to the scoring rule; the second computing power evaluation value is determined based on whether the target computing power component supports the training of the target model, when the target computing power component does not support the training of the target model, the second computing power evaluation value is the first set value, when the target computing power component supports the training of the target model, the second computing power evaluation value is the second set value, and the first set value and the second set value are different;

[0012] The computing power evaluation value of the target computing power component is determined according to the weight configured for the target computing power component, the first computing power evaluation value, and the second computing power evaluation value.

[0013] As an embodiment, the training mode is a data parallel training mode; the data parallel training mode is used to allocate corresponding training sample sets to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger number of allocated training sample sets;

[0014] Among them, according to the computing power evaluation value of each target computing power component and the training mode, the scheduling strategy that meets the training mode is generated, including:

[0015] Based on the data parallel mode, according to the computing power evaluation value of each target computing power component, the corresponding training sample set allocated to each target computing power component is determined from the total training sample set.

[0016] As an embodiment, the training mode is a pipeline parallel training mode; the pipeline parallel training mode is used to allocate a corresponding network layer to each target computing power component; wherein, a target computing power component with a higher computing power evaluation value has a larger parameter computation amount of the allocated network layer;

[0017] Among them, according to the computing power evaluation value of each target computing power component and the training mode, the scheduling strategy that meets the training mode is generated, including:

[0018] Based on the data parallel mode, according to the computing power evaluation value of each target computing power component, the corresponding network layer allocated to each target computing power component is determined from the target model.

[0019] As an embodiment, the training mode is a 3D parallel training mode; the 3D parallel training mode is used to allocate corresponding training sample sets and network layers to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger mixed computing amount corresponding to the allocated training sample set and network layer; the mixed computing amount corresponding to the allocated training sample set and network layer of any target computing power component is obtained based on the specified computing amount of the allocated training sample set of the target computing power component and the allocated parameter computing amount of the network layer;

[0020] Among them, according to the computing power evaluation value of each target computing power component and the training mode, the scheduling strategy that meets the training mode is generated, including:

[0021] Based on the data 3D parallel training mode, according to the computing power evaluation value of each target computing power component, the corresponding training sample set and network layer are allocated to each target computing power component from the target model.

[0022] The embodiment of the present application further provides a model training device based on a distributed cluster, wherein one of the servers in the distributed cluster is designated as a management server, and at least one computing component is deployed on any server in the distributed cluster. The device is applied to the management server, and includes:

[0023] A receiving module, configured to receive model training information; the model training information includes: a training mode, and computing power component information; the computing power component information includes at least: the category of computing power components required, and the number of computing power components under each category;

[0024] A determination module, configured to determine, based on the computing power component information, a target computing power component that satisfies the computing power component information from computing power components deployed on each server in the distributed cluster;

[0025] An evaluation module is used to predict the computing power evaluation value of each target computing power component; the computing power evaluation value of any target computing power component is positively correlated with the computing power resources configured for the computing power component;

[0026] A strategy generation module is used to generate a scheduling strategy that satisfies the training mode based on the computing power evaluation value of each target computing power component and the training mode, so that each target computing power component cooperates with each other to train the target model based on the scheduling strategy; the scheduling strategy indicates the training tasks assigned to each target computing power component under the training mode; if any target computing power component sends data to other target computing power components when cooperating with other target computing power components to train the target model, the data to be sent is first converted into a set data format and sent; the set data format is a data format supported by all target computing power components.

[0027] As an embodiment, predicting the computing power evaluation value of each target computing power component includes:

[0028] For each target computing power component, determine the first computing power evaluation value and the second computing power evaluation value corresponding to the target computing power component; wherein the first computing power evaluation value is obtained by performing a first specified operation on the evaluation score and weight of each working parameter configured for the target computing power component; the evaluation score of any working parameter is obtained by evaluating the working parameter according to the scoring rule; the second computing power evaluation value is determined based on whether the target computing power component supports the training of the target model, when the target computing power component does not support the training of the target model, the second computing power evaluation value is the first set value, when the target computing power component supports the training of the target model, the second computing power evaluation value is the second set value, and the first set value and the second set value are different;

[0029] The computing power evaluation value of the target computing power component is determined according to the weight configured for the target computing power component, the first computing power evaluation value, and the second computing power evaluation value.

[0030] As an embodiment, the training mode is a data parallel training mode; the data parallel training mode is used to allocate corresponding training sample sets to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger number of allocated training sample sets;

[0031] Among them, according to the computing power evaluation value of each target computing power component and the training mode, the scheduling strategy that meets the training mode is generated, including:

[0032] Based on the data parallel mode, according to the computing power evaluation value of each target computing power component, the corresponding training sample set allocated to each target computing power component is determined from the total training sample set.

[0033] As an embodiment, the training mode is a pipeline parallel training mode; the pipeline parallel training mode is used to allocate a corresponding network layer to each target computing power component; wherein, a target computing power component with a higher computing power evaluation value has a larger parameter computation amount of the allocated network layer;

[0034] Among them, according to the computing power evaluation value of each target computing power component and the training mode, the scheduling strategy that meets the training mode is generated, including:

[0035] Based on the data parallel mode, according to the computing power evaluation value of each target computing power component, the corresponding network layer allocated to each target computing power component is determined from the target model.

[0036] As an embodiment, the training mode is a 3D parallel training mode; the 3D parallel training mode is used to allocate corresponding training sample sets and network layers to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger mixed computing amount corresponding to the allocated training sample set and network layer; the mixed computing amount corresponding to the allocated training sample set and network layer of any target computing power component is obtained based on the specified computing amount of the allocated training sample set of the target computing power component and the allocated parameter computing amount of the network layer;

[0037] Among them, according to the computing power evaluation value of each target computing power component and the training mode, the scheduling strategy that meets the training mode is generated, including:

[0038] Based on the data 3D parallel training mode, according to the computing power evaluation value of each target computing power component, the corresponding training sample set and network layer are allocated to each target computing power component from the target model.

[0039] An embodiment of the present application also provides an electronic device, including: a processor and a memory for storing computer program instructions, and when the computer program instructions are executed by the processor, the processor executes the steps of the above method.

[0040] An embodiment of the present application also provides a computer program product, which, when executed by a processor, implements the steps of the above method.

[0041] An embodiment of the present application also provides a machine-readable storage medium, which stores computer program instructions. When the computer program instructions are executed, the steps of the above method can be implemented.

[0042] It can be seen from the above technical solutions that in this embodiment, after receiving the model training information, the target computing power component that meets the computing power component information is determined from the computing power components deployed on each server in the distributed cluster based on the computing power component information carried in the model training information, and the computing power evaluation value of each target computing power component is predicted, and the scheduling strategy that meets the training mode is generated according to the computing power evaluation value and training mode of each target computing power component, so that each target computing power component cooperates with each other to train the target model based on the scheduling strategy. Since any target computing power component sends data to other target computing power components when cooperating with other target computing power components to train the target model, the data to be sent is first converted into a set data format and sent, so that the data of different formats transmitted by different target computing power components are uniformly converted into the same format, which realizes the training of the target model on the distributed cluster of heterogeneous computing power resources, that is, the training of the target model in the scenario of heterogeneous computing power resources is realized, which makes the training and deployment of the target model no longer limited to the distributed cluster of homogeneous computing power resources, which improves the applicability of the target model.

[0043] Furthermore, since different computing power components can provide different computing power, the present application predicts the computing power evaluation value of each target computing power component and allocates training tasks to each target computing power component based on the computing power evaluation value of each target computing power component. This method of allocating training tasks by fully considering the computing power differences of different categories of computing power components can maximize the computing power of each target computing power component, compared to the method of equally dividing the training tasks without considering the computing power differences of each target computing power component, thereby effectively utilizing the computing power resources in the distributed cluster and avoiding the waste of computing power resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic diagram of a process for a method provided in an embodiment of the present application;

[0045] Figure 2 A network architecture diagram of a distributed cluster provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of predicting the computing power evaluation value of each target computing power component provided in an embodiment of the present application;

[0047] Figure 4 A schematic diagram of the structure of the device provided in the embodiment of the present application;

[0048] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.

[0050] See also Figure 1 , Figure 1 The method is applied to the management server of the distributed cluster, such as Figure 2 As shown, the distributed cluster includes multiple servers deployed in a distributed manner, one of which is designated as a management server. At least one computing component is deployed on any server in the distributed cluster. The computing component is a component in the server that can provide computing power and processing power, such as a graphics processing unit (GPU). The categories of the computing components in the distributed cluster are not exactly the same. The different categories of the computing components refer to different manufacturers or different models of the computing components.

[0051] based on Figure 2 The network structure shown in Figure 1 As shown, the process may include the following steps:

[0052] S101, receiving model training information; the model training information includes: training mode, and computing power component information; the computing power component information includes at least: the category of required computing power components, and the number of computing power components under each category.

[0053] In this embodiment, as an embodiment, the model training information is set by the staff according to the target model to be trained and the category of computing power components of the distributed model. For example, the target model to be trained is an image recognition model, the training mode is a data parallel mode, and 3 types of computing power components are required, and the number of computing power components of each category is 3, 5, and 7.

[0054] S102, based on the computing power component information, determine the target computing power component that meets the computing power component information from the computing power components deployed on each server in the distributed cluster.

[0055] In this embodiment, the target computing power components selected from the available servers in the distributed cluster only need to meet the required number of computing power components under each category, and the embodiment of the present application does not make specific limitations.

[0056] S103, predicting the computing power evaluation value of each target computing power component; the computing power evaluation value of any target computing power component is positively correlated with the computing power resource amount configured for the computing power component.

[0057] In this embodiment, the specific implementation method of predicting the computing power evaluation value of each target computing power component will be explained later and will not be repeated here.

[0058] S104, based on the computing power evaluation value and training mode of each target computing power component, generate a scheduling strategy that meets the training mode, so that each target computing power component cooperates with each other to train the target model based on the scheduling strategy; the scheduling strategy indicates the training tasks assigned to each target computing power component under the training mode; if any target computing power component sends data to other target computing power components when cooperating with other target computing power components to train the target model, the data to be sent is first converted into a set data format and sent; the data format is set to a data format supported by all target computing power components.

[0059] In this embodiment, the training modes include data parallel training mode, pipeline parallel training mode and 3D parallel training mode. The specific conditions of these three training modes and how the scheduling strategies are generated under these three training modes will be explained later in the form of embodiments and will not be repeated here.

[0060] In this embodiment, the data between different categories of computing power components are mutually interoperable and recognized. Therefore, the data output by each category of computing power components needs to be converted into a set data format. The specific method of data conversion will be explained in the following text in the form of an embodiment and will not be repeated here.

[0061] So far, completed Figure 1 The process shown.

[0062] pass Figure 1 It can be seen from the process shown that when any target computing power component sends data to other target computing power components when cooperating with other target computing power components to train the target model, the data to be sent is first converted into a set data format and sent. This allows data of different formats transmitted from different target computing power components to be uniformly converted into the same format, which realizes the training of the target model on a distributed cluster of heterogeneous computing power resources, that is, the training of the target model in a heterogeneous computing power resource scenario. This makes the training and deployment of the target model no longer limited to a distributed cluster of homogeneous computing power resources, which improves the applicability of the target model.

[0063] Furthermore, since different computing power components can provide different computing power, the present application predicts the computing power evaluation value of each target computing power component and allocates training tasks to each target computing power component based on the computing power evaluation value of each target computing power component. This method of allocating training tasks by fully considering the computing power differences of different categories of computing power components can maximize the computing power of each target computing power component, compared to the method of equally dividing the training tasks without considering the computing power differences of each target computing power component, thereby effectively utilizing the computing power resources in the distributed cluster and avoiding the waste of computing power resources.

[0064] The specific implementation method of the above data conversion is described in detail below:

[0065] Any type of computing power component has corresponding drivers, computing libraries and communication libraries. The computing library is a driver based on the computing power component. It is a software library used to implement parallel computing of each computing power component. Different hardware computing power components have different implementations of their own computing libraries. The communication library is a software library used for communication between various computing power components, and a software library that implements communication in each computing power component. The above two software libraries are used in combination with a distributed computing framework (such as Pytorch and Tensorflow) deployed in the management server to implement distributed training of the target model. Here, the distributed computing framework is set on the management server to coordinate and manage distributed training tasks, that is, to implement the method provided in the embodiment of the present application.

[0066] In order to realize the distributed training of the target model using different types of computing power components, it is necessary to make the data between the computing libraries and communication libraries corresponding to various computing power components interoperable and mutually recognized. Therefore, it is necessary to convert the output data of the computing library corresponding to each computing power component into a unified data format to achieve the compatibility of different types of computing power components. Specifically, in one implementation method, the output data of the computing library corresponding to each computing power component (the output data here is, for example, when a training sample travels through each computing power component, one computing power component needs to output to another computing power component) is converted into the same data format required by the distributed framework (that is, the set data format), while retaining the information of the output data. The distributed framework converts the data passed in the set data format (here the data sent by the distributed framework refers to, for example, the parameters of the initial network model sent) into a data format that can be recognized by the computing library corresponding to each computing power component, and sends it to each computing power component for data calculation.

[0067] Optionally, as an embodiment, a data converter may be configured for each computing power component to convert the data output by the computing power component into a set data format.

[0068] In this way, data in different formats transmitted from different target computing components are uniformly converted into the same format. On this basis, the training of the target model in the scenario of heterogeneous computing resources is realized, which makes the training and deployment of the target model no longer limited to the distributed cluster of homogeneous computing resources, thus improving the applicability of distributed model training.

[0069] The above data conversion is described in detail. The following is a detailed description of the computing power evaluation values ​​of each target computing power component predicted above:

[0070] Figure 3A schematic diagram of a process for predicting the computing power evaluation value of each target computing power component provided in an embodiment of the present application. Figure 3 As shown, the process may include the following steps:

[0071] S301: For each target computing power component, determine a first computing power evaluation value and a second computing power evaluation value corresponding to the target computing power component.

[0072] In this implementation, the first computing power evaluation value is obtained by performing a first specified operation on the evaluation score and weight of each working parameter configured for the target computing power component, and the evaluation score of any working parameter is obtained by evaluating the working parameter according to the scoring rule. The weight corresponding to each working parameter is determined based on the empirical value corresponding to the application scenario of the specifically trained target model.

[0073] As an embodiment, if the target computing power component is a GPU, the above working parameters include at least the GPU memory size, the GPU memory bandwidth, and the GPU processing accuracy (here, the processing accuracy refers to FP64 / FP32 / TF32 / BF16 / FP16 / FP8 / INT8 and other accuracy). For example, if the GPU memory is 1T, the evaluation score of the working parameter is 100, and if the GPU memory is 512G, the evaluation score of the working parameter is 50. The specific scoring rules for each parameter are set manually, and the embodiments of the present application do not specifically limit them.

[0074] The second computing power evaluation value is determined based on whether the target computing power component supports the training of the target model. When the target computing power component does not support the training of the target model, the second computing power evaluation value is the first set value. When the target computing power component supports the training of the target model, the second computing power evaluation value is the second set value, and the first set value and the second set value are different. For example, if the above-mentioned target computing power component supports BF16 precision, then the target computing power component supports the training of the target model, otherwise, it does not support the training of the target model. Here, BF16 is an effective half-precision floating point format designed to meet the needs of deep learning and high-performance computing.

[0075] S302, determining the computing power evaluation value of the target computing power component according to the configured weight of the target computing power component, the first computing power evaluation value, and the second computing power evaluation value.

[0076] In this embodiment, the weights configured for each target computing power component are used to balance the differences in computing power between target computing power components of different categories. The weights of target computing power components under one category are the same. The weights configured for each target computing power component are empirical values. As an embodiment, the specific implementation method of the above step S302 is: multiplying the weight configured for the target computing power component, the first computing power evaluation value, and the second computing power evaluation value to obtain the computing power evaluation value of the target computing power component.

[0077] For example, the computing power evaluation value of each target computing power component can be calculated by the following formula:

[0078] score i =Alpha i *f([scalar index n ])*g([Boolean index m ])

[0079] f([scalar index n ])=∑Beta j * Scalar indicators n

[0080] g([boolean index m ]) = sign(∏ Boolean index m )

[0081] Among them, score i is the computing power evaluation value of the i-th target computing power component, Alpha i is the weight of the i-th target computing component capacity, f([scalar indicator n ]) is the first computing power evaluation value, where Beta j is the weight of the scalar indicator (i.e., working parameter). g([Boolean indicator m ]) is a filter function whose value is 0 or 1. If the mth target computing component supports BF16 precision, its value is 1, otherwise it is 0.

[0082] The score corresponding to any target computing power component i The higher it is, the greater the amount of computing resources configured for the target computing component, and the greater the amount of computing it can handle.

[0083] The above describes in detail the computing power evaluation values ​​of each target computing power component predicted above.

[0084] The above-mentioned scheduling strategy for generating a scheduling strategy that satisfies the training mode is described in detail below in conjunction with specific embodiments.

[0085] Embodiment 1:

[0086] In this embodiment, the training mode is a data parallel training mode (DP), and the specific implementation method of the above-mentioned scheduling strategy that satisfies the parallel training mode is: allocate a corresponding training sample set to each target computing power component, and the target computing power component with a higher computing power evaluation value has a larger number of allocated training sample sets. Based on the data parallel mode, according to the computing power evaluation value of each target computing power component, determine the corresponding training sample set to be allocated to each target computing power component from the total set of training samples.

[0087] For example, the target computing component is a GPU. In the data parallel training mode, each target computing component receives the complete target model, that is, each target computing component needs to load and calculate the complete model parameters. Therefore, the amount of calculation is mainly reflected in the batch size of the training sample set processed at one time during the target model training process, that is, batch_size. Therefore, the training sample set assigned to each target computing component is determined according to the following formula:

[0088] Among them, L(score i ) is the normalized value of the computing power evaluation value of the i-th target computing power component.

[0089] Embodiment 2:

[0090] In this embodiment, the training mode is a pipeline parallel training mode (PP), and the specific implementation method of the above-mentioned generation of a scheduling strategy that satisfies the parallel training mode is: assigning a corresponding network layer to each target computing power component, and the target computing power component with a higher computing power evaluation value has a larger parameter operation amount of the assigned network layer. Based on the data parallel mode, according to the computing power evaluation value of each target computing power component, the corresponding network layer assigned to each target computing power component is determined from the target model.

[0091] For example, the target computing power component is a GPU. For the pipeline parallel training mode (PP), because the model structure of the target model is based on the hierarchical structure of the neural network, the pipeline parallel training mode mainly divides the network layer of the target model, puts different network layers into different computing power components for calculation, and then connects the results before and after the calculation through the task line. The calculation amount is mainly the parameter calculation amount before the different network layers. Because the network layer is indivisible, when allocating the network layer to each target computing power component, it is necessary to consider the superposition of the parameter calculation amount of the network layer and the computing power evaluation value, and perform pipeline parallel scheduling.

[0092] After obtaining the total amount of floating-point calculations in each network layer, the score corresponding to any target computing power component i , the larger the total amount of floating-point calculations in the network layer where the target computing power component is configured.

[0093] Embodiment 3:

[0094] In this embodiment, the training mode is the task line 3D parallel training mode (TP), and the specific implementation method of the above-mentioned scheduling strategy that satisfies the parallel training mode is as follows: each target computing power component is assigned a corresponding training sample set and network layer. The target computing power component with a higher computing power evaluation value has a larger mixed computing amount corresponding to the training sample set and network layer assigned to it. The mixed computing amount corresponding to the training sample set and network layer assigned to any target computing power component is obtained based on the specified operation of the computing amount of the training sample set assigned to the target computing power component and the parameter computing amount of the assigned network layer. Based on the data 3D parallel training mode, according to the computing power evaluation value of each target computing power component, the corresponding training sample set and network layer assigned to each target computing power component are determined from the target model.

[0095] For example, the target computing power component is a GPU. For the 3D parallel training mode, the computing power calculation of the 3D parallel training mode is basically similar to that of the pipeline parallel training mode. The difference is that the network layer can be divided into different parameter blocks, but the splitting of the parameter blocks needs to comply with certain calculation principles, rather than arbitrary division. On the basis of pipeline parallelism, the parameter blocks are unevenly distributed to devices with different computing power capabilities for calculation. Parameter blocks of different layers may be running on the same device. The computing power of the training sample set assigned to the target computing power component and the parameter computing power of the assigned network layer are specified to obtain a mixed computing power. The target computing power component with a higher computing power evaluation value has a larger mixed computing power corresponding to the assigned training sample set and network layer.

[0096] The method provided in the embodiment of the present application is described above. The device provided in the embodiment of the present application is described below:

[0097] See also Figure 4 , Figure 4 The device structure diagram provided in the embodiment of the present application. As an embodiment, the device is applied to the management server of a distributed cluster. One of the servers in the distributed cluster is designated as the management server, and at least one computing power component is deployed on any server in the distributed cluster, and the categories of the computing power components in the distributed cluster are not exactly the same. Figure 4 As shown, the device may include: a receiving module 401, a determining module 402, an evaluating module 403 and a strategy generating module 404.

[0098] The receiving module 401 is used to receive model training information; the model training information includes: training mode, and computing power component information; the computing power component information includes at least: the category of the required computing power components, and the number of computing power components under each category;

[0099] A determination module 402 is used to determine a target computing component that satisfies the computing component information from computing components deployed on each server in the distributed cluster based on the computing component information;

[0100] Evaluation module 403, used to predict the computing power evaluation value of each target computing power component; the computing power evaluation value of any target computing power component is positively correlated with the computing power resource amount configured for the computing power component;

[0101] The strategy generation module 404 is used to generate a scheduling strategy that meets the training mode based on the computing power evaluation value and training mode of each target computing power component, so that each target computing power component can cooperate with each other to train the target model based on the scheduling strategy; the scheduling strategy indicates the training tasks assigned to each target computing power component under the training mode; if any target computing power component sends data to other target computing power components when cooperating with other target computing power components to train the target model, the data to be sent is first converted into a set data format and sent; the data format is set to a data format supported by all target computing power components.

[0102] As an embodiment, predicting the computing power evaluation value of each target computing power component includes:

[0103] For each target computing power component, determine the first computing power evaluation value and the second computing power evaluation value corresponding to the target computing power component; wherein the first computing power evaluation value is obtained by performing a first specified operation on the evaluation score and weight of each working parameter configured for the target computing power component; the evaluation score of any working parameter is obtained by evaluating the working parameter according to the scoring rule; the second computing power evaluation value is determined based on whether the target computing power component supports the training of the target model, when the target computing power component does not support the training of the target model, the second computing power evaluation value is the first set value, when the target computing power component supports the training of the target model, the second computing power evaluation value is the second set value, and the first set value and the second set value are different;

[0104] The computing power evaluation value of the target computing power component is determined according to the weight configured for the target computing power component, the first computing power evaluation value, and the second computing power evaluation value.

[0105] As an embodiment, the training mode is a 3D parallel training mode; the 3D parallel training mode is used to allocate corresponding training sample sets and network layers to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger mixed computing amount corresponding to the allocated training sample set and network layer; the mixed computing amount corresponding to the allocated training sample set and network layer of any target computing power component is obtained based on the specified computing amount of the allocated training sample set of the target computing power component and the allocated parameter computing amount of the network layer;

[0106] Among them, according to the computing power evaluation value of each target computing power component and the training mode, the scheduling strategy that meets the training mode is generated, including:

[0107] Based on the data 3D parallel training mode, according to the computing power evaluation value of each target computing power component, the corresponding training sample set and network layer are allocated to each target computing power component from the target model.

[0108] As an embodiment, the training mode is a pipeline parallel training mode; the pipeline parallel training mode is used to allocate a corresponding network layer to each target computing power component; wherein, a target computing power component with a higher computing power evaluation value has a larger parameter computation amount of the allocated network layer;

[0109] Among them, according to the computing power evaluation value of each target computing power component and the training mode, the scheduling strategy that meets the training mode is generated, including:

[0110] Based on the data parallel mode, according to the computing power evaluation value of each target computing power component, the corresponding network layer allocated to each target computing power component is determined from the target model.

[0111] As an embodiment, the training mode is a 3D parallel training mode; the 3D parallel training mode is used to allocate corresponding training sample sets and network layers to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger mixed computing amount corresponding to the allocated training sample set and network layer; the mixed computing amount corresponding to the allocated training sample set and network layer of any target computing power component is obtained based on the specified computing amount of the allocated training sample set of the target computing power component and the allocated parameter computing amount of the network layer;

[0112] Among them, according to the computing power evaluation value of each target computing power component and the training mode, the scheduling strategy that meets the training mode is generated, including:

[0113] Based on the data 3D parallel training mode, according to the computing power evaluation value of each target computing power component, the corresponding training sample set and network layer are allocated to each target computing power component from the target model.

[0114] So far, completed Figure 4 Structural description of the device shown.

[0115] See also Figure 5 , Figure 5 This is a structural diagram of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.

[0116] Based on the same application concept as the above method, an embodiment of the present application also provides a machine-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.

[0117] Exemplarily, the above-mentioned machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage medium, or a combination thereof.

[0118] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A model training method based on distributed cluster, characterized in that: One of the servers in the distributed cluster is designated as a management server, and at least one computing component is deployed on any server in the distributed cluster. The method is applied to the management server and includes: Receive model training information; the model training information includes: training mode, and computing power component information; the computing power component information includes at least: the category of computing power components required, and the number of computing power components under each category; Determine, based on the computing power component information, a target computing power component that satisfies the computing power component information from computing power components deployed on each server in the distributed cluster; Predict the computing power evaluation value of each target computing power component; the computing power evaluation value of any target computing power component is positively correlated with the computing power resources configured for the computing power component; Based on the computing power evaluation value of each target computing power component and the training mode, a scheduling strategy that satisfies the training mode is generated, so that each target computing power component cooperates with each other to train the target model based on the scheduling strategy; the scheduling strategy indicates the training tasks assigned to each target computing power component under the training mode; if any target computing power component sends data to other target computing power components when cooperating with other target computing power components to train the target model, the data to be sent is first converted into a set data format and sent; the set data format is a data format supported by all target computing power components.

2. The method according to claim 1, characterized in that The predicted computing power evaluation value of each target computing power component includes: For each target computing power component, determine a first computing power evaluation value and a second computing power evaluation value corresponding to the target computing power component; wherein the first computing power evaluation value is obtained by performing a first specified operation on the evaluation score and weight of each working parameter configured for the target computing power component; the evaluation score of any working parameter is obtained by evaluating the working parameter according to the scoring rule; the second computing power evaluation value is determined based on whether the target computing power component supports the training of the target model, when the target computing power component does not support the training of the target model, the second computing power evaluation value is a first set value, when the target computing power component supports the training of the target model, the second computing power evaluation value is a second set value, and the first set value and the second set value are different; Determine the computing power evaluation value of the target computing power component according to the configured weight of the target computing power component, the first computing power evaluation value, and the second computing power evaluation value.

3. The method according to claim 1, characterized in that The training mode is a data parallel training mode; the data parallel training mode is used to allocate corresponding training sample sets to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger number of allocated training sample sets; The step of generating a scheduling strategy that satisfies the training mode based on the computing power evaluation value of each target computing power component and the training mode includes: Based on the data parallel mode, according to the computing power evaluation value of each target computing power component, a corresponding training sample set is determined from the total training sample set to be allocated to each target computing power component.

4. The method according to claim 1, characterized in that: The training mode is a pipeline parallel training mode; the pipeline parallel training mode is used to allocate a corresponding network layer to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger parameter calculation amount of the allocated network layer; The step of generating a scheduling strategy that satisfies the training mode based on the computing power evaluation value of each target computing power component and the training mode includes: Based on the data parallel mode, according to the computing power evaluation value of each target computing power component, the corresponding network layer allocated to each target computing power component is determined from the target model.

5. The method according to claim 1, characterized in that The training mode is a 3D parallel training mode; the 3D parallel training mode is used to allocate corresponding training sample sets and network layers to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger mixed computing amount corresponding to the allocated training sample set and network layer; the mixed computing amount corresponding to the allocated training sample set and network layer of any target computing power component is obtained based on the specified computing amount of the allocated training sample set and the allocated parameter computing amount of the network layer to the target computing power component; The step of generating a scheduling strategy that satisfies the training mode based on the computing power evaluation value of each target computing power component and the training mode includes: Based on the data 3D parallel training mode, according to the computing power evaluation value of each target computing power component, the corresponding training sample set and network layer allocated to each target computing power component are determined from the target model.

6. A model training device based on distributed cluster, characterized in that: One of the servers in the distributed cluster is designated as a management server, at least one computing component is deployed on any server in the distributed cluster, and the device is applied to the management server, including: A receiving module, configured to receive model training information; the model training information includes: a training mode, and computing power component information; the computing power component information includes at least: the category of the required computing power components, and the number of computing power components under each category; A determination module, configured to determine, based on the computing power component information, a target computing power component that satisfies the computing power component information from computing power components deployed on each server in the distributed cluster; An evaluation module is used to predict the computing power evaluation value of each target computing power component; the computing power evaluation value of any target computing power component is positively correlated with the computing power resources configured for the computing power component; A strategy generation module is used to generate a scheduling strategy that satisfies the training mode based on the computing power evaluation value of each target computing power component and the training mode, so that each target computing power component cooperates with each other to train the target model based on the scheduling strategy; the scheduling strategy indicates the training tasks assigned to each target computing power component under the training mode; if any target computing power component sends data to other target computing power components when cooperating with other target computing power components to train the target model, the data to be sent is first converted into a set data format and sent; the set data format is a data format supported by all target computing power components.

7. The device according to claim 6, characterized in that The predicted computing power evaluation value of each target computing power component includes: For each target computing power component, determine the first computing power evaluation value and the second computing power evaluation value corresponding to the target computing power component; wherein the first computing power evaluation value is obtained by performing a first specified operation on the evaluation score and weight of each working parameter configured for the target computing power component; the evaluation score of any working parameter is obtained by evaluating the working parameter according to the scoring rule; the second computing power evaluation value is determined based on whether the target computing power component supports the training of the target model, when the target computing power component does not support the training of the target model, the second computing power evaluation value is a first set value, when the target computing power component supports the training of the target model, the second computing power evaluation value is a second set value, and the first set value and the second set value are different; Determine the computing power evaluation value of the target computing power component according to the configured weight of the target computing power component, the first computing power evaluation value, and the second computing power evaluation value.

8. The device according to claim 6, characterized in that The training mode is a 3D parallel training mode; the 3D parallel training mode is used to allocate corresponding training sample sets and network layers to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger mixed computing amount corresponding to the allocated training sample set and network layer; the mixed computing amount corresponding to the allocated training sample set and network layer of any target computing power component is obtained based on the specified computing amount of the allocated training sample set and the allocated parameter computing amount of the network layer to the target computing power component; The step of generating a scheduling strategy that satisfies the training mode based on the computing power evaluation value of each target computing power component and the training mode includes: Based on the data 3D parallel training mode, according to the computing power evaluation value of each target computing power component, determine from the target model to allocate a corresponding training sample set and network layer to each target computing power component; or, The training mode is a pipeline parallel training mode; the pipeline parallel training mode is used to allocate a corresponding network layer to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger parameter calculation amount of the allocated network layer; The step of generating a scheduling strategy that satisfies the training mode based on the computing power evaluation value of each target computing power component and the training mode includes: Based on the data parallel mode, according to the computing power evaluation value of each target computing power component, determine from the target model to allocate a corresponding network layer to each target computing power component; or, The training mode is a 3D parallel training mode; the 3D parallel training mode is used to allocate corresponding training sample sets and network layers to each target computing power component; wherein, the target computing power component with a higher computing power evaluation value has a larger mixed computing amount corresponding to the allocated training sample set and network layer; the mixed computing amount corresponding to the allocated training sample set and network layer of any target computing power component is obtained based on the specified computing amount of the allocated training sample set and the allocated parameter computing amount of the network layer to the target computing power component; The step of generating a scheduling strategy that satisfies the training mode based on the computing power evaluation value of each target computing power component and the training mode includes: Based on the data 3D parallel training mode, according to the computing power evaluation value of each target computing power component, the corresponding training sample set and network layer allocated to each target computing power component are determined from the target model.

9. An electronic device, characterized in that: include: processor; as well as A memory, in which computer program instructions are stored, and when the computer program instructions are executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which, when executed by a processor, enable the processor to perform the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Heterogeneous sensing GPU (Graphics Processing Unit) resource allocation and scheduling method and system

    CN113535387A

  • Resource allocation method and device and electronic equipment

    CN115794421A

  • Edge end collaborative deep neural network training method based on hybrid pipeline parallelism

    CN116680070A

  • Service deployment method of hybrid cloud platform, management platform, equipment and medium

    CN116684421A

  • Machine learning workload orchestration in heterogeneous clusters

    US20230012487A1