Data processing methods

By configuring the weights of shared and ordinary expert models in the target processor, the data blocks are processed in blocks, and the shared expert model is first calculated and the ordinary expert model is calculated when needed. This solves the problem of low data processing efficiency caused by communication delay in the hybrid expert model, and efficient data processing is achieved.

CN120234286BActive Publication Date: 2025-08-08INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510718111.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-08-08
Estimated Expiration
2045-05-30

AI Technical Summary

Technical Problem

In the hybrid expert model, frequent information exchange between different experts in a distributed environment leads to large communication overhead, which becomes a bottleneck in data processing efficiency, especially in multi-GPU systems, which affects the efficiency of data processing.

Method used

By configuring the first weight of the shared expert model and the second weight of the ordinary expert model in the target processor, the data blocks are processed in blocks, and the shared expert model is calculated first, and the ordinary expert model is calculated when needed, the processing results are integrated, and the data transmission and calculation overlap are optimized to reduce communication delay.

Benefits of technology

It significantly reduces the overall data processing time, improves the system response speed and computing efficiency, and realizes efficient processing of large-scale data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234286B_ABST
    Figure CN120234286B_ABST
Patent Text Reader

Abstract

The present application discloses a data processing method, which relates to the field of computer technology. The method comprises pre-configuring a shared expert model and a common expert model in a target model in a plurality of processors according to a preset distribution method. When processing the target data, each target processor first processes each data block in the target data based on a first weight of a locally configured shared expert model to obtain a first processing result. At the same time, when a target data block is found to need to be further processed based on a second weight of a locally configured common expert model during the processing of the data block, the target data block is processed based on the second weight to obtain a second processing result. The first processing result and the second processing result are integrated to determine a target processing result for the target data. The method solves the technical problem of low data processing efficiency in related technologies and achieves the technical effect of improving data processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method. Background Art

[0002] With the rapid development of artificial intelligence, the Mixture of Experts (MOE) model has emerged as an efficient distributed modeling approach. In MOE scenarios, multi-GPU (Graphics Processing Unit) training is often employed to accelerate training through parallel computing. However, because the "experts" in a MOE may be distributed across different GPUs, and the MOE only selects a subset of experts for computation at runtime, frequent information exchange between GPUs is required, resulting in high communication overhead. This is especially true when the number of GPUs is large, where communication overhead can become a bottleneck, leading to low data processing efficiency for MOEs. Therefore, reducing communication overhead and improving the efficiency of large-scale data processing has become a pressing issue.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] The present application provides a data processing method to at least solve the problem of low data processing efficiency in related technologies.

[0005] The present application provides a data processing method, which is applied to a target processor, including: processing each received data block included in the target data to be processed in sequence based on the first weight of a target shared expert model configured in the target processor to obtain a first processing result; when processing each received data block based on the first weight, performing the following operations, and determining a second processing result based on all the obtained processing results: when it is determined that there is a target data block in the currently received data block that needs to be processed based on the second weight of the target common expert model, processing the target data block based on the second weight to obtain a processing result, wherein the weight of the target common expert model is configured as a whole in the target processor; and determining a target processing result of the target data based on the first processing result and the second processing result.

[0006] The present application also provides a data processing device, which is applied to a target processor, including: a processing module, which is used to process each received data block included in the target data to be processed in sequence based on the first weight of the target shared expert model configured in the target processor to obtain a first processing result; a first determination module, which is used to perform the following operations when processing each received data block based on the first weight, and determine a second processing result based on all the obtained processing results: when it is determined that there is a target data block in the currently received data block that needs to be processed based on the second weight of the target common expert model, the target data block is processed based on the second weight to obtain a processing result, wherein the weight of the target common expert model is configured as a whole in the target processor; a second determination module, which is used to determine the target processing result of the target data based on the first processing result and the second processing result.

[0007] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned data processing methods when executing the computer program.

[0008] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned data processing methods are implemented.

[0009] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned data processing methods when executed by a processor.

[0010] Through the present application, since in the process of processing the data blocks included in the target data based on the first weight of the shared expert model, the target data blocks that need to be processed based on the ordinary expert model are simultaneously determined, and the target data blocks are processed based on the second weight of the target ordinary expert model, so as to finally obtain the target processing result of the target data, by first calculating the shared expert model and completing the calculation of the ordinary expert model when calculating the shared expert model, the characteristics of the shared expert model and the ordinary expert model in the MOE architecture are fully utilized, the local data calculation and data transmission are overlapped, and the idle time waiting for the completion of communication is avoided, so that the data aggregation is completed with the minimum communication delay, which significantly reduces the overall data processing time, improves the response speed and computing efficiency of the system, and realizes efficient processing of large-scale data sets. Therefore, it can solve the technical problem of low data processing efficiency caused by data transmission delay in related technologies, and achieve the technical effect of improving data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0012] Figure 1 A hardware structure block diagram of a mobile terminal for a data processing method provided in an embodiment of the present application;

[0013] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;

[0014] Figure 3 A diagram showing a calculation model of a first weight provided in an embodiment of the present application;

[0015] Figure 4 A flow chart of the ring communication of four GPUs provided in an embodiment of the present application;

[0016] Figure 5 A diagram showing a calculation model of a second weight provided in an embodiment of the present application;

[0017] Figure 6 A calculation model diagram of each data block provided in an embodiment of the present application;

[0018] Figure 7 A typical hardware system structure diagram provided in an embodiment of the present application;

[0019] Figure 8 A structural block diagram of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] In recent years, with the rapid development of artificial intelligence (AI), deep learning models have achieved breakthroughs in fields such as natural language processing (NLP) and computer vision (CV). However, as model size continues to expand, traditional large-scale models with a single architecture are gradually exposing their limitations. Against this backdrop, the Mixture of Experts (MOE) model has emerged as an efficient distributed modeling approach, opening up new directions for the development of large models from the following perspectives:

[0021] (1) Dual drive of computing power and data:

[0022] The success of deep learning relies on powerful computing power and massive amounts of data. However, traditional approaches that rely solely on increasing the number of model parameters can lead to a surge in graphics memory usage, even exceeding the capacity of a single hardware device. For example, while ultra-large-scale models like GPT-3 offer excellent performance, they are expensive to train and difficult to scale. MOE significantly reduces the resource requirements of a single device by breaking down tasks into multiple "expert" sub-models, enabling more efficient large-scale model building.

[0023] (2) Requirements for multi-tasking scenarios:

