Heterogeneous computing platform, model data processing method and device thereof, equipment and medium

By adapting multiple types of computing power node devices of heterogeneous computing platforms to the deep learning framework and unifying coding, the problem of collaborative training of different computing power node devices is solved, enabling the training of larger-scale neural network models and improving training efficiency.

CN118657193AActive Publication Date: 2024-09-17LANGCHAO ELECTRONIC INFORMATION IND CO LTD

Patent Information

Application Number
CN202410706215.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-17
Estimated Expiration
2044-05-31

AI Technical Summary

Technical Problem

Existing heterogeneous computing platforms require that the computing devices involved in training tasks are of the same generation produced by the same manufacturer, which limits the scale and training efficiency of neural network models.

Method used

By adapting multiple types of computing power node equipment of heterogeneous computing platforms to the target deep learning framework, uniformly coding each computing power node equipment, and determining the target communication interface based on the type of computing power resources, the implementation of different types of computing power node equipment Model data transmission and collaborative training between models.

Benefits of technology

It realizes collaborative training of different types of computing power node equipment, supports larger-scale neural network model training, improves training efficiency, and expands model scale without modifying hardware equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657193A
    Figure CN118657193A
Patent Text Reader

Abstract

The invention discloses a heterogeneous computing platform, a model data processing method and device thereof, equipment and a medium, and is applied to the field of heterogeneous computing. The method comprises the steps of adapting multiple classes of computing power node devices of a heterogeneous computing platform to a target deep learning framework, and jointly performing model training on a to-be-trained network model by using the same target deep learning framework. Uniformly coding each computing power node device, and determining a corresponding target communication interface in the distributed communication interfaces based on the computing power resource type corresponding to each computing power node device; and when the to-be-trained network model is issued to each computing power node device for distributed training based on the coding information of each computing power node device, model data transmission is performed among the computing power node devices through corresponding target communication interfaces. According to the method and the device, the problem that various computing power node devices are not supported to carry out heterogeneous computing in the prior art can be solved, and the neural network model can be trained by different types of computing power node devices together.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of heterogeneous computing, and in particular to a heterogeneous computing platform and a model data processing method, device, electronic device, and non-volatile storage medium thereof. Background Art

[0002] With the rapid development of artificial intelligence technology, the model scale of artificial intelligence network models continues to expand. In order to meet the computing power resources required for large-scale neural network model training, a distributed training model is used to train large-scale neural network models using heterogeneous computing platforms.

[0003] A heterogeneous computing platform is a computing system composed of computing node devices of various different types of computing resources. When related technologies use the computing node devices of a heterogeneous computing platform to collaboratively train large-scale neural network models, the computing devices involved in the training tasks must be produced by the same manufacturer, or even be of the same generation from the same manufacturer.

[0004] In view of this, enabling different types of computing node devices to jointly complete the training of neural network models is a technical problem that needs to be solved by technical personnel in the relevant field.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The present invention provides a heterogeneous computing platform and its model data processing method, device, electronic device, and non-volatile storage medium, which enable different types of computing power node devices to jointly complete the training of neural network models and can train larger-scale neural network models.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] On one hand, the present invention provides a model data processing method for a heterogeneous computing platform, comprising:

[0009] Adapting multiple types of computing node devices of a heterogeneous computing platform to a target deep learning framework, so that each computing node device of the heterogeneous computing platform uses the target deep learning framework to jointly perform model training on a network model to be trained;

[0010] Uniformly encode each computing node device, and determine the corresponding target communication interface in the distributed communication interface based on the computing resource type corresponding to each computing node device;

[0011] When the network model to be trained is sent to each computing node device for distributed training based on the coding information of each computing node device, the model data is transmitted between each computing node device through the corresponding target communication interface.

[0012] In a first exemplary implementation, the computing power node devices transmit model data through corresponding target communication interfaces, including:

[0013] When running to the distributed communication interface, obtain the computing power node device configuration information;

[0014] If the computing resource types of the first computing node device and the second computing node device currently performing data transmission are the same, the first computing node device and the second computing node device perform data transmission based on the corresponding distributed communication library;

[0015] If the computing resource types of the first computing node device and the second computing node device currently performing data transmission are different, the first computing node device and the second computing node device implement data transmission through a pre-defined method.

[0016] In a second exemplary implementation, the first computing power node device and the second computing power node device implement data transmission in a pre-defined manner, including:

[0017] Copying the input data of the distributed communication interface to the central processing unit in advance;

[0018] The first computing power node device and the second computing power node device transmit data through the central processing unit.

[0019] In a third exemplary implementation, the distributed communication interface adopts a ring protocol architecture, and the computing power node devices transmit model data through the corresponding target communication interface, including:

[0020] Obtain the total number of computing power node devices that execute the training task of the network model to be trained;

[0021] Dividing the data block of the process corresponding to each computing power node device into a plurality of sub-data blocks based on the total number;

[0022] For each process executing the training task of the network model to be trained, in the current iteration process, the current process performs a reduction operation on the data block received from the adjacent previous process and its own data in the previous iteration process to obtain a reduced target data block;

[0023] If the computing power node device corresponding to the next process adjacent to the current process has the same computing power resource type as the computing power node device corresponding to the current process, obtain a target communication library provided by the chip manufacturer of the computing power node device corresponding to the current process, and the current process sends the target data block to the next process through the target communication library;

[0024] If the computing power node device corresponding to the next process adjacent to the current process is different from the computing power resource type corresponding to the computing power node device corresponding to the current process, the input data of the distributed communication interface is copied to the central processing unit, and the current process sends the target data block to the next process through the central processing unit;

[0025] Among them, the number of each sub-data block is the same as the total number, and the number of processes is the same as the total number of computing power node devices.

[0026] In a fourth exemplary implementation, the step of uniformly encoding each computing power node device includes:

[0027] Classify each computing node device according to the computing resource type, and select the target computing resource type as the encoding benchmark;

[0028] Based on the numbering sequence of the computing power node devices included in the target computing power resource type, the computing power node devices of the remaining computing power resource types are encoded in sequence.

[0029] In a fifth exemplary implementation, the process of sending the network model to be trained to each computing node device for distributed training based on the encoding information of each computing node device includes:

[0030] After the network model to be trained is constructed based on the target deep learning framework, each computing node device that executes the training task of the network model to be trained is obtained;

[0031] Based on the encoding information of each computing power node device, the training data of the network model to be trained is sent to the corresponding computing power node device, and each computing power node device calls a preset distributed training framework to perform memory allocation and operator calculation on the network model to be trained.

[0032] In a sixth exemplary implementation, the adapting multiple types of computing node devices of a heterogeneous computing platform to a target deep learning framework includes:

[0033] When the target computing node device of the heterogeneous computing platform needs to be adapted to the target deep learning framework, the target deep learning framework is modified based on the name and runtime interface of the target computing node device, and the target deep learning framework is used as the front end, and the underlying software toolkit of the target computing node device is used as the back end, so that the target deep learning framework supports the target computing node device in a front-end and back-end separation manner.

[0034] In a seventh exemplary implementation, the modifying the target deep learning framework based on the name and runtime interface of the target computing power node device includes:

[0035] Based on the name and runtime interface of the target computing node device, modify the converter code and Python library code of the target deep learning framework accordingly;

[0036] Based on the name and runtime interface of the target computing power node device, the distributed training framework code corresponding to the network model to be trained is modified accordingly.

[0037] In an eighth exemplary implementation, the target deep learning framework is modified based on the name and runtime interface of the target computing power node device, the target deep learning framework is used as the front end, and the underlying software toolkit of the target computing power node device is used as the back end, including:

[0038] Adding a virtual device as an adapter interface of the target computing power node device in the target deep learning framework;