[0024] In real-world applications, many tasks are diverse, and a single model often struggles to achieve optimal performance across all tasks. For example, different tasks, such as machine translation, text generation, and question-answering systems, require models to possess diverse knowledge and skills. MOE improves the model's flexibility and adaptability by introducing multiple expert networks (i.e., expert models), each focused on a specific task or domain.

[0025] (3) Advantages of sparsity and dynamic routing:

[0026] Traditional dense neural networks activate the entire model for each inference, wasting significant computing resources and limiting model scalability. In contrast, MOE employs a sparse activation mechanism, invoking only a subset of experts (i.e., expert models) at a time, significantly reducing computational overhead. Furthermore, a dynamic routing algorithm selects the most appropriate expert combination based on the input, further optimizing model performance.

[0027] Although MOE has shown great potential, it still faces some challenges. For example, in a distributed environment, collaboration between different experts requires frequent information exchange, which may lead to high communication delays; or how to design a reasonable routing algorithm to avoid overloading some experts and leaving others idle.

[0028] Based on the above problems, this application proposes a data processing method that effectively overlaps computing and remote communication (i.e., data exchange between different computing nodes or devices, which in this application specifically refers to remote data exchange between GPUs or other computing devices in a multi-GPU (Graphics Processing Unit) system or a multi-node distributed computing system) workloads by using block MOE computing. At the same time, by overlapping the input / output (I / O) and computing of a local single expert (i.e., expert model), the proportion of local I / O latency in the computing is reduced, thereby solving the bandwidth and I / O bottlenecks of MOE.

[0029] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0030] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0031] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0032] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the data processing method depends, the specific application environment architecture or specific hardware architecture is described here.

[0033] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a data processing method provided in an embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. The mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0034] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data processing method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0035] Transmission device 106 is used to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the mobile terminal's communications provider. In one embodiment, transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0036] The embodiments of the present application provide a data processing method, and the method is described in detail in conjunction with the execution flow of the data processing method.

[0037] The following are explanations of the professional terms in the embodiments of this application:

[0038] GPGPU: General-Purpose computing on Graphics Processing Units, refers to the use of graphics processors (GPUs) for general-purpose computing tasks other than graphics processing, accelerating scientific computing, AI training, and other scenarios through parallel computing.

[0039] MoE large model: Mixture of Experts, a large model architecture, primarily splits tasks among multiple "expert sub-models," activating only a subset of parameters to balance performance and efficiency. For example, Google's Switch Transformer uses this design.

[0040] In this embodiment, a data processing method is provided. Figure 2A flowchart of a data processing method provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the process includes the following steps:

[0041] Step S202 , based on a first weight of a target shared expert model configured in the target processor, sequentially processing each data block included in the received target data to be processed to obtain a first processing result;

[0042] Step S204, when processing each received data block based on the first weight, performing the following operations, and determining a second processing result based on all the obtained processing results: when it is determined that there is a target data block in the currently received data blocks that needs to be processed based on the second weight of the target general expert model, processing the target data block based on the second weight to obtain a processing result, wherein the weight of the target general expert model is configured as a whole in the target processor;

[0043] Step S206 : determining a target processing result of the target data based on the first processing result and the second processing result.

[0044] Optionally, the execution entity of the above steps can be a background processor, or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device, wherein the image acquisition device may include a graphics acquisition module such as a camera, and the data processing device may include a computer, a mobile phone and other terminals, but is not limited to this.

[0045] Through the above steps, before processing the target data to be processed, the shared expert model and the common expert model in the target model are pre-configured in multiple processors according to a preset distribution method. Then, when processing the target data, each target processor in the multiple processors first processes each data block in the target data based on the first weight of the locally configured shared expert model to obtain a first processing result. At the same time, in the process of processing the data block, if it is found that there is a target data block that needs to be further processed based on the second weight of the locally configured target common expert model, the target data block is processed based on the second weight to obtain a second processing result. The first processing result and the second processing result are merged together to determine the target processing result of the target data.

[0046] By first calculating the shared expert model, and in the process of calculating the shared expert model, completing the reassembly of the data blocks that need to be processed based on the weights of the common expert model (i.e., determining the specific data blocks that need to be calculated by the currently traversed common expert model from the currently received data blocks) and the transmission (i.e., transferring the specific data blocks from the memory to the computing module), the characteristics of the shared expert model and the common expert model in the MOE architecture are fully utilized, and the local data calculation and data transmission are overlapped. Compared with the related art in which the data blocks to be calculated by each common expert model are sent to the processor where the common expert model is located, after calculating each common expert model, all data blocks and the processing results corresponding to each data block are synchronized, and all data blocks are reassembled into a continuous matrix before the shared expert model is calculated, which will generate a large amount of I / O delay, avoiding the idle time waiting for communication to complete, so that data aggregation is completed with minimal communication delay, significantly reducing the overall data processing time, improving the system's response speed and computing efficiency, and realizing efficient processing of large-scale data sets. The technical problem of low data processing efficiency caused by data transmission delay in the related art is solved, and the efficiency of data processing is improved.

[0047] In step S202, the target processor can be a hardware device in the system that loads or configures the model weights to perform calculations on data using the model weights. This is also a hardware device used to perform model inference, such as a central processing unit (CPU), a graphics processing unit (GPU), a tensor processing unit (TPU), and a dedicated AI chip. The processor typically includes memory and a computing module. The memory is used to quickly store and access the weights of each expert model and data blocks in the target data, while the computing module is responsible for performing computational tasks based on the weights of these expert models, such as linear transformations. The following explanation of specific embodiments uses a graphics processing unit (GPU) as an example.

[0048] The target model can be a Mixture of Experts (MoE) model. This model architecture uses multiple expert models (i.e., sub-models) to work together to improve overall performance. It is often used in application scenarios that require efficient processing of large-scale data, such as image recognition and natural language processing. The hybrid expert model (i.e., target model) is mainly composed of shared expert models and standard expert models. The shared expert model can be accessed and used by multiple processors in the system. The model weights are distributed to each processor to achieve parallel computing of the model. The standard expert model resides entirely on its own bound processor, processing specific tasks or data types more finely.

[0049] The target shared expert model can be any shared expert model included in the target model. The weight of each expert model in the target model is distributed among multiple processors according to a preset ratio. For example, the weight is evenly distributed among multiple processors according to the column dimension of the weight, so that each processor has a part of the shared expert model weight, so that the shared expert model can use different processor resources and use computing resources more efficiently to process different data blocks in parallel; the first weight can be a weight specifically referring to the part of the target shared expert model configured in the target processor.

[0050] The target data can be data input to the target model to be processed. This data can include image data, text data, audio data, etc. The target data can be divided into multiple computing units (tokens). Each token is encoded and converted to a corresponding data block (token_output), which contains the information to be processed by the expert model. The first processing result can be the processing result of all data blocks in the target data by the target processor.

[0051] Optionally, in an embodiment of the present application, the weights of the shared expert model and the weights of the ordinary expert model included in the target model are pre-configured in multiple processors in the system according to a preset distribution method, and when processing the target data, each processor in the multiple processors (i.e., the target processor) processes the data blocks in the received target data in sequence based on the first weight of the shared expert model pre-configured locally to obtain a first processing result.

[0052] Optionally, taking the hybrid expert model architecture of deepseek v2 16B in a host system with 4 GPUs as an example, the hybrid expert model includes 2 shared expert models and 64 ordinary expert models. The weight of each shared expert model in the hybrid expert model is evenly allocated to the 4 GPUs according to the column dimension. For example, the shared expert model weight configured on GPU0 is W0, the shared expert model weight configured on GPU1 is W1, the shared expert model weight configured on GPU2 is W2, the shared expert model weight configured on GPU3 is W3, etc. At the same time, the weights of all ordinary expert models in the hybrid expert model are evenly allocated to the 4 GPUs. For example, the ordinary expert model weight configured on GPU0 is expert 0-15, the ordinary expert model weight configured on GPU1 is expert 16-31, the ordinary expert model weight configured on GPU2 is expert 32-47, the ordinary expert model weight configured on GPU3 is expert 48-63, etc.

[0053] Taking GPU0 as the target processor as an example, GPU0 processes each token_output (i.e., data block) in the target data based on W0 (i.e., the first weight) to obtain a first data processing result, that is, the processing result of the target data by GPU0 based on the locally configured shared expert model.

[0054] In step S204, the target general expert model may be a general expert model configured in the target processor and assigned with a data processing task, wherein the weights of the general expert models in the target model are configured in multiple processors according to a preset distribution method, and the weight of each general expert model is completely configured in one processor (i.e., bound to one processor). For example, according to the number of general expert models, the weights of the general expert models are evenly configured in multiple GPUs, thereby distributing the computational load of all general expert models in the target model to multiple GPUs. Sharing the workload by multiple GPUs can significantly improve computing efficiency, reduce training and inference time, and better utilize available hardware resources, avoiding excessive use of a single processor and idleness of other processors. The second weight may be a weight specifically referring to the target general expert model configured in the target processor, wherein the second weight may be the weight of one general expert model or may include the weights of multiple general expert models.

[0055] The target data block can be a data block in the target data assigned to the target general expert model for processing based on the second weight. The target data block can be a data block or a data block composed of multiple data blocks; the second processing result can be the processing result of the target processor on all data blocks in the target data.

[0056] Optionally, in an embodiment of the present application, in the process of processing the data block based on the weight of the shared expert model (i.e., processing the received data block based on the first weight), the received data block is also processed based on the weight of the common expert model. The specific processing process is: when the currently received data block contains the target data block assigned to the target common expert model (i.e., needs to be processed based on the second weight), the target data block is processed based on the second weight to obtain a processing result, and then based on all the processing results configured in the target processor, a second processing result is obtained.

[0057] Optionally, taking the hybrid expert model architecture of deepseek v2 16B in a host system with 4 GPUs as an example, assuming that GPU0 is the target processor, while GPU0 processes each token_output in the target data based on W0, it traverses experts 0-15 configured in GPU0 in turn to determine whether there is a data block in the currently received data block that needs to be processed based on the weight of the currently traversed ordinary expert model. For example, it is determined whether there is a data block in the currently received data block that needs to be processed based on the weight of expert 0. If so (that is, there is a target data block), the data block (that is, the target data block) is processed based on the weight of expert 0 (that is, the second weight) to obtain the processing result of the target data by the weight of expert 0. Finally, based on all the processing results of experts 0-15 on the target data, the second processing result is determined, that is, the processing result of the target data by GPU0 based on the weight of the locally configured ordinary expert model.

[0058] In step S206, the target processing result may be the processing result of the target data based on the weights of all expert models (including shared expert models and ordinary expert models) included in the target model, that is, the processing result of the target model on the target data, wherein the target processing result includes all processing results of the target data by multiple processors in the system.

[0059] As an optional implementation, based on the first weight of the target shared expert model configured in the target processor, each received data block included in the target data to be processed is processed in sequence to obtain a first processing result, including: repeating the following operations until all data blocks included in the target data are received: receiving and storing a first data block, wherein the first data block is a currently received data block included in the target data; processing the first data block according to the first weight to obtain a first data block processing result; and determining the first processing result based on the obtained processing results of each first data block when it is determined that all data blocks included in the target data are stored in the target processor.

[0060] Optionally, in an embodiment of the present application, the first data block may be a data block currently received by the target processor, which may be a single data block or a combined data block of multiple data blocks obtained by dividing the target data according to a preset rule, for example, dividing the target data according to the row dimension to obtain multiple data blocks; the target processor receives the first data block and stores the first data block in the local memory. At the same time, the calculation module processes the first data block based on the first weight to obtain a first data block processing result; then the data blocks stored in the local memory are judged, and when it is determined that all the data blocks in the target data are stored in the memory (i.e., stored in the target processor), the first processing result is determined based on the obtained processing results of each first data block. The first data block may be directly allocated and received by the system, or may be received from other processors.

[0061] Optionally, processing the first data block using the first weight to obtain the first data block processing result includes: performing a matrix multiplication operation on the first weight and the first data block to obtain the first data block processing result.

[0062] Optionally, Figure 3 The calculation mode diagram of the first weight provided in the embodiment of the present application is as follows: Figure 3As shown in the figure, taking GPU0 as the target processor as an example, the gating network in the system divides the target data into multiple tokens, and obtains token_output (which can be in matrix form) after encoding operation on each token. All token_outputs are encoded according to the row dimension to obtain token_output0 (data block 0), token_output1 (data block 1), token_output2 (data block 2), and token_output3 (data block 3). The system sends token_output0-3 to GPU0-3 respectively, so that each GPU receives and stores the corresponding token_output. GPU0 first receives and stores token_output0 assigned by the system, performs multiplication on the received token_output0 based on the first weight W0 (weight 0), and obtains the first data block processing result Z00; then determines whether all data blocks are stored in the local memory. If only token_output0 is stored in the current storage of GPU0, it continues to receive and store token_output sent by other image processors, and repeats the above operation until all data blocks of token_output0-4 are stored in the memory of GPU0. At this time, GPU0 obtains and stores all data block processing results Z00 (result 00), Z01 (result 01), Z02 (result 02), and Z03 (result 03) of GPU0 on token_output0-4, and determines the first processing result based on the processing results of all data blocks.