[0039] Registering a corresponding distributed communication interface in the target deep learning framework after adding the virtual device, and using the distributed communication interface to call a computing task execution framework; the computing task execution framework is used to perform model training on the network model to be trained;

[0040] Abstractly design the underlying software stack of the target computing power node device using the computing power task execution framework to obtain an abstracted computing power underlying software stack;

[0041] The computing power underlying software stack is configured as a backend, and the target deep learning framework as the front end is separated from the abstracted computing power underlying software stack as the backend.

[0042] In a ninth exemplary implementation, after configuring the computing power underlying software stack as a backend and separating the target deep learning framework as a frontend from the abstracted computing power underlying software stack as the backend, it further includes:

[0043] Obtain a first kernel configuration file corresponding to the target deep learning framework;

[0044] Based on a preset kernel configuration file construction rule and using the first kernel configuration file to construct a second kernel configuration file corresponding to the first kernel configuration file; wherein the second kernel configuration file is a kernel configuration file including a kernel name, a parameter type and a target corresponding relationship, and the target corresponding relationship is a corresponding relationship between the first kernel configuration file and the second kernel configuration file;

[0045] Constructing a parameter conversion module of the target deep learning framework and the computing task execution framework, so as to complete the automatic conversion operation of the corresponding parameters to be converted by calling the parameter conversion module when parameter conversion is required;

[0046] A kernel configuration file parsing operation is triggered to parse the first kernel configuration file and the second kernel configuration file corresponding to the target deep learning framework to obtain corresponding kernel configuration file parsing results, and when kernel registration and implementation are required, an automatic code generation operation is triggered to generate target code for kernel registration and kernel implementation according to the kernel configuration file parsing results and a preset type language program.

[0047] In a tenth exemplary implementation, after configuring the computing power underlying software stack as a backend and separating the target deep learning framework as a frontend from the abstracted computing power underlying software stack as the backend, it also includes:

[0048] Determine the target operator that needs to be registered;

[0049] If the backend operator of the backend supports a calculation operation corresponding to the target operator, and the target operator is a random number operator, the target operator is registered through a central processing unit.

[0050] Another aspect of the present invention provides a model data processing device for a heterogeneous computing platform, comprising:

[0051] A heterogeneous computing power adaptation module is used to adapt multiple types of computing power node devices of a heterogeneous computing platform to a target deep learning framework, so that each computing power node device of the heterogeneous computing platform uses the target deep learning framework to jointly perform model training on a network model to be trained;

[0052] The heterogeneous computing power configuration module is used to uniformly encode each computing power node device and determine the corresponding target communication interface in the distributed communication interface based on the computing power resource type corresponding to each computing power node device;

[0053] The data processing module is used to send the network model to be trained to each computing node device for distributed training based on the coding information of each computing node device, and transmit the model data between each computing node device through the corresponding target communication interface.

[0054] The present invention also provides an electronic device, comprising a processor, wherein the processor is used to implement the steps of the model data processing method for a heterogeneous computing platform as described in any of the preceding items when executing a computer program stored in a memory.

[0055] The present invention also provides a non-volatile storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the model data processing method for a heterogeneous computing platform as described in any of the preceding items are implemented.

[0056] Finally, the present invention also provides a heterogeneous computing platform, including multiple types of computing node devices and processors, wherein the processors are connected to the various types of computing node devices;

[0057] The processor is used to implement the steps of the model data processing method for a heterogeneous computing platform as described in any of the preceding items when executing the computer program stored in the memory.

[0058] The advantage of the technical solution provided by the present invention is that various types of computing power node devices of the heterogeneous computing platform are adapted to the deep learning framework, so that various computing power node devices of the heterogeneous computing platform can use the same deep learning framework. On this basis, various computing power node devices are uniformly encoded, and the communication interface is implemented in the distributed communication interface based on the computing power resource type corresponding to each computing power node device. In this way, when the heterogeneous computing platform sends the training task of the neural network model to each computing power node device, it can directly call various types of computing power node devices to perform the training task. The computing power node devices can communicate with each other through the distributed communication interface, thereby jointly completing the training of the neural network model. The more computing power node devices that participate in the training task of the heterogeneous computing platform, the larger the scale of the supported neural network model is, and the training of a larger-scale neural network model can be achieved without modifying the hardware device.

[0059] In addition, the present invention also provides corresponding implementation devices, electronic devices, non-volatile storage media and heterogeneous computing platforms for the model data processing method of heterogeneous computing platforms, further making the method more practical, and the devices, electronic devices, non-volatile storage media and heterogeneous computing platforms have corresponding advantages.

[0060] The technical features mentioned above, the technical features to be mentioned below, and the technical features shown separately in the drawings can be arbitrarily combined with each other, as long as the combined technical features are not contradictory. All feasible feature combinations are technical contents clearly recorded in this article. Any of the multiple sub-features contained in the same sentence can be applied independently, and does not have to be applied together with other sub-features. It should be understood that the above general description and the detailed description below are only exemplary and cannot limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions of the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0062] Figure 1 A schematic diagram of a flow chart of a model data processing method for a heterogeneous computing platform provided by the present invention;

[0063] Figure 2 A schematic flow chart of another model data processing method for a heterogeneous computing platform provided by the present invention;

[0064] Figure 3 A schematic diagram of a distributed communication implementation process under an exemplary embodiment provided by the present invention;

[0065] Figure 4 A schematic diagram of a distributed communication structure according to an exemplary embodiment of the present invention;

[0066] Figure 5 A structural diagram of an exemplary implementation of a model data processing device for a heterogeneous computing platform provided by the present invention;

[0067] Figure 6 A structural diagram of an exemplary embodiment of an electronic device provided by the present invention;

[0068] Figure 7 A structural diagram of an exemplary implementation of the heterogeneous computing platform provided by the present invention. DETAILED DESCRIPTION

[0069] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Among them, the terms "first", "second", "third", "fourth", etc. in the specification and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations of the two are intended to cover non-exclusive inclusions. The term "exemplary" means "used as an example, embodiment or illustrative". Any embodiment described here as "exemplary" is not necessarily interpreted as being superior or better than other embodiments.

[0070] With the continuous development of deep learning in all walks of life, the scale and performance of deep learning models have been greatly improved. Deep learning models can automatically learn the feature representation of data by building deep neural networks, thus avoiding the tedious process of manually designing features. They are widely used in technical fields such as image recognition, speech recognition, and natural language processing. With the development of AI (Artificial Intelligence) technology, neural network models have shown the characteristics of massive data, universal models, and centralized application models.