[0063] It should be noted that if the target processor is configured with weights of multiple shared expert models, when performing calculations based on the weights of the shared expert models, the weights of the multiple shared expert models configured in the target processor can be used in sequence to process the first data block.

[0064] Through the above, the target processor processes received data blocks one by one, rather than waiting for all blocks to be received before processing them all at once. This allows it to adapt to data sets of varying sizes. By adjusting the block size and processing strategy, it can flexibly adapt to different hardware configurations and application requirements. It can also process multiple blocks simultaneously, further optimizing processing speed and improving data processing efficiency and speed. Furthermore, by processing target data in blocks, it eliminates the need to load the entire data set into memory all at once, reducing memory requirements.

[0065] As an optional embodiment, receiving and storing a first data block includes: when it is determined that only a portion of the data blocks included in the target data are stored in the target processor, receiving and storing a second data block sent by the first processor, wherein the first processor is a processor included in multiple processors and is arranged before the target processor in the data transmission direction, and data is transmitted between the multiple processors through a ring communication method, and the second data block is a data block included in the target data except for the data block stored in the target processor.

[0066] Optionally, in an embodiment of the present application, the first processor may be a processor other than the target processor among the multiple processors included in the system, and the first processor may be a processor located before the target processor in the data transmission direction in the system; the second data block may be a data block sent by the first processor to the target processor, and the second data block may include all data blocks other than the data blocks stored in the target processor, or may be a data block other than the data block sent last time among all data blocks stored in the first processor.

[0067] Optionally, Figure 4 The ring communication flow chart of the four GPUs provided in the embodiment of the present application is as follows: Figure 4 As shown in the figure, taking the ring all-gather communication form as an example, the communication between GPUs (graphics processors) is implemented through ring communication to achieve all-gather (that is, all GPUs collect data blocks from all other GPUs). Assuming that the system includes p = 4 GPUs, all GPUs in the system are traversed and numbered, and their numbers are: rank 0-3; assuming that the entire matrix size is V, each device initially stores a data block of size V / p. After the all-gather, each device has a data block of size V. The specific implementation process of the ring all-gather is as follows Figure 4 As shown, it is worth noting that the time required for the entire ring communication process is (p-1)*V / (p*B), where B is the sum of the ingress or egress bandwidth of the GPU. If p is large enough, the time required is approximately V / B. At this time, this time is independent of the number of GPUs p.

[0068] Through the above, data blocks are continuously transmitted between multiple processors via a ring communication method, so that each processor only needs to process and forward the corresponding data block, reducing redundant data transmission and processing time, and improving data transmission efficiency and reliability. At the same time, multiple processors work together, allowing the system to process different data blocks in parallel, thereby improving overall data processing capabilities and meeting the needs of complex image processing tasks. Furthermore, because data blocks are transmitted via a ring communication method, the system can flexibly increase or decrease the number of processors to adapt to different application requirements without significantly affecting the overall system architecture, effectively utilizing system resources and increasing system flexibility and scalability.

[0069] In addition, by combining ring communication with data processing, when the target processor receives and stores the data blocks in the target data, the process of determining the first processing result based on all the processing results is usually accompanied by communication optimization between GPUs. Through early processing and storage, later communication can be more efficient, allowing the system to maintain low communication latency and high bandwidth utilization even in large-scale data processing.

[0070] As an optional implementation, determining the first processing result based on the obtained processing results of each first data block includes: determining the position information of all data blocks included in the target data in the target data; and splicing the obtained processing results of each first data block according to the position information to obtain the first processing result.

[0071] Optionally, in the implementation example of the present application, the position information may be the position of each data block in the target data. For example, if the target data is divided into different data blocks according to the row dimension, the position information is the row number corresponding to each data block in the target data. Based on the position information of each data block, the obtained processing results of each first data block are spliced to obtain the first processing result. Figure 3 For example, the target data is divided into 4 tokens according to the row dimension, and each token is encoded to obtain token_output0-3. According to the position of each token in the target data, the processing results Z00-Z03 of token_output0-3 are concatenated to obtain the first processing result.

[0072] As an optional implementation, before determining whether there is a target data block in the currently received data block that needs to be processed based on the second weight of the target general expert model, the above method also includes: determining a first sorting of the weights of multiple general expert models configured in the target processor; based on the first sorting, traversing the weights of each general expert model configured in the target processor in turn to determine whether there is a data block in the target data that needs to be processed based on the weight of the currently traversed general expert model; when it is determined that there is a data block in the target data that needs to be processed based on the weight of the currently traversed general expert model, determining whether there is a third data block in the currently received data block that needs to be processed based on the weight of the currently traversed general expert model; when it is determined that there is no data block in the target data that needs to be processed based on the weight of the currently traversed general expert model, skipping the weight of the currently traversed general expert model.

[0073] Optionally, in an embodiment of the present application, the first sorting may be a sorting of weights of common expert models configured in the target processor. According to the first sorting, the weights of the common expert models configured in the target processor are traversed in sequence, and during the traversal process, the data blocks in the target data are processed based on the weights of the common expert models.

[0074] Alternatively, taking the Deepseek v2 16B hybrid expert model architecture in a four-GPU host system as an example, the hybrid expert model includes two shared expert models and 64 common expert models. The weights of the 64 common expert models in the hybrid expert model are evenly distributed across the four GPUs, with each GPU assigned 16 common expert model weights. For example, GPU0 is assigned common expert model weights of experts 0-15, GPU1 is assigned common expert model weights of experts 16-31, GPU2 is assigned common expert model weights of experts 32-47, GPU3 is assigned common expert model weights of experts 48-63, and so on. Simultaneously, the gating network in the system partitions the target data into multiple tokens. For each token, six common expert models (i.e., Token-k, where k=6) are selected for inference. Specifically, the data block corresponding to the token (i.e., token_output) is processed based on the weights of the six selected common expert models.