[0071] At present, the scale of neural network models is getting larger and larger, and the number of model parameters is increasing, such as billions of parameters. In the training scenario, the demand for accelerator card video memory is more than 4 times the number of parameters, but the current accelerator card generally has only tens of GiB of video memory. The data parallel method of deep learning frameworks such as PyTorch (deep learning framework) is no longer suitable for training large models. In order to meet the training needs of large-scale neural network models, the DeepSpeed ​​(Microsoft's distributed training framework) training framework uses ZeRO (zero redundancy optimization technology) to optimize the video memory occupancy problem in data parallelism through data parallelism, a distributed training strategy. In ZeRO data parallelism, the GPU (Graphics Processing Unit) with a complete network only saves part of the parameters, part of the gradients, and part of the optimizer state information, so that the parameters, gradients, and optimizer state information can be evenly distributed to multiple GPUs, thereby effectively reducing the video memory required for large-scale network models.

[0072] For DeepSpeed, its ZeRO data parallelism includes three types: one is to optimize only the optimizer state, another is to optimize the optimizer state and gradient, and the third is to optimize the optimizer state, gradient and parameters. The optimization process of the optimizer state, gradient and parameters is as follows:

[0073] For the forward calculation process, at the initial stage, each GPU only saves the parameters of the weight / accelerator card number. For example, the neural network model includes 2 layers, and there are 2 GPUs, that is, GPU1 and GPU2 participate in model training. GPU1 only saves the parameter w1 of the first layer, and GPU2 only saves the parameter w2 of the second layer. Before the forward calculation of the first layer, GPU2 needs to distribute the parameters of w1 once, and then perform the forward calculation of the first layer. Similarly, before performing the forward calculation of the second layer, the parameter w2 of the second layer needs to be distributed once, and then the forward calculation of the second layer is completed. For the data parallel back propagation process: before the back propagation calculation of the neural network model, the parameters are distributed first, and after the back propagation is completed, the gradient is collected. For example, GPU2 needs to save the gradient g2 corresponding to w2, so all other GPUs send the g2 gradient to GPU2. After GPU2 obtains the g2 gradient of other GPUs, it performs a reduction operation and saves it. Correspondingly, other GPUs delete w2 and g2. Repeat the above process until all layers have completed the back propagation calculation. For the parameter update process: Since the gradient reduction operation has been done during back propagation, ZeRO data parallelism can directly update the optimizer state information, and then update the parameters. After the optimizer state, gradients, and parameters are optimized, the video memory usage of large-scale neural network models is directly related to the number of accelerator cards involved in the calculation. The more accelerator cards involved in the calculation, the smaller the video memory usage of a single accelerator card. Although the DeepSpeed ​​training framework can greatly reduce the accelerator card video memory usage during large model training through ZeRO, this type of method is only applicable to a large class of accelerator cards, requiring the accelerator cards involved in the calculation to be produced by the same manufacturer, and even requiring the same generation of accelerator card products produced by the same manufacturer, such as the Ampere architecture (architecture name) and Hopper architecture (architecture name) GPUs provided by NVIDIA, which limits the scale of the neural network model.

[0074] In view of this, the present invention adapts various types of computing node devices to the deep learning framework, and uniformly encodes each computing node device, so that different types of computing nodes can perform heterogeneous computing and complete the training of large-scale neural network models. After introducing the technical solution of the present invention, various non-limiting implementation methods of the present invention are described in detail below. In order to better illustrate the present invention, many specific details are given in the specific implementation methods below. Those skilled in the art should understand that the present invention can also be implemented without these specific details. In some other examples, the methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present invention.

[0075] First see Figure 1 , Figure 1A flow chart of a model data processing method for a heterogeneous computing platform provided in this embodiment, this embodiment may include the following contents:

[0076] S101: Adapt multiple types of computing node devices of the heterogeneous computing platform to the target deep learning framework, so that each computing node device of the heterogeneous computing platform uses the target deep learning framework to jointly perform model training on the network model to be trained.

[0077] In the present invention, the heterogeneous computing platform is a multi-heterogeneous computing system, which deploys a group of multiple types of computing nodes with different computing performance to the same distributed computing system. It can be a single computing device such as a server installed with multiple heterogeneous acceleration cards, or a data center composed of multiple servers. The server in the data center has a built-in acceleration card, and the computing node device is a heterogeneous computing chip or acceleration card or computing card built into each server of the heterogeneous computing platform, including but not limited to GPU, FPGA (Field Programmable Gate Array), NVIDIA computing acceleration card, Cambrian computing acceleration card. Different types of heterogeneous computing resources have different advantages in different application scenarios such as artificial intelligence tasks. In order to meet the training needs of neural network models, the heterogeneous computing platform includes a variety of computing resources, each computing resource may include multiple computing node devices, and the computing node device may be a high-concurrency, high-performance AI acceleration card that can significantly shorten the training model time and improve training efficiency, so as to accelerate the training performance of the network model to be trained. Hardware device.

[0078] Among them, the target deep learning framework can be any deep learning framework such as PaddlePaddle (deep learning framework name), PyTorch (deep learning framework name), etc., which does not affect the implementation of the present invention. The multiple types of computing power node devices of the heterogeneous computing platform are adapted to the target deep learning framework, so that the underlying SDK (Software Development Kit, underlying software toolkit) of each computing power node device of the heterogeneous computing platform is decoupled from the target deep learning framework, so that each computing power node device of the heterogeneous computing platform can share the target deep learning framework, that is, use the same set of training codes of the target deep learning framework.

[0079] S102: Uniformly encode each computing power node device, and determine the corresponding target communication interface in the distributed communication interface based on the computing power resource type corresponding to each computing power node device.

[0080] In the present invention, the heterogeneous computing platform includes a variety of computing power resources, and the original number of each computing power node device is numbered within the range of the computing power resource type to which it belongs. For example, the heterogeneous computing platform includes NVIDIA GPU1, NVIDIA GPU2, NVIDIA GPU3, Cambrian accelerator card 1 and Cambrian accelerator card 2. The original numbers of NVIDIA GPU1, NVIDIA GPU2, Cambrian accelerator card 1 and Cambrian accelerator card 2 are device_id (device identification number) = 0, device_id = 1, device_id = 2, device_id = 0, device_id = 1. In this way, the numbering information is used. It is impossible to accurately locate which computing power node device, so in order to realize that the heterogeneous computing platform can utilize these various types of computing power node devices, each computing power node device shares the same target deep learning framework code, and the computing power node devices can be uniformly encoded. The so-called unified encoding refers to re-encoding based on the original numbering, so that the heterogeneous computing platform can uniquely locate which computing power node device is when calling each computing power node device. At the same time, since the present invention does not modify the hardware device, the underlying logic still uses the original numbering, so after the unified encoding, a corresponding relationship needs to be set, that is, the new number after the unified encoding has a corresponding relationship with the original numbering. For example, the heterogeneous computing platform includes NVIDIA GPU1, NVIDIA GPU2, NVIDIA GPU3, Cambrian accelerator card 1 and Cambrian accelerator card 2. The new numbering after encoding can correspond to device_id=0, device_id=1, device_id=2, device_id=3, and device_id=4. It is understandable that in the distributed training mode, each computing node device will share the model parameters of the current iteration process with each other during the training of the network model to be trained. Taking the Ring-allreduce architecture as an example, each computing node device participating in the model training is a worker and forms a ring. In an iterative process, each worker completes the training of its own mini-batch sample data, calculates the gradient, and passes the gradient to the next worker in the ring. At the same time, it also receives the gradient from the previous worker. In order to realize the communication between each computing node device, after the unified coding of each computing node device, it is necessary to determine the corresponding communication interface for each computing node device. For the convenience of description, it is defined as the target communication interface. This step is based on the computing resource type corresponding to each computing node device to determine which communication interface is used for communication between each computing node device.

[0081] S103: When the network model to be trained is sent to each computing node device for distributed training based on the coding information of each computing node device, the model data is transmitted between each computing node device through the corresponding target communication interface.

[0082] In this embodiment, the user sends a distributed training task to the heterogeneous computing platform. The heterogeneous computing platform can automatically determine the computing power node device that matches the distributed training task based on the training parameters of the network model to be trained, or it can determine the computing power node device that matches the distributed training task based on the computing power resources and the number of computing power node devices selected by the user. Each computing power node device in this embodiment includes at least the computing power node device selected to execute the distributed training task. The heterogeneous computing platform can uniquely determine the corresponding computing node device based on the encoding information after unified encoding. After the network model to be trained is constructed based on the target deep learning framework, each computing node device that executes the training task of the network model to be trained is obtained. Based on the encoding information of each computing node device, the training data of the network model to be trained, such as the training sample data and the network model to be trained, are sent to the corresponding computing node device. Each computing node device calls the preset distributed training framework to start memory allocation and operator calculation for the network model to be trained. The deep learning algorithm is composed of computing units, which are operators. In the network model to be trained, the operator corresponds to the calculation logic in the layer. For example, the convolution layer is an operator, the weight summation process in the fully connected layer is an operator, and the activation function is also an operator. After the operator calculation is completed, it runs to the distributed communication interface, and the model data is transmitted between the computing node devices through the corresponding target communication interface until the distributed training task is completed.

[0083] In the technical solution provided in this embodiment, various types of computing power node devices of the heterogeneous computing platform are adapted to the deep learning framework, so that various computing power node devices of the heterogeneous computing platform can use the same deep learning framework. On this basis, various computing power node devices are uniformly encoded, and the communication interface is implemented in the distributed communication interface based on the computing power resource type corresponding to each computing power node device. In this way, when the heterogeneous computing platform sends the training task of the neural network model to each computing power node device, it can directly call various types of computing power node devices to perform the training task. The computing power node devices can communicate with each other through the distributed communication interface, thereby jointly completing the training of the neural network model. The more computing power node devices that participate in the training task of the heterogeneous computing platform, the larger the scale of the supported neural network model is, and the training of a larger-scale neural network model can be achieved without modifying the hardware device.

[0084] In the above embodiment, there is no limitation on how to execute step S103. In this embodiment, an exemplary implementation method for communicating between computing power node devices through corresponding target communication interfaces is provided, which may include the following contents:

[0085] When running to the distributed communication interface, the configuration information of the computing power node device is obtained; if the computing power resource types of the first computing power node device and the second computing power node device currently performing data transmission are the same, the first computing power node device and the second computing power node device perform data transmission based on the corresponding distributed communication library; if the computing power resource types of the first computing power node device and the second computing power node device currently performing data transmission are different, the first computing power node device and the second computing power node device implement data transmission through a pre-customized method.

[0086] In this embodiment, the computing node device configuration information includes at least the computing node type to which each computing node device belongs. Figure 2 As shown, based on the configuration information of the computing node device, it is determined whether the computing data types of the computing node devices participating in the execution of the training task are the same. For example, if the first computing node device is NVIDIA GPU board 1 and the second computing node device is Cambrian board 1, the computing resource types of the first computing node device and the second computing node device are different; for example, if the first computing node device is NVIDIA GPU board 1 and the second computing node device is NVIDIA GPU board 2, the computing resource types of the first computing node device and the second computing node device are the same; computing node devices of the same type are implemented using the distributed communication library provided by the chip manufacturer, and computing node devices of different types can communicate through a custom interface. For example, as a simple and efficient communication method, different types of computing node devices can realize distributed communication through the CPU (central processing unit). Correspondingly, the input data of the distributed communication interface is copied to the central processing unit in advance, so that when it is determined that the first computing node device and the second computing node device belong to different computing resource types, the first computing node device and the second computing node device can transmit data through the central processing unit.

[0087] From the above, it can be seen that after the underlying software toolkit of the computing power node device is decoupled from the deep learning framework, this embodiment configures the computing power node device to enable the same type of computing power node devices to communicate directly through the distributed communication library provided by the chip manufacturer, and different types of computing power node devices to communicate through the CPU distributed communication interface, so that different types of boards can perform heterogeneous computing, thereby realizing heterogeneous computing of large-scale models.

[0088] It should be noted that there is no strict order of execution between the steps in the present invention. As long as they comply with the logical order, these steps can be executed simultaneously or in a certain preset order. Figure 1-Figure 2 This is just a schematic and does not mean that this is the only execution order.

[0089] In the above embodiment, there is no limitation on how to execute step S103. This embodiment adopts a ring protocol architecture based on a distributed communication interface, and also provides another exemplary implementation method for each computing power node device to communicate through a corresponding target communication interface. This embodiment may include the following contents:

[0090] The total number of computing node devices that execute the training task of the network model to be trained is obtained; based on the total number, the data block of the process corresponding to each computing node device is divided into multiple sub-data blocks, each sub-data block is the same as the total number, and the number of processes is the same as the total number of computing node devices. For each process that executes the training task of the network model to be trained, in the current iteration process, the current process performs a run-reduction operation on the data block of the adjacent previous process and its own data in the previous iteration process to obtain the reduced target data block; if the computing node device corresponding to the next process adjacent to the current process is the same as the computing resource type corresponding to the computing node device corresponding to the current process, the target communication library provided by the chip manufacturer of the computing node device corresponding to the current process is obtained, and the current process sends the target data block to the next process through the target communication library; if the computing node device corresponding to the next process adjacent to the current process is different from the computing resource type corresponding to the computing node device corresponding to the current process, the input data of the distributed communication interface is copied to the central processing unit, and the current process sends the target data block to the next process through the central processing unit.

[0091] In this embodiment, the computing node device participating in the execution of the network model to be trained has one process, and the data block of each process is divided into multiple sub-data blocks, and the total number of sub-data blocks is the same as the total number of computing node devices participating in the execution of the network model to be trained. Figure 3 and Figure 4For example, the distributed communication interface takes Ring-AllReduce as an example. The heterogeneous computing platform includes 2 NVIDIA GPUs and 2 Cambrian accelerator cards, and correspondingly, includes process 1, process 2, process 3 and process 4. The uniformly encoded information is device_id=0, 1 for NVIDIA GPU and device_id=2, 3 for Cambrian accelerator card. Each process divides the array into 4 sub-arrays, chunk represents the data block, and chunk[p] represents the data block of the pth process. Afterwards, process p runs the reduction operation on the received chunk[p-1] and its own chunk[p-1] and sends the reduced chunk to the next process p+1. When the next node in the ring node is an accelerator card of the same type, the distributed communication interface provided by the chip manufacturer is directly used. For example, NVIDIA GPU uses nccl (NVIDIA Collective Communications Library, NVIDIA's high-performance distributed computing communication library) for communication, and Cambricon accelerator card uses cnnl (Cambricon Communications Library, Cambricon Communication Library) for communication. When the next node in the ring node is an accelerator card of a different type, the data to be communicated is copied from the device to the CPU, and communication is carried out through CPU distributed communication. Repeat the above data receiving-reducing-data sending operations three times, and each process will have a different part of the original array.

[0092] It can be seen from the above that the present invention can realize heterogeneous computing of various types of accelerator cards for a heterogeneous computing platform adopting the Ring-AllReduce architecture, which is beneficial to increasing the scale of the network model to be trained.

[0093] The above embodiment does not impose any limitation on the unified encoding of each computing power node device. Based on the above embodiment, the present invention also provides a simple encoding method, which may include the following contents: classifying each computing power node device according to the computing power resource type, and selecting the target computing power resource type as the encoding basis; based on the numbering sequence of the computing power node devices included in the target computing power resource type, the computing power node devices of the remaining computing power resource types are encoded in sequence.

[0094] In this embodiment, the unified coding is to number each computing node device in sequence, and the coding reference refers to the starting position of the number, or the computing node device type without changing the original coding. For example, a computing node includes 4 NVIDIA GPU boards and 4 Cambrian accelerator cards. NVIDIA is used as the coding reference. After unified coding, the 4 NVIDIA GPU boards are numbered 0, 1, 2, and 3, and the 4 Cambrian boards are numbered 5, 6, 7, and 8 instead of the original numbers 0, 1, 2, and 3.

[0095] The above embodiment does not limit how to adapt multiple types of computing power node devices to the target deep learning framework. The present invention also provides an implementation method for adapting the deep learning framework to the computing power node devices of the heterogeneous computing platform, that is, the target computing power node devices, which may include the following contents:

[0096] When the target computing node device of the heterogeneous computing platform needs to be adapted to the target deep learning framework, the target deep learning framework is modified based on the name and runtime interface of the target computing node device. The target deep learning framework is used as the front end, and the underlying software toolkit of the target computing node device is used as the back end, so that the target deep learning framework supports the target computing node device through the front-end and back-end separation.

[0097] In this embodiment, the adaptation of the target computing node device to the target deep learning framework is to integrate and optimize the target computing node device with the target deep learning framework, so that the target deep learning framework can better utilize the computing power of the target computing node device and accelerate the training and reasoning process of the deep learning model. This embodiment achieves the adaptation between the two by isolating the front and back ends. It can be understood that in order to support the target computing node device and provide computing support for the target computing node device, the target deep learning framework uses the same computing node device name, adapts the operator implementation and runtime interface, and based on the name and runtime interface of the target computing node device, the converter code of the target deep learning framework and the code of the Python library are modified accordingly, thereby ensuring the training function of the network model to be trained. Based on the name and runtime interface of the target computing node device, the distributed training framework code corresponding to the network model to be trained is modified accordingly to complete the support for the operator implementation and runtime interface. Taking the target deep learning framework as PyTorch and the distributed training framework as DeepSpeed ​​as an example, it is necessary to modify the codes in the transformers (converter) and accelerate (a Python library name) libraries according to the newly added device names and runtime interfaces of PyTorch to ensure the function of large model training; according to the newly added device names and runtime interfaces of PyTorch, modify the DeepSpeed ​​code to complete the support of runtime and custom operators.

[0098] Exemplarily, a virtual device serving as an adapter interface of a target computing power node device is added to a target deep learning framework; a corresponding distributed communication interface is registered in the target deep learning framework after adding the virtual device, and a computing power task execution framework is called using the distributed communication interface; the computing power task execution framework is used to abstractly design the underlying software stack of the target computing power node device to obtain an abstracted computing power underlying software stack; the computing power underlying software stack is configured as a backend, and the target deep learning framework serving as a front end is separated from the abstracted computing power underlying software stack serving as a backend.

[0099] Among them, the virtual device is the adapter interface of the target computing power node device, and the computing power task execution framework is used to train the model of the network model to be trained; the computing power task execution framework includes a unified Runtime interface, a unified kernel interface and a unified distributed communication interface, so as to call the Runtime library of the target computing power node device through the unified Runtime interface, call the operator acceleration library of the target computing power node device through the unified kernel interface, and call the distributed communication library of the target computing power node device through the unified distributed communication interface. After completing the addition of the virtual device in the target deep learning framework, register the distributed communication interface in the target deep learning framework to which the virtual device is added, and then call the computing power task execution framework using the distributed communication interface. It can be understood that the corresponding virtual distributed communication interface is registered in the target deep learning framework, and the distributed communication interface is used to implement the call of the computing power task execution framework. The computing power task execution framework abstracts the underlying software stack of the target computing power node devices provided by each manufacturer, which can not only shield the differences in the underlying software stacks of different target computing power node devices, but also determine the actual running target computing power node device according to the computing power task execution framework. The target deep learning framework content is used as the front end, and the content related to the underlying software stack of the target computing power node device is used as the back end, and the front-end and back-end are separated. This makes it unnecessary for the target computing power node device manufacturer to pay attention to the implementation and version update of the target deep learning framework, thereby simplifying the work of adapting the target deep learning framework to the target computing power node device. In addition, through the separation of the front-end and back-end, the properties related to the hardware device can be adjusted to the computing power task execution framework, so that the kernel registration and implementation of the target deep learning framework no longer depend on the specific underlying software stack of the target computing power node device, and automatic code generation can be achieved.

[0100] Taking the target deep learning framework as PyTorch as an example, the PyTorch framework content includes Device, kernel, Runtime interface and distributed communication interface. It implements Device registration through patches, implements Runtime interface, kernel and distributed communication interface through framework extension mechanism, and completes code automatic generation through kernel registration and implementation. The process of PyTorch framework adaptation development is: complete the development of Device registration in the PyTorch framework source code, build kernel configuration files, realize kernel automatic code generation, complete kernel registration and implementation, then develop Runtime content, complete PyTorch Runtime support, and then complete the development of distributed communication interface, and finally build a network model for training, and achieve faster model training and reasoning speed by adapting the target computing power node device. Correspondingly, the target computing power node device adaptation method may include: determining the Runtime interface corresponding to the general parallel computing architecture runtime in the target deep learning framework, and redirecting the Runtime interface corresponding to the general parallel computing architecture runtime in the target deep learning framework to the Runtime interface corresponding to the backend runtime. By reusing the Python API (Application Programming Interface) and CUDA (Compute Unified Device Architecture) related interfaces in the PyTorch framework, it connects to the GPU development ecosystem of the PyTorch framework and implements the switching of target computing node devices through the backend. There is no need to modify the source code of the third-party software stack developed based on the PyTorch framework, such as torchvision (software library name), transformers, etc., which greatly improves the versatility and ease of use of the target computing node device to adapt to the PyTorch framework.

[0101] In order to achieve the accuracy of adaptation, it is also necessary to complete the registration and implementation of the kernel accordingly, which may include the following contents: obtaining a first kernel configuration file corresponding to the target deep learning framework; constructing a second kernel configuration file corresponding to the first kernel configuration file based on a preset kernel configuration file construction rule and using the first kernel configuration file; wherein the second kernel configuration file is a kernel configuration file including a kernel name, a parameter type and a target correspondence relationship, the target correspondence relationship is the correspondence relationship between the first kernel configuration file and the second kernel configuration file, and the second kernel configuration file includes a kernel name, a parameter type and a correspondence relationship between the first kernel configuration file and the second kernel configuration file. Construct a parameter conversion module for the target deep learning framework and the computing task execution framework, so that when parameter conversion is required, the parameter conversion module is called to complete the automatic conversion operation of the corresponding parameters to be converted. For example, a parameter conversion module for the PyTorch framework and the computing task execution framework is constructed to realize automatic parameter conversion. The kernel configuration file parsing operation parses the first kernel configuration file and the second kernel configuration file corresponding to the target deep learning framework to obtain the corresponding kernel configuration file parsing results, and when kernel registration and implementation are required, the automatic code generation operation is triggered to generate the target code for kernel registration and kernel implementation according to the kernel configuration file parsing results and the preset type language program.

[0102] In addition, during the adaptation process, operator registration is also required. When registering an operator, first determine whether the backend operator supports the operation corresponding to the operator. If the backend operator supports the operation corresponding to the operator, it means that there is a corresponding implementation in the backend operator, and the operator registration can be performed. In order to avoid inconsistent random weights generated by different boards, resulting in abnormal gradient updates, the random number operator can be implemented by the CPU, that is, determine the target operator that needs to be registered; if the backend operator of the backend supports the calculation operation corresponding to the target operator, and the target operator is a random number operator, the target operator is registered through the central processing unit.

[0103] In order to make the adaptation process of the present invention more clearly understood by those skilled in the art, the present invention also takes the target deep learning framework as PyTorch and the target computing node device as Cambrian MLU-370 as an example to provide an exemplary implementation, which may include the following contents:

[0104] When the Cambrian MLU-370 is added to the PyTorch framework, the Cambrian MLU-370 is used to adapt the underlying software stack SDK-1.15.0, that is, when the Cambrian MLU-370 accelerator card needs to be adapted to the PyTorch framework, the computing task execution framework is called, and the Cambrian MLU-370 accelerator card is adapted to the PyTorch framework in accordance with the computing task execution framework adaptation method in the embodiment of the present invention, so as to use the PyTorch framework adapted to the Cambrian MLU-370 accelerator card to accelerate the training and reasoning speed of the neural network model, that is, the Runtime library CNRT (Compute Network Runtime) is called through the unified Runtime interface provided in the computing task execution framework, wherein the Runtime interface represents an interface for interacting with a specific hardware accelerator, and the high-performance operator library CNNL (Convolutional Neural Network) is implemented through the unified kernel interface provided in the computing task execution framework. The call of the operator of the Cambrian MLU-370 can be realized by the unified distributed communication interface provided in the computing task execution framework, and finally, the function verification of the Runtime interface, kernel interface, and distributed communication interface can be completed according to the corresponding call results, and then the PyTorch framework adapted to the Cambrian MLU-370 can be used to accelerate the training of the neural network model, such as using the Cambrian MLU-370 to accelerate the training of ResNet50 (deep learning network model structure).

[0105] As can be seen from the above, this embodiment uses the target deep learning framework content as the front end and the content related to the underlying software stack of the target computing power node device as the back end to separate the front and back ends, so that the target computing power node device manufacturer does not need to pay attention to the implementation and version update of the PyTorch framework, and avoids modifying the source code content of the PyTorch framework, thereby simplifying the work of adapting PyTorch to AI acceleration cards and improving the usability and versatility of AI acceleration cards to the PyTorch framework. Based on the front-end and back-end separation method, automatic code generation for kernel registration in the PyTorch framework is implemented, thereby simplifying the development workload of kernel registration in the PyTorch framework, and being able to quickly adapt to version updates of the PyTorch framework; further, the random number operator is implemented through the CPU to avoid inconsistent random weights generated by different computing power node devices, resulting in abnormal gradient updates.

[0106] Furthermore, in order to ensure that the heterogeneous computing platform efficiently completes the training task of the network model to be trained, during the training process of the network model to be trained, a thread can be constructed to monitor whether the memory continues to increase, that is, whether a memory leak occurs. If the memory continues to increase, the cause of the memory leak can be determined first, for example, by checking the network structure and the code in the training process to determine whether there is an unreasonable network structure design or an erroneous operation in the training process. If the network structure is unreasonable, the number of neural network layers and nodes can be reduced, or a more efficient network layer can be used. For example, using 1x1 convolution instead of a fully connected layer can reduce memory usage. If the memory continues to increase due to the training process, the optimizer and learning rate can be readjusted to make the model converge better and reduce memory usage. In addition, the fit_generator function (function name) of Keras (open source artificial neural network library) can be used to generate data batch by batch, and release memory after each batch, limiting the memory usage during the training process and reducing the memory usage. Furthermore, the training data scale of each computing power node device can be further divided into multiple batches to further reduce memory usage and improve training efficiency.

[0107] The present invention also provides a corresponding device for the model data processing method of the heterogeneous computing platform, which further makes the method more practical. Among them, the device can be described from the perspective of functional modules and hardware. The model data processing device of the heterogeneous computing platform provided by the present invention is introduced below. The device is used to implement the model data processing method of the heterogeneous computing platform provided by the present invention. In this embodiment, the model data processing device of the heterogeneous computing platform may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to complete the model data processing method of the heterogeneous computing platform disclosed in the first embodiment. The program module referred to in this embodiment refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the model data processing device of the heterogeneous computing platform in the storage medium than the program itself. The following description will specifically introduce the functions of each program module of this embodiment. The model data processing device of the heterogeneous computing platform described below and the model data processing method of the heterogeneous computing platform described above can be referred to each other.

[0108] From the perspective of functional modules, see Figure 5 , Figure 5 A structural diagram of a model data processing device for a heterogeneous computing platform provided in this embodiment in a specific implementation manner, the device may include:

[0109] The heterogeneous computing power adaptation module 501 is used to adapt multiple types of computing power node devices of the heterogeneous computing platform to the target deep learning framework, so that each computing power node device of the heterogeneous computing platform uses the target deep learning framework to jointly perform model training on the network model to be trained;

[0110] The heterogeneous computing power configuration module 502 is used to uniformly encode each computing power node device and determine the corresponding target communication interface in the distributed communication interface based on the computing power resource type corresponding to each computing power node device;

[0111] The data processing module 503 is used to transmit the model data between the computing node devices through the corresponding target communication interface when the network model to be trained is sent to each computing node device for distributed training based on the coding information of each computing node device.

[0112] Illustratively, in some implementations of this embodiment, the data processing module 503 may also be used to:

[0113] When running to the distributed communication interface, obtain the computing power node device configuration information;

[0114] If the computing resource types of the first computing node device and the second computing node device currently performing data transmission are the same, the first computing node device and the second computing node device perform data transmission based on the corresponding distributed communication library;

[0115] If the computing resource types of the first computing node device and the second computing node device currently performing data transmission are different, the first computing node device and the second computing node device implement data transmission through a pre-customized method.

[0116] As an exemplary implementation of the above embodiment, the above data processing module 503 may be further used for:

[0117] Copying input data of the distributed communication interface to the central processor in advance;

[0118] The first computing power node device and the second computing power node device transmit data through the central processing unit.

[0119] Illustratively, in some other implementations of this embodiment, the data processing module 503 may also be used for:

[0120] The distributed communication interface adopts a ring protocol architecture to obtain the total number of computing power node devices that execute the training task of the network model to be trained;

[0121] Divide the data block of the process corresponding to each computing power node device into multiple sub-data blocks based on the total number;

[0122] For each process executing the training task of the network model to be trained, in the current iteration, the current process performs a reduction operation on the data block received from the adjacent previous process and its own data in the previous iteration to obtain the reduced target data block;

[0123] If the computing node device corresponding to the next process adjacent to the current process has the same computing resource type as the computing node device corresponding to the current process, obtain the target communication library provided by the chip manufacturer of the computing node device corresponding to the current process, and the current process sends the target data block to the next process through the target communication library;

[0124] If the computing power node device corresponding to the next process adjacent to the current process is different from the computing power resource type corresponding to the computing power node device corresponding to the current process, the input data of the distributed communication interface is copied to the central processing unit, and the current process sends the target data block to the next process through the central processing unit;

[0125] Among them, the number of sub-data blocks is the same as the total number, and the number of processes is the same as the total number of computing power node devices.

[0126] For example, in some other implementations of this embodiment, the heterogeneous computing power configuration module 502 may also be used for:

[0127] Classify each computing node device according to the computing resource type, and select the target computing resource type as the encoding benchmark;

[0128] Based on the numbering sequence of the computing power node devices included in the target computing power resource type, the computing power node devices of the remaining computing power resource types are encoded in sequence.

[0129] Illustratively, in some other implementations of this embodiment, the data processing module 503 may also be used for:

[0130] After the network model to be trained is constructed based on the target deep learning framework, each computing node device that executes the training task of the network model to be trained is obtained;

[0131] Based on the encoding information of each computing node device, the training data of the network model to be trained is sent to the corresponding computing node device, and each computing node device calls the preset distributed training framework to perform memory allocation and operator calculation on the network model to be trained.

[0132] For example, in some other implementations of this embodiment, the heterogeneous computing power adaptation module 501 may also be used for:

[0133] When the target computing node device of the heterogeneous computing platform needs to be adapted to the target deep learning framework, the target deep learning framework is modified based on the name and runtime interface of the target computing node device. The target deep learning framework is used as the front end, and the underlying software toolkit of the target computing node device is used as the back end, so that the target deep learning framework supports the target computing node device through the front-end and back-end separation.

[0134] As an exemplary implementation of the above embodiment, the heterogeneous computing power adaptation module 501 may be further used for:

[0135] Based on the name and runtime interface of the target computing node device, modify the converter code and Python library code of the target deep learning framework accordingly;

[0136] Based on the name and runtime interface of the target computing node device, the distributed training framework code corresponding to the network model to be trained is modified accordingly.

[0137] As another exemplary implementation of the above embodiment, the heterogeneous computing power adaptation module 501 may be further used for:

[0138] Add a virtual device as an adapter interface for the target computing node device in the target deep learning framework;

[0139] Register the corresponding distributed communication interface in the target deep learning framework after adding the virtual device, and use the distributed communication interface to call the computing task execution framework; the computing task execution framework is used to train the network model to be trained;

[0140] Use the computing power task execution framework to abstractly design the underlying software stack of the target computing power node device to obtain the abstracted computing power underlying software stack;

[0141] Configure the computing power underlying software stack as the backend, and separate the target deep learning framework as the frontend from the abstracted computing power underlying software stack as the backend.

[0142] As an exemplary implementation of the above embodiment, the heterogeneous computing power adaptation module 501 may be further used for:

[0143] Obtain a first kernel configuration file corresponding to a target deep learning framework;

[0144] Based on the preset kernel configuration file construction rule and using the first kernel configuration file to construct a second kernel configuration file corresponding to the first kernel configuration file; wherein the second kernel configuration file is a kernel configuration file including a kernel name, a parameter type and a target corresponding relationship, and the target corresponding relationship is a corresponding relationship between the first kernel configuration file and the second kernel configuration file;

[0145] Construct a parameter conversion module for the target deep learning framework and the computing task execution framework, so that when parameter conversion is required, the parameter conversion module can be called to complete the automatic conversion operation of the corresponding parameters to be converted;

[0146] A kernel configuration file parsing operation is triggered to parse the first kernel configuration file and the second kernel configuration file corresponding to the target deep learning framework to obtain the corresponding kernel configuration file parsing results, and when kernel registration and implementation are required, an automatic code generation operation is triggered to generate target code for kernel registration and kernel implementation according to the kernel configuration file parsing results and a preset type language program.

[0147] As an exemplary implementation of the above embodiment, the heterogeneous computing power adaptation module 501 may be further used for:

[0148] Determine the target operator that needs to be registered;

[0149] If the backend operator of the backend supports the calculation operation corresponding to the target operator, and the target operator is a random number operator, the target operator is registered through the central processing unit.

[0150] The functions of the functional modules of the model data processing device of the heterogeneous computing platform of this embodiment can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0151] From the above, it can be seen that this embodiment enables different types of computing power node devices to jointly complete the training of the neural network model, and can train larger-scale neural network models.

[0152] The model data processing device of the heterogeneous computing platform mentioned above is described from the perspective of functional modules. Furthermore, the present invention also provides an electronic device, which is described from the perspective of hardware. Figure 6 The following is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention in one implementation manner. Figure 6 As shown, the electronic device includes a memory 60 for storing computer programs; a processor 61 for implementing the steps of the model data processing method for a heterogeneous computing platform mentioned in any of the above embodiments when executing the computer program.

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

[0154] The memory 60 may include one or more computer non-volatile storage media, which may be non-transitory. The memory 60 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the memory 60 may be an internal storage unit of an electronic device, such as a hard disk of a server. In other embodiments, the memory 60 may also be an external storage device of an electronic device, such as a plug-in hard disk equipped on a server, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 60 may also include both an internal storage unit of an electronic device and an external storage device. The memory 60 may not only be used to store application software and various types of data installed in the electronic device, such as: the code of the program in the process of executing the model data processing method of the heterogeneous computing platform, etc., but also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 60 is used to store at least the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, the relevant steps of the model data processing method of the heterogeneous computing platform disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include, but is not limited to, data corresponding to the model data processing results of the heterogeneous computing platform, etc.

[0155] In some embodiments, the electronic device may further include a display screen 62, an input / output interface 63, a communication interface 64 or a network interface, a power supply 65 and a communication bus 66. Among them, the display screen 62 and the input / output interface 63 such as a keyboard belong to the user interface, and exemplary user interfaces may also include standard wired interfaces, wireless interfaces, etc. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface. The communication interface 64 may exemplarily include a wired interface and / or a wireless interface, such as a WI-FI interface, a Bluetooth interface, etc., which are generally used to establish a communication connection between the electronic device and other electronic devices. The communication bus 66 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0156] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than those shown in the figure, for example, it may also include a sensor 67 for realizing various functions.

[0157] The functions of the functional modules of the electronic device described in this embodiment can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0158] From the above, it can be seen that this embodiment enables different types of computing power node devices to jointly complete the training of the neural network model, and can train larger-scale neural network models.

[0159] It is understandable that if the model data processing of the heterogeneous computing platform in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes but is not limited to: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electrically erasable programmable ROM, register, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program codes. Based on this, the present invention also provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of model data processing of the heterogeneous computing platform recorded in any of the above embodiments are performed.

[0160] It is understandable that if the model data processing of the heterogeneous computing platform in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, the computer software product does not need to be stored in a physical storage medium. For example, it can be directly transmitted to a computer or other device with information processing capabilities through a wired network or a wireless network to perform all or part of the steps of the methods of each embodiment of the present invention. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product. Based on this, the present invention also provides a computer program product that stores a computer program. When the computer program is executed by a processor, the steps of the model data processing of the heterogeneous computing platform recorded in any of the above embodiments are performed.

[0161] The present invention also provides a heterogeneous computing platform, see Figure 7 , which may include:

[0162] The heterogeneous computing platform includes multiple types of computing power node devices 70 and a processor 61, and the processor 61 is connected to each type of computing power node device; the processor 61 is used to implement the steps of the model data processing method of the heterogeneous computing platform recorded in any of the above embodiments when executing the computer program stored in the memory 60. The computing power resource type and the number of computing power node devices contained in the heterogeneous computing platform can be flexibly selected according to actual conditions, and the processor 61 can be connected to each computing power node device 70 through any communication method, such as wired connection and remote connection. The processor 61 can be deployed on a server node in the heterogeneous computing platform, and the server node can be the node with the highest computing power performance among all computing devices in the heterogeneous computing platform. As an exemplary embodiment, the processor 61 can also be deployed on any server outside the heterogeneous computing platform, and the server is in communication connection with each computing power node device of the heterogeneous computing platform.