[0075] As shown in Table 1 below, taking GPU0 as the target processor as an example, during the process of GPU0 processing the currently received data block based on the first weight (i.e., shared expert computation), each expert configured in the GPU is sequentially traversed. Specifically, the following steps are performed: A determination is made as to whether the data block needs to be processed based on the weight of the first-ranked general expert model (i.e., Expert 0), i.e., whether Expert 0 has been assigned a token requiring inference. If not, Expert 0 is skipped and the remaining experts are traversed in the same manner. If so, the data block requiring inference by Expert 0 (i.e., the target data block) is determined from the currently received data block, and this data block is transferred from GPU0's memory to the computation module (i.e., I / O). The currently received data block is then processed based on Expert 0 (i.e., the second weight). After processing is complete, the remaining experts are traversed in the same manner. It should be noted that the description in Table 1 below is only one embodiment. In actual operation, during shared expert computation, only data blocks requiring inference by Expert 0 may be transmitted, while during expert 0 computation, only data blocks requiring inference by Expert 1 may be transmitted. Alternatively, multiple expert computations and corresponding data block transmissions may be completed during shared expert computation. This is not a specific limitation here.

[0076] Table 1 Traversal order

[0077]

[0078] Through the above content, by traversing the weights of the common expert model in the first order during the processing of data blocks based on the weights of the shared expert model, the order of use and conditional checks of the expert model weights are optimized, so that I / O operations can be effectively overlapped with computing operations, minimizing the impact of I / O delays on computing efficiency, effectively overcoming the common I / O delays and communication bottlenecks in large-scale computing, improving the speed of data processing, and enabling the system to prioritize the most likely relevant models, avoiding redundant checks on the weights of each model, thereby saving computing resources and time. At the same time, by accurately identifying data blocks that require specific weight processing, it is ensured that only relevant data blocks are processed, thereby improving processing accuracy and reducing the possibility of misprocessing.

[0079] As an optional implementation, when it is determined that there is a third data block in the currently received data block that needs to be processed based on the weight of the currently traversed ordinary expert model, the target data block is processed based on the second weight to obtain a processing result, including: determining the third data block from the currently received data block, wherein the target data block includes the third data block; multiplying the weight of the currently traversed ordinary expert model by the third data block to obtain a third data block processing result, wherein the second weight includes the weight of the currently traversed ordinary expert model, and the processing result includes the third data block processing result.

[0080] Optionally, in an embodiment of the present application, the third data block may be a data block that needs to be processed based on the weight of the currently traversed ordinary expert model, that is, a data block that needs to be inferred based on the weight of the current ordinary expert model; when the currently received data block includes a data block that needs to be processed based on the weight of the currently traversed ordinary expert model, the third data block is determined from the currently received data block, and the third data block is multiplied by the currently traversed ordinary expert model to obtain the processing result of the third data block.

[0081] As an optional embodiment, the above method also includes: when it is determined that the third data block does not exist in the currently received data block, performing a waiting operation until the third data block exists in the currently received data block, wherein the waiting operation includes: waiting for and receiving the second data block sent by the first processor, and taking the second data block as the currently received data block; processing the third data block based on the weight of the currently traversed ordinary expert model to obtain a third data block processing result, and the processing result includes the third data block processing result; wherein the first processor is a processor included in multiple processors and arranged before the target processor in the data transmission direction, and the second data block is a data block included in the target data except for the data block stored in the target processor.

[0082] Optionally, in an embodiment of the present application, when the currently received data block does not include a data block that needs to be processed based on the weights of the currently traversed ordinary expert model, the data block is temporarily processed based on the weights of the ordinary expert model configured in the target network, and the first processor is waited for to send the second data block. When the first processor sends the second data block, the second data block is received and stored. At this time, it is re-determined whether the currently received data block includes a data block that needs to be processed based on the weights of the currently traversed ordinary expert model, and the above operation is repeated, wherein the currently received data block after storing the second data block includes the second data block.

[0083] Through the above content, when it is detected that a third data block that needs to be processed based on the common expert model weights is present in the currently received data blocks, these data blocks are immediately processed based on the local common expert model weights (i.e., the second weights), thereby avoiding idle resources and maximizing the processor's computing power. At the same time, when there is no third data block that needs to be processed, a waiting operation is performed instead of performing invalid calculations. During the waiting operation, the processor receives the second data block from the previous processor (the first processor) and treats it as the new current data block. By ensuring that the processor continues to receive data blocks while waiting, rather than idling, the data flow can be smoothed, the communication window period can be reduced, the communication efficiency of the entire system can be optimized, and the continuity and consistency of data transmission can be maintained. It reduces unnecessary data stagnation or congestion, thereby accelerating the overall computing process. In addition, the system can complete the processing of the target data by traversing the common expert model weights only once, saving system resources, achieving efficient management of data flow and full utilization of computing resources, and improving system throughput.

[0084] As an optional implementation, determining a second processing result based on all the obtained processing results includes: performing the following operations for each received data block to obtain the processing result of each data block by the target processor: determining a probability value for processing the target data block based on a pre-configured second weight of each target general expert model; determining a product value of the processing result obtained by processing the target data block based on the second weight of each target general expert model and the probability value; determining the processing result of the target processor on the data block based on the product values corresponding to each target general expert model; and determining the second processing result based on the processing result of each data block by the target processor.

[0085] Optionally, in an embodiment of the present application, the probability value may be the probability configured for each ordinary expert model when the gating network determines 6 ordinary expert models for each token, wherein the higher the probability, the greater the proportion of the weight of the ordinary expert model in the final reasoning result of the token.

[0086] Optionally, determining the second processing result based on the processing result of each data block by the target processor includes: performing an addition operation on the processing result of each data block by the target processor to obtain a sum value; and determining the sum value as the second processing result.

[0087] Optionally, Figure 5 A calculation mode diagram of a second weight provided in an embodiment of the present application is shown as follows: Figure 5As shown, taking GPU0 as the target processor as an example, all data blocks (data blocks 0-4) in the target data are processed based on the weights (experts 0-15) of the general expert model configured in the target processor to obtain multiple processing results (results 0-4), and then the second processing result is determined based on results 0-4, that is, the processing result of GPU0 on the target data. Specifically, among the weights of the general expert model configured in GPU0, the experts assigned the data reasoning task (i.e., the second weights) respectively determine the data blocks that need to be reasoned (i.e., the third data block), and then perform a multiplication operation on the third data block and its corresponding expert. Finally, based on the processing results of all multiplication operations, the second processing result is determined. Specifically, the second processing result can be determined by the following formula:

[0088]