[0163] The functions of the functional modules of the heterogeneous computing platform system described in the embodiment of the present invention can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0164] From the above, it can be seen that this embodiment enables different types of computing power node devices to jointly complete the training of the neural network model, and can train larger-scale neural network models.

[0165] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the hardware disclosed in the embodiments, including devices and electronic devices, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.

[0166] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0167] The above is a detailed introduction to a heterogeneous computing platform and its model data processing method, device, electronic device, non-volatile storage medium and heterogeneous computing platform provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that based on the embodiments of the present invention, for ordinary technicians in this technical field, all other embodiments obtained without creative work are within the scope of protection of the present invention. Without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A model data processing method for a heterogeneous computing platform, characterized in that: include: Adapting multiple types of computing node devices of a heterogeneous computing platform to a target deep learning framework, so that each computing node device of the heterogeneous computing platform uses the target deep learning framework to jointly perform model training on a network model to be trained; Uniformly encode each computing node device, and determine the corresponding target communication interface in the distributed communication interface based on the computing resource type corresponding to each computing node device; When the network model to be trained is sent to each computing node device for distributed training based on the coding information of each computing node device, the model data is transmitted between each computing node device through the corresponding target communication interface.

2. The model data processing method for a heterogeneous computing platform according to claim 1, characterized in that: The computing power node devices transmit model data through corresponding target communication interfaces, including: When running to the distributed communication interface, obtain the computing power node device configuration information; If the computing resource types of the first computing node device and the second computing node device currently performing data transmission are the same, the first computing node device and the second computing node device perform data transmission based on the corresponding distributed communication library; If the computing resource types of the first computing node device and the second computing node device currently performing data transmission are different, the first computing node device and the second computing node device implement data transmission through a pre-defined method.