[0089] Where, is the second processing result, is the probability value of expert i (i.e., the weight of the i-th ordinary expert model) for the third data block, is the processing result of the third data block, It indicates that the weight of the i-th general expert model belongs to both the weights of the six general expert models corresponding to the third data block and the weight of the general expert model configured in the target processor.

[0090] As an optional embodiment, determining the first result based on the first processing result and the second processing result includes: receiving a third processing result and a fourth processing result transmitted by other processors, wherein the third processing result is the result obtained by the other processors after sequentially processing each data block in the target data based on the weight of the shared expert model configured in the other processors, and the fourth processing result is the result obtained by the other processors after sequentially processing each data block in the target data based on the weight of the common expert model configured in the other processors, wherein the other processors are processors other than the target processor among the multiple processors; obtaining a shared processing result based on the first processing result and the third processing result; obtaining a common processing result based on the second processing result and the fourth processing result; and performing an addition operation on the shared processing result and the common processing result to determine the target processing result.

[0091] Optionally, in an embodiment of the present application, the third processing result may be the processing result of the target data by other processors (such as GPU1-3) based on the weights of the shared expert model configured in their respective processors, and the fourth processing result may be the processing result of the target data by other processors (such as GPU1-3) based on the weights of the common expert model configured in their respective processors, wherein the third processing result and the fourth processing result may be transmitted together with the second data block during the ring communication process.

[0092] The shared data result can be the result of the system (including multiple processors) processing the target data based on the weights of the shared expert model; the common processing result can be the result of the system (including multiple processors) processing the target data based on the weights of the common expert model.

[0093] Optionally, Figure 6 A calculation model diagram of each data block provided in the embodiment of the present application, such as Figure 6 As shown, each data block (data blocks 0-3) is processed based on the weights of the shared expert model configured in multiple processors to obtain a shared data result (results 0-3) for each data block, and the results 0-3 are spliced together to finally obtain a shared data result, that is, the results 0-3 are spliced row by row.

[0094] As an optional implementation, based on the first processing result and the third processing result, a shared processing result is obtained, including: concatenating the first processing result and the third processing result to obtain a shared processing result; and / or, based on the second processing result and the fourth processing result, a normal processing result is obtained, including: performing an addition operation on the second processing result and the fourth processing result to obtain a normal processing result.

[0095] As an optional implementation, Figure 7 A typical hardware system structure diagram provided in the embodiment of the present application is as follows: Figure 7 As shown in the figure, the system mainly includes: CPU (Central Processing Unit Controller), host memory and several acceleration devices, including:

[0096] The CPU is the "brain" of a computer, responsible for executing basic instructions in the instruction set and controlling and coordinating the operation of the entire system. The term "CPU master control" specifically refers to the control and management role of the CPU in a computing system. It not only performs the ordinary computing tasks specified in the program code but also schedules and manages computing tasks for accelerators (such as GPUs) and handles data transmission between these accelerators.

[0097] Host memory refers to random access memory that communicates directly with the CPU. It is the primary storage location for programs and data, allowing the CPU to directly access and read data from host memory. Host memory access speeds are much faster than those of peripherals like hard drives, but are still slower than GPU memory or cache. In AI computing, large amounts of data often need to be transferred between the CPU and GPU. Host memory acts as a bridge, storing pending data and computed results for interaction between the CPU and accelerator.

[0098] Accelerators generally refer to specialized hardware designed for specific computing tasks, such as GPUs. In the fields of AI and deep learning, GPUs have become one of the most commonly used accelerators due to their powerful parallel processing capabilities and high-bandwidth memory. By offloading complex matrix operations and parallel computing tasks to the GPU, computing speed can be significantly improved, especially when processing large data sets or performing complex neural network calculations. The core of accelerators lies in their ability to provide a more efficient and optimized computing environment than CPUs for specific tasks. For example, GPUs have thousands of computing cores dedicated to parallel computing, making them ideal for processing large amounts of data and high-dimensional matrix operations in deep learning. In addition, accelerators are often equipped with dedicated high-speed memory (i.e., GPU memory), such as HBM (High Bandwidth Memory), for storing and quickly accessing large data sets, further improving computing efficiency.

[0099] Applied to similar hardware systems as mentioned above, taking the DeepSeek v2 16B hybrid expert model architecture in a 4-GPU host system as an example, the data processing flow is described in detail:

[0100] Before the first ring communication:

[0101] (1) Pre-configuration.

[0102] The hybrid expert model includes 2 shared expert models and 64 ordinary expert models. The weight of each shared expert model in the hybrid expert model is evenly configured in 4 GPUs according to the column dimension (wherein the target processor can be any GPU). For example, the weight of the shared expert model configured by GPU0 is W0, the weight of the shared expert model configured by GPU1 is W1, the weight of the shared expert model configured by GPU2 is W2, the weight of the shared expert model configured by GPU3 is W3, etc. At the same time, the weights of all ordinary expert models in the hybrid expert model are evenly configured in 4 GPUs. For example, the weight of the ordinary expert model configured by GPU0 is expert 0-15, the weight of the ordinary expert model configured by GPU1 is expert 16-31, the weight of the ordinary expert model configured by GPU2 is expert 32-47, the weight of the ordinary expert model configured by GPU3 is expert 48-63, etc.

[0103] The gating network in the system divides the target data into multiple tokens, and encodes each token to obtain token_output (which can be in matrix form). All token_outputs are encoded according to the row dimension to obtain token_output0, token_output1, token_output2, and token_output3. After that, the system sends token_output0-3 to GPU0-3 respectively, so that each GPU receives and stores the corresponding token_output.

[0104] At the same time, the gating network selects the top 6 common expert models (i.e., 6 common expert models) from 64 common expert models for each token (i.e., token_output) and processes the corresponding token based on the weights of the 6 common expert models.

[0105] (2) Shared expert model calculation.

[0106] Taking GPU0 as an example, it receives and stores token_output0 (the first data block) in memory, processes token_output0 based on W0 (the first weight), and obtains the processing result of the first data block. GPUs 1-3 are similar to GPU0.

[0107] (3) General expert model calculation.

[0108] Taking GPU0 as an example, in the process of calculating the first data block based on the weight of the shared expert, experts 0-15 are traversed in sequence, specifically: determining whether there is a token_output in the target data that needs to be processed based on expert 0 (that is, the currently traversed ordinary expert model); if not, experts 1-15 are continued to be traversed in sequence; if so, whether there is a data block in token_output0 that needs to be processed based on expert 0 is determined. If there is a data block in token_output0 that needs to be processed based on expert 0, expert 0 is the second weight of the target ordinary expert model, then a third data block is determined from token_output0, the third data block is transferred from the memory to the computing unit, expert 0 is multiplied by the third data block, the processing result of the third data block is obtained, and experts 1-15 are continued to be traversed in sequence; if there is a data block in token_output0 that needs to be processed based on expert 0, then waiting to receive token_output1 (that is, the second data block) sent by GPU1 (that is, the first processor).

[0109] GPU1-3 are processed in a similar way to GPU0.

[0110] First ring communication:

[0111] Receive and store the second data block sent by the first image memory, and repeat the above steps. Specifically:

[0112] GPU0: calculate token_output1;

[0113] GPU1: calculate token_output2;

[0114] GPU2: calculate token_output3;

[0115] GPU 3: Calculate token_output0.

[0116] Second ring communication:

[0117] Repeat the above steps. Specifically:

[0118] GPU0: calculate token_output2;

[0119] GPU1: calculate token_output3;

[0120] GPU2: calculate token_output0;

[0121] GPU 3: Calculate token_output1.

[0122] The third ring communication:

[0123] Repeat the above steps. Specifically:

[0124] GPU0: calculate token_output3;

[0125] GPU1: calculate token_output2;

[0126] GPU2: calculate token_output1;

[0127] GPU 3: Calculate token_output0.

[0128] After each GPU has completed calculating all data blocks in the target data (i.e., token_output0-3), a ring communication is performed again. After the communication is completed, each GPU stores its own processing results for all data blocks in the target data, as well as the processing results of all data blocks in the target data by other GPUs. At this time, each GPU determines the target processing result of the target data based on all processing results (i.e., the first processing result, the second processing result, the third processing result, and the fourth processing result).

[0129] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0130] The embodiments of the present application further provide a data processing device, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and contemplated.

[0131] Figure 8 This is a structural block diagram of a data processing device provided in an embodiment of the present application, such as Figure 8 As shown, the device is applied to a target processor and includes: a processing module 802, which is used to process each received data block included in the target data to be processed in sequence based on the first weight of the target shared expert model configured in the target processor to obtain a first processing result; a first determination module 804, which is used to perform the following operations when processing each received data block based on the first weight, and determine a second processing result based on all the obtained processing results: when it is determined that there is a target data block in the currently received data block that needs to be processed based on the second weight of the target common expert model, the target data block is processed based on the second weight to obtain a processing result, wherein the weight of the target common expert model is configured as a whole in the target processor; a second determination module 806, which is used to determine the target processing result of the target data based on the first processing result and the second processing result.

[0132] As an optional implementation, the data processing device is also used to repeatedly perform the following operations until all data blocks included in the target data are received: receiving and storing a first data block, wherein the first data block is a data block currently received and included in the target data; processing the first data block using a first weight to obtain a first data block processing result; and determining a first processing result based on the obtained processing results of each first data block when it is determined that all data blocks included in the target data are stored in the target processor.

[0133] As an optional implementation manner, the data processing device is further configured to perform a multiplication operation on the first weight and the first data block to obtain a processing result of the first data block.

[0134] As an optional implementation, the data processing device is also used to receive and store the second data block sent by the first processor when it is determined that only part of the data blocks included in the target data are stored in the target processor, wherein the first processor is a processor included in multiple processors and is arranged before the target processor in the data transmission direction, and data is transmitted between the multiple processors through a ring communication method, and the second data block is a data block included in the target data except for the data block stored in the target processor.

[0135] As an optional implementation, the data processing device is further used to determine the position information of all data blocks included in the target data in the target data; according to the position information, the obtained processing results of each first data block are spliced to obtain the first processing result.

[0136] As an optional implementation, the data processing device is also used to determine a first ranking of the weights of multiple common expert models configured in the target processor; based on the first ranking, traverse the weights of each common expert model configured in the target processor in turn to determine whether there is a data block in the target data that needs to be processed based on the weight of the currently traversed common expert model; when it is determined that there is a data block in the target data that needs to be processed based on the weight of the currently traversed common expert model, determine whether there is a third data block in the currently received data block that needs to be processed based on the weight of the currently traversed common expert model; when it is determined that there is no data block in the target data that needs to be processed based on the weight of the currently traversed common expert model, skip the weight of the currently traversed common expert model.

[0137] As an optional implementation, the data processing device is also used to determine a third data block from the currently received data block, wherein the target data block includes the third data block; multiply the weight of the currently traversed ordinary expert model by the third data block to obtain a processing result of the third data block, wherein the second weight includes the weight of the currently traversed ordinary expert model, and the processing result includes the processing result of the third data block.

[0138] As an optional implementation, the data processing device is also used to perform a waiting operation when it is determined that the third data block does not exist in the currently received data block, until the third data block exists in the currently received data block, wherein the waiting operation includes: waiting for and receiving the second data block sent by the first processor, and taking the second data block as the currently received data block; processing the third data block based on the weight of the currently traversed ordinary expert model to obtain a third data block processing result, and the processing result includes the third data block processing result; wherein the first processor is a processor included in multiple processors and is arranged before the target processor in the data transmission direction, and the second data block is a data block included in the target data except for the data block stored in the target processor.

[0139] As an optional implementation, the data processing device is also used to perform the following operations for each received data block to obtain the processing result of the target processor on each data block: determine the probability value of processing the target data block based on the pre-configured second weight of each target general expert model; determine the product value of the processing result obtained by processing the target data block based on the second weight of each target general expert model and the probability value; determine the processing result of the target processor on the data block based on the product value corresponding to each target general expert model; and determine the second processing result based on the processing result of the target processor on each data block.

[0140] As an optional implementation, the data processing device is further configured to perform an addition operation on the processing results of each data block by the target processor to obtain a sum value; and determine the sum value as the second processing result.

[0141] As an optional implementation, the data processing device is also used to receive a third processing result and a fourth processing result transmitted by other processors, wherein the third processing result is the result obtained by the other processors after processing each data block in the target data in sequence based on the weight of the shared expert model configured in the other processors, and the fourth processing result is the result obtained by the other processors after processing each data block in the target data in sequence based on the weight of the common expert model configured in the other processors, wherein the other processors are processors other than the target processor among the multiple processors; based on the first processing result and the third processing result, a shared processing result is obtained; based on the second processing result and the fourth processing result, a common processing result is obtained; and an addition operation is performed on the shared processing result and the common processing result to determine the target processing result.

[0142] As an optional implementation, the data processing device is further used to concatenate the first processing result and the third processing result to obtain a shared processing result; and / or perform an addition operation on the second processing result and the fourth processing result to obtain a common processing result.