3. The model data processing method for a heterogeneous computing platform according to claim 2, characterized in that: The first computing node device and the second computing node device implement data transmission in a pre-defined manner, including: Copying the input data of the distributed communication interface to the central processing unit in advance; The first computing power node device and the second computing power node device transmit data through the central processing unit.

4. The model data processing method for a heterogeneous computing platform according to claim 1, characterized in that: The distributed communication interface adopts a ring protocol architecture, and the computing power node devices transmit model data through the corresponding target communication interface, including: Obtain the total number of computing power node devices that execute the training task of the network model to be trained; Dividing the data block of the process corresponding to each computing power node device into a plurality of sub-data blocks based on the total number; For each process executing the training task of the network model to be trained, in the current iteration process, the current process performs a reduction operation on the data block received from the adjacent previous process and its own data in the previous iteration process to obtain a reduced target data block; If the computing power node device corresponding to the next process adjacent to the current process has the same computing power resource type as the computing power node device corresponding to the current process, obtain a target communication library provided by the chip manufacturer of the computing power node device corresponding to the current process, and the current process sends the target data block to the next process through the target communication library; If the computing power node device corresponding to the next process adjacent to the current process is different from the computing power resource type corresponding to the computing power node device corresponding to the current process, the input data of the distributed communication interface is copied to the central processing unit, and the current process sends the target data block to the next process through the central processing unit; Among them, the number of each sub-data block is the same as the total number, and the number of processes is the same as the total number of computing power node devices.