[0143] For the description of the features in the embodiment corresponding to the data processing device, reference can be made to the relevant description of the embodiment corresponding to the data processing method, which will not be repeated here.

[0144] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned data processing method embodiments.

[0145] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned data processing method embodiments when run.

[0146] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0147] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned data processing method embodiments are implemented.

[0148] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned data processing method embodiments are implemented.

[0149] 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 above description has generally described the components and steps of each example according to their functions. 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 beyond the scope of this application.

[0150] The above is a detailed introduction to a data processing method provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications may be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A data processing method, characterized in that: Applicable to target processors, including: Based on a first weight of a target shared expert model configured in the target processor, sequentially processing each data block included in the received target data to be processed to obtain a first processing result; When processing each of the received data blocks based on the first weight, the following operations are performed, and a second processing result is determined based on all the obtained processing results: when it is determined that there is a target data block in the currently received data blocks that needs to be processed based on the second weight of the target general expert model, the target data block is processed based on the second weight to obtain a processing result, wherein the weight of the target general expert model is configured as a whole in the target processor; determining a target processing result of the target data based on the first processing result and the second processing result; Determining a first result based on the first processing result and the second processing result includes: receiving a third processing result and a fourth processing result transmitted by another processor, wherein the third processing result is a result obtained by the other processor after sequentially processing each data block in the target data based on the weight of the shared expert model configured in the other processor, and the fourth processing result is a result obtained by the other processor after sequentially processing each data block in the target data based on the weight of the common expert model configured in the other processor, wherein the other processor is a processor other than the target processor among the plurality of processors; Obtaining a shared processing result based on the first processing result and the third processing result; Obtaining a common processing result based on the second processing result and the fourth processing result; An addition operation is performed on the shared processing result and the common processing result to determine the target processing result.

2. The data processing method according to claim 1, characterized in that: Based on a first weight of a target shared expert model configured in the target processor, each data block included in the received target data to be processed is processed in sequence to obtain a first processing result, including: Repeat the following operations until all data blocks included in the target data are received: receiving and storing a first data block, wherein the first data block is a currently received data block included in the target data; processing the first data block using the first weight to obtain a first data block processing result; When it is determined that all the data blocks included in the target data are stored in the target processor, the first processing result is determined based on the obtained processing results of each of the first data blocks.

3. The data processing method according to claim 2, characterized in that: Processing the first data block using the first weight to obtain a first data block processing result includes: Perform a matrix multiplication operation on the first weight and the first data block to obtain a processing result of the first data block.

4. The data processing method according to claim 2, characterized in that: Receiving and storing a first data block, comprising: When it is determined that only part of the data blocks included in the target data are stored in the target processor, a second data block sent by a first processor is received and stored, wherein the first processor is a processor included in multiple processors and arranged before the target processor in the data transmission direction, and data is transmitted between the multiple processors through a ring communication method, and the second data block is a data block included in the target data except for the data block stored in the target processor.

5. The data processing method according to claim 2, characterized in that: Determining the first processing result based on the obtained processing results of each of the first data blocks includes: Determining position information of all data blocks included in the target data in the target data; According to the position information, the obtained processing results of each of the first data blocks are spliced together to obtain the first processing result.

6. The data processing method according to claim 1, characterized in that: Before determining that a target data block that needs to be processed based on the second weight of the target general expert model exists in the currently received data block, the method further includes: determining a first ranking of weights of a plurality of general expert models configured in the target processor; Based on the first sorting, traversing the weight of each common expert model configured in the target processor in sequence to determine whether there is a data block in the target data that needs to be processed based on the weight of the currently traversed common expert model; When it is determined that a data block that needs to be processed based on the weight of the currently traversed general expert model exists in the target data, determining whether a third data block that needs to be processed based on the weight of the currently traversed general expert model exists in the currently received data block; When it is determined that there is no data block in the target data that needs to be processed based on the weight of the currently traversed common expert model, the currently traversed weight of the common expert model is skipped.

7. The data processing method according to claim 6, characterized in that: When it is determined that a third data block that needs to be processed based on the weight of the currently traversed common expert model exists in the currently received data block, the target data block is processed based on the second weight to obtain a processing result, including: Determining the third data block from the currently received data blocks, wherein the target data block includes the third data block; The weight of the currently traversed common expert model is multiplied by the third data block to obtain a third data block processing result, wherein the second weight includes the weight of the currently traversed common expert model, and the processing result includes the third data block processing result.

8. The data processing method according to claim 6, characterized in that: The method further comprises: When it is determined that the third data block does not exist in the currently received data block, performing a waiting operation until the third data block exists in the currently received data block, wherein the waiting operation includes: waiting for and receiving the second data block sent by the first processor, and using the second data block as the currently received data block; Processing the third data block based on the weight of the currently traversed common expert model to obtain a processing result of the third data block, wherein the processing result includes the processing result of the third data block; The first processor is a processor included in a plurality of processors and arranged before the target processor in the data transmission direction, and the second data block is a data block included in the target data except for the data block stored in the target processor.

9. The data processing method according to claim 7, characterized in that: Determining a second processing result based on all the obtained processing results includes: For each of the received data blocks, the following operations are performed to obtain a processing result of each of the data blocks by the target processor: determining a probability value of processing the target data block based on a pre-configured second weight of each of the target general expert models; determining a product value of a processing result obtained by processing the target data block based on the second weight of each of the target general expert models and the probability value; and determining a processing result of the data block by the target processor based on the product value corresponding to each of the target general expert models; The second processing result is determined based on a processing result of each of the data blocks by the target processor.

10. The data processing method according to claim 9, characterized in that: Determining the second processing result based on the processing result of each of the data blocks by the target processor includes: performing an addition operation on the processing results of each of the data blocks by the target processor to obtain a sum value; The added value is determined as the second processing result.

11. The data processing method according to claim 1, characterized in that: Obtaining a shared processing result based on the first processing result and the third processing result, including: concatenating the first processing result and the third processing result to obtain the shared processing result; and / or, Obtaining a common processing result based on the second processing result and the fourth processing result includes: performing an addition operation on the second processing result and the fourth processing result to obtain the common processing result.

12. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data processing method according to any one of claims 1 to 11 when executing the computer program.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data processing method according to any one of claims 1 to 11.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Recommendation method, device and equipment based on deep learning model

    CN116861092A

  • Task processing method and device based on agent and expert model, and storage medium

    CN119962691A