5. The model data processing method for a heterogeneous computing platform according to claim 1, characterized in that: The unified coding of each computing power node device includes: Classify each computing node device according to the computing resource type, and select the target computing resource type as the encoding benchmark; Based on the numbering sequence of the computing power node devices included in the target computing power resource type, the computing power node devices of the remaining computing power resource types are encoded in sequence.

6. The model data processing method for a heterogeneous computing platform according to claim 1, characterized in that: The process of sending the network model to be trained to each computing node device for distributed training based on the encoding information of each computing node device includes: After the network model to be trained is constructed based on the target deep learning framework, each computing node device that executes the training task of the network model to be trained is obtained; Based on the encoding information of each computing power node device, the training data of the network model to be trained is sent to the corresponding computing power node device, and each computing power node device calls a preset distributed training framework to perform memory allocation and operator calculation on the network model to be trained.

7. The model data processing method for a heterogeneous computing platform according to any one of claims 1 to 6, characterized in that: The method of adapting multiple types of computing node devices of a heterogeneous computing platform to a target deep learning framework includes: When the target computing node device of the heterogeneous computing platform needs to be adapted to the target deep learning framework, the target deep learning framework is modified based on the name and runtime interface of the target computing node device, and the target deep learning framework is used as the front end, and the underlying software toolkit of the target computing node device is used as the back end, so that the target deep learning framework supports the target computing node device in a front-end and back-end separation manner.

8. The model data processing method for a heterogeneous computing platform according to claim 7, characterized in that: The modifying the target deep learning framework based on the name and runtime interface of the target computing power node device includes: Based on the name and runtime interface of the target computing node device, modify the converter code and Python library code of the target deep learning framework accordingly; Based on the name and runtime interface of the target computing power node device, the distributed training framework code corresponding to the network model to be trained is modified accordingly.

9. The model data processing method for a heterogeneous computing platform according to claim 7, characterized in that: The target deep learning framework is modified based on the name and runtime interface of the target computing power node device, the target deep learning framework is used as the front end, and the underlying software toolkit of the target computing power node device is used as the back end, including: Adding a virtual device as an adapter interface of the target computing power node device in the target deep learning framework; Registering a corresponding distributed communication interface in the target deep learning framework after adding the virtual device, and using the distributed communication interface to call a computing task execution framework; the computing task execution framework is used to perform model training on the network model to be trained; Abstractly design the underlying software stack of the target computing power node device using the computing power task execution framework to obtain an abstracted computing power underlying software stack; The computing power underlying software stack is configured as a backend, and the target deep learning framework as the front end is separated from the abstracted computing power underlying software stack as the backend.

10. The model data processing method for a heterogeneous computing platform according to claim 9, characterized in that: After configuring the computing power underlying software stack as a backend and separating the target deep learning framework as a frontend from the abstracted computing power underlying software stack as the backend, the method further includes: Obtain a first kernel configuration file corresponding to the target deep learning framework; Based on a preset kernel configuration file construction rule and using the first kernel configuration file to construct a second kernel configuration file corresponding to the first kernel configuration file; wherein the second kernel configuration file is a kernel configuration file including a kernel name, a parameter type and a target corresponding relationship, and the target corresponding relationship is a corresponding relationship between the first kernel configuration file and the second kernel configuration file; Constructing a parameter conversion module of the target deep learning framework and the computing task execution framework, so as to complete the automatic conversion operation of the corresponding parameters to be converted by calling the parameter conversion module when parameter conversion is required; A kernel configuration file parsing operation is triggered to parse the first kernel configuration file and the second kernel configuration file corresponding to the target deep learning framework to obtain corresponding kernel configuration file parsing results, and when kernel registration and implementation are required, an automatic code generation operation is triggered to generate target code for kernel registration and kernel implementation according to the kernel configuration file parsing results and a preset type language program.

11. The model data processing method for a heterogeneous computing platform according to claim 9, characterized in that: After configuring the computing power underlying software stack as a backend and separating the target deep learning framework as a frontend from the abstracted computing power underlying software stack as the backend, the method further includes: Determine the target operator that needs to be registered; If the backend operator of the backend supports a calculation operation corresponding to the target operator, and the target operator is a random number operator, the target operator is registered through a central processing unit.

12. A model data processing device for a heterogeneous computing platform, characterized in that: include: A heterogeneous computing power adaptation module is used to adapt multiple types of computing power node devices of a heterogeneous computing platform to a target deep learning framework, so that each computing power node device of the heterogeneous computing platform uses the target deep learning framework to jointly perform model training on a network model to be trained; The heterogeneous computing power configuration module is used to uniformly encode each computing power node device and determine the corresponding target communication interface in the distributed communication interface based on the computing power resource type corresponding to each computing power node device; The data processing module is used to send the network model to be trained to each computing node device for distributed training based on the coding information of each computing node device, and transmit the model data between each computing node device through the corresponding target communication interface.

13. An electronic device, characterized in that: It comprises a processor and a memory, wherein the processor is used to implement the steps of the model data processing method for a heterogeneous computing platform as claimed in any one of claims 1 to 11 when executing a computer program stored in the memory.

14. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, which, when executed by a processor, implements the steps of the model data processing method for a heterogeneous computing platform as described in any one of claims 1 to 11.

15. A heterogeneous computing platform, characterized in that: It includes multiple types of computing node devices and processors, and the processors are connected to various types of computing node devices; The processor is used to implement the steps of the model data processing method for a heterogeneous computing platform as described in any one of claims 1 to 11 when executing the computer program stored in the memory.

Citation Information

Patent Citations

  • Unified heterogeneous computing system and AI acceleration platform

    CN113867950A

  • Distributed training communication optimization method and system for bandwidth limited environment

    CN116405392A

  • Model training time consumption prediction method, device and system based on heterogeneous computing system

    CN116720544A

  • Deep learning framework adaptation method and device, equipment, storage medium and product

    CN117291260A

  • Model training scheduling method and device, computer readable medium and electronic equipment

    CN117311932A

Cited By

  • Hybrid GPU cluster, communication method, chip and device

    CN119088748A

  • Hybrid GPU cluster, communication method, chip and device

    CN119088748B

  • Model training method, data processing method, equipment and program product

    CN120258094A

  • Hybrid GPU cluster, communication method, chip, and device

    WO2026098442A1