Data processing method, apparatus and system, and related device

By replacing multiplication or division operation modules with AI operators in numerical algorithms and combining them with vector and matrix calculation units, the problems of large computational load and high latency in existing technologies are solved, achieving efficient data computation.

WO2026020775A1PCT designated stage Publication Date: 2026-01-29HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/073957
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-07-26
Filing Date
2025-01-22
Publication Date
2026-01-29

AI Technical Summary

Technical Problem

Existing technologies, when performing data calculations based on numerical algorithms, involve excessive computation, resulting in high latency and excessive consumption of computing resources, making it difficult to improve computational efficiency while ensuring computational accuracy.

Method used

AI operators are used to replace the multiplication or division modules in numerical algorithms and are executed in vector or matrix calculation units. Since the computational cost of AI operators is less than that of multiplication or division modules, addition and subtraction operations are performed in conjunction with scalar calculation units, thereby accelerating data computation.

Benefits of technology

While ensuring computational accuracy, it reduces computational resource consumption and overall latency, thereby improving the efficiency of data computation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025073957_29012026_PF_FP_ABST
    Figure CN2025073957_29012026_PF_FP_ABST
Patent Text Reader

Abstract

A data processing method, apparatus and system, and a related device, which relate to the technical field of data processing. The method comprises: acquiring data to be processed, and on the basis of a computation process indicated by a numerical algorithm, performing computation on the data to obtain a computation result. During the process of performing computation on the data, at least one artificial intelligence (AI) operator is invoked to participate in the computation for the data, wherein each AI operator is used for replacing a multiplication or division operation module in the numerical algorithm. The AI operator is run in a vector computing unit or a matrix computing unit. Addition and subtraction operations in the numerical algorithm are executed by means of a scalar computing unit. Since the computational load generated by the AI operator is far less than that generated by the multiplication or division operation module, replacing the multiplication or division operation module with the AI operator can effectively reduce data computation overheads and can also reduce data computation latency. In addition, data computation logic still adheres to a theoretical reasoning foundation indicated by a numerical algorithm, and thus it can be ensured that the computational accuracy reaches a relatively high level.
Need to check novelty before this filing date? Find Prior Art

Description

Data processing methods, devices, systems and related equipment

[0001] This application claims priority to Chinese Patent Application No. 202411022035.5, filed on July 26, 2024, entitled “Data Processing Method, Apparatus, System and Related Equipment”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of data processing technology, and in particular to a data processing method, apparatus, system and related equipment. Background Technology

[0003] In practical applications, it is often necessary to establish appropriate mathematical models under pre-set assumptions for real-world problems such as volcanic eruptions, seismic shock waves, and climate change. Based on the input data, appropriate numerical algorithms are used to solve the mathematical model. This includes performing calculations such as data fitting, differential equation discretization, and solving linear algebraic equations to obtain high-precision calculation results with a rigorous theoretical basis, such as accurately calculating the time and scale of volcanic eruptions.

[0004] However, this method of calculating input data based on numerical algorithms requires too much computation, resulting in high computational latency and excessive consumption of computing resources. Summary of the Invention

[0005] This application provides a data processing method that ensures a high level of computational accuracy while improving computational efficiency and reducing the required computational resources. Furthermore, this application also provides a corresponding data processing apparatus, data processing system, computing device, computer-readable storage medium, and computer program product.

[0006] Firstly, this application provides a data processing method applied to a data processing system, which includes a scalar computation unit, a vector computation unit, and a matrix computation unit. This method can be executed by a corresponding data processing device. Specifically, the data processing device acquires data to be processed and performs calculations on the data based on a computational flow indicated by a numerical algorithm to obtain the calculation result. During the data computation process, at least one AI (Artificial Intelligence) operator is invoked to participate in the computation of the data, and each AI operator replaces the multiplication or division module in the numerical algorithm. For example, the AI ​​operators participating in the data computation may be, for example, convolution operators, pooling operators, subpixel convolution operators, etc.; and the AI ​​operators run in the vector computation unit or the matrix computation unit. The addition and subtraction operations in the numerical algorithm are performed through the scalar computation unit.

[0007] Since the computational load generated by AI operators is far less than that of multiplication or division modules, replacing these modules in numerical algorithms with AI operators during data computation effectively reduces computational overhead and resource consumption. Furthermore, the latency of data computation using AI operators is typically lower than that of performing multiplication or division operations, thus reducing overall computational latency. Simultaneously, the computational logic still adheres to the theoretical reasoning foundation indicated by the numerical algorithm, ensuring high accuracy of the results. Therefore, while maintaining high computational accuracy, computational efficiency is improved and resource consumption is reduced. Additionally, AI operators operate within vector or matrix computation units, leveraging their compatibility with computing hardware to fully utilize their computational characteristics, further enhancing computational efficiency and reducing overall latency and resource consumption.

[0008] In one possible implementation, when the data processing device performs calculations on data based on the computational flow indicated by the numerical algorithm, it can first determine the numerical algorithm used for the calculation, such as a multigrid iterative algorithm. Then, the data processing device can determine the multiplication or division operation modules within the numerical algorithm. For example, the data processing device can break down the computational steps in the numerical algorithm to identify the multiplication and division operation modules. Next, the data processing device can determine multiple AI operators to replace the multiplication or division operation modules, and based on the computational flow indicated by the numerical algorithm, call at least one AI operator to participate in the calculation of the data. That is, when the multiplication or division operation module is executed, the data processing device can call the corresponding AI operator to perform the calculation. Thus, for any numerical algorithm, the data processing device can use AI operators to replace the multiplication or division operation modules in the numerical algorithm through the above implementation, thereby accelerating data computation and reducing the overall latency of data computation.

[0009] In one possible implementation, when the data processing device determines multiple AI operators to replace a multiplication or division module, it may first parse the multiplication or division module to obtain its input size, output size, and computational attributes. These computational attributes indicate the operation type of the multiplication or division module. Based on these attributes, at least one AI operator is determined to replace the multiplication or division module. In this way, the data processing device comprehensively considers multiple dimensions of information, including input size, output size, and computational attributes, to determine the AI ​​operator, ensuring the accuracy of the determined AI operator. Therefore, after replacing the multiplication or division module with this AI operator, the accuracy of the calculation result is guaranteed.

[0010] In one possible implementation, the determined at least one AI operator includes a target AI operator, which is one of the at least one AI operators. When the data processing device determines at least one AI operator based on the input size, output size, and computational attributes corresponding to the multiplication or division module, it can specifically construct an initial AI operator based on the input size, output size, and computational attributes corresponding to the multiplication or division module, and then train the initial AI operator to obtain the target AI operator used to replace the multiplication or division module. Similarly, for other AI operators among the at least one AI operators, AI operators used to replace the multiplication or division module can be obtained in a similar manner. Thus, when there is no suitable AI operator at present, by creating an initial AI operator and training it, AI operators used to replace the multiplication or division module can be obtained, thereby accelerating data computation and reducing computational overhead.

[0011] In one possible implementation, the data processing device can further determine the vector computation unit or matrix computation unit in which each AI operator in at least one AI operator runs, based on the input scale and computational attributes corresponding to the multiplication or division operation module. Thus, determining the vector computation unit or matrix computation unit used to run the AI ​​operator based on the input scale and computational attributes can improve the efficiency of data computation using the AI ​​operator. For example, when the computational attribute indicates matrix multiplication but the input scale indicates that the AI ​​operator's input data is a 2-bit matrix, the data processing device can schedule the AI ​​operator to be executed in the vector computation unit, thereby achieving better computational results in the vector computation unit.

[0012] In one possible implementation, the computational property includes dot product or matrix multiplication.

[0013] In one possible implementation, numerical algorithms are used to construct the AI ​​model, and at least one AI operator is used to accelerate the inference process of the AI ​​model. Thus, during the construction of the AI ​​model, the data processing device can utilize multiple AI operators to accelerate the data computation efficiency of the numerical algorithm portion of the AI ​​model, thereby improving the overall computational performance of the AI ​​model at runtime.

[0014] In one possible implementation, the data processing device can further add at least one AI operator for a numerical algorithm to an optimization library. The optimization library includes at least one optimization strategy, each of which includes at least one AI operator corresponding to a numerical algorithm. Alternatively, each optimization strategy can indicate at least one AI operator corresponding to a numerical algorithm, such as an optimization strategy including an identifier for the numerical algorithm and identifiers for multiple AI operators. Thus, when the data processing device performs calculations on data from different services or data provided by different applications, after determining the numerical algorithm used for that data, it can determine the optimization strategy corresponding to that numerical algorithm from the optimization library. This allows it to use the at least one AI operator indicated by the optimization strategy to replace the multiplication or division module in the numerical algorithm, thereby improving and reducing the resource overhead of data computation and increasing the efficiency of data computation.

[0015] Secondly, this application provides a data processing apparatus applied to a data processing system. The data processing system includes a scalar calculation unit, a vector calculation unit, and a matrix calculation unit. The data processing apparatus includes: an acquisition module for acquiring data to be processed; and a calculation module for calculating the data based on a calculation process indicated by a numerical algorithm to obtain calculation results. During the calculation of the data, at least one AI (artificial intelligence) operator is invoked to participate in the calculation of the data. The AI ​​operator is used to replace the multiplication or division module in the numerical algorithm. The AI ​​operator runs in the vector calculation unit or the matrix calculation unit. The addition and subtraction operations in the numerical algorithm are executed through the scalar calculation unit.

[0016] In one possible implementation, the computation module is configured to: determine a numerical algorithm for performing computations on the data; determine a multiplication or division operation module in the numerical algorithm; determine at least one AI operator to replace the multiplication or division operation module; and, based on the computation flow indicated by the numerical algorithm, invoke at least one AI operator to participate in the computation of the data.

[0017] In one possible implementation, the calculation module is configured to: parse the multiplication or division module to obtain the input size, output size, and calculation attributes corresponding to the multiplication or division module, wherein the calculation attributes are used to indicate the operation type to which the multiplication or division module belongs; and determine at least one AI operator based on the input size, output size, and calculation attributes corresponding to the multiplication or division module.

[0018] In one possible implementation, at least one AI operator includes a target AI operator, which is one of the at least one AI operators; the computation module is used to: construct an initial AI operator based on the input size, output size, and computational attributes corresponding to the multiplication or division module; and train the initial AI operator to obtain a target AI operator used to replace the multiplication or division module.

[0019] In one possible implementation, the data processing apparatus further includes: a determining module, configured to determine, based on the input scale and computational attributes corresponding to the multiplication or division module, the vector computation unit or matrix computation unit in which each AI operator in at least one AI operator is running.

[0020] In one possible implementation, the computational property includes dot product or matrix multiplication.

[0021] In one possible implementation, numerical algorithms are used to construct AI models, and at least one AI operator is used to accelerate the inference process of the AI ​​models.

[0022] In one possible implementation, the data processing apparatus further includes: an adding module for adding at least one AI operator for a numerical algorithm to an optimization library, the optimization library including at least one optimization strategy, each of the at least one optimization strategy including at least one AI operator corresponding to a numerical algorithm, or, each of the at least one optimization strategy is used to indicate at least one AI operator corresponding to a numerical algorithm.

[0023] The data processing apparatus provided in the second aspect corresponds to the data processing method provided in the first aspect. Therefore, the technical effects of any implementation in the second aspect can be referred to the technical effects of the corresponding implementation in the first aspect, and will not be elaborated here.

[0024] Thirdly, this application provides a data processing system, which includes a data processing device, a scalar calculation unit, a vector calculation unit, and a matrix calculation unit; wherein, the data processing device is used to execute the data processing method as described in the first aspect or any implementation thereof, the scalar calculation unit is used to execute addition and subtraction operations in numerical algorithms, the vector calculation unit is used to execute artificial intelligence (AI) operators, and the matrix calculation unit is used to execute AI operators.

[0025] Fourthly, this application provides a computing device, which includes a processor and a memory. The processor and the memory communicate with each other. The processor executes instructions stored in the memory to cause the computing device to perform a data processing method as described in the first aspect or any implementation thereof. It should be noted that the memory may be integrated into the processor or may be independent of the processor. The computing device may also include a bus. The processor is connected to the memory via the bus. The memory may include readable storage and random access memory.

[0026] Fifthly, this application provides a computer-readable storage medium storing instructions that, when executed on a computing device, cause the computing device to perform the operational steps of the data processing method described in the first aspect or any implementation thereof.

[0027] In a sixth aspect, this application provides a computer program product containing instructions that, when run on a computing device, causes the computing device to perform the operational steps of the data processing method described in the first aspect or any implementation thereof.

[0028] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description

[0029] Figure 1a is a schematic diagram of the structure of an exemplary data processing system provided in this application;

[0030] Figure 1b is a schematic diagram of replacing the modules including multiplication and division operations in the numerical algorithm using AI operators provided in this application;

[0031] Figure 2 is a flowchart illustrating a data processing method provided in this application;

[0032] Figure 3 is a schematic diagram of the multiple computational steps included in the multigrid iterative algorithm;

[0033] Figure 4 is a schematic diagram of breaking down the calculation steps into multiple modules;

[0034] Figure 5 is a schematic diagram showing the input size, output size, and calculation attributes of the multiplication operation module obtained through analysis.

[0035] Figure 6 is a schematic diagram of the AI ​​operators determined for each multiplication operation module;

[0036] Figure 7 is a schematic diagram of combining multiple AI operators to generate an AI module;

[0037] Figure 8 is a schematic diagram of the step-by-step calculation of data according to the calculation process of the multigrid iterative algorithm;

[0038] Figure 9 is a schematic diagram of the execution of each calculation step according to the calculation process indicated by the numerical algorithm;

[0039] Figure 10 is a schematic diagram of the structure of a data processing device provided in this application;

[0040] Figure 11 is a schematic diagram of the hardware structure of a computing device provided in this application. Detailed Implementation

[0041] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate; this is merely a method of distinction used in describing objects with the same attributes in the embodiments of this application.

[0042] The technical solutions in this application will now be described with reference to the accompanying drawings.

[0043] Referring to Figure 1a, which is a schematic diagram of the structure of an exemplary data processing system 10, the data processing system 10 includes at least one scalar computation unit, a vector computation unit, and a matrix computation unit. The scalar computation unit refers to a computation unit primarily used for scalar computation; the vector computation unit refers to a computation unit primarily used for vector computation; and the matrix computation unit refers to a computation unit primarily used for matrix computation. Each computation unit can be a processor or a hardware unit with computational capabilities on a processor core.

[0044] For ease of explanation, Figure 1a illustrates an example including a scalar computation unit 101, a vector computation unit 102, and a matrix computation unit 103. In practical applications, the data processing system 10 may include any number of scalar computation units, vector computation units, and matrix computation units. Furthermore, the scalar computation unit 101, vector computation unit 102, and matrix computation unit 103 may be located within a processor core or within a processor, such as a central processing unit (CPU) or a graphics processing unit (GPU).

[0045] In addition, the data processing system 10 also includes a data processing device 200, which can be implemented by software or hardware.

[0046] When implemented through software, the data processing device 200 can specifically be program code running on a processor, such as a process running on the CPU.

[0047] When implemented in hardware, the data processing device 200 may specifically be a processor or a computing device including a processor. For example, the processor may be any type of processor or any combination thereof, such as a CPU, GPU, application-specific integrated circuit (ASIC), programmable logic device (PLD), complex programmable logical device (CPLD), field-programmable gate array (FPGA), generic array logic (GAL), system-on-chip (SoC), software-defined infrastructure (SDI) chip, artificial intelligence (AI) chip, or data processing unit (DPU). Furthermore, the number of processors included in the data processing device 200 can be arbitrary, and the types of processors included can be one or more. The specific number and types of processors can be determined according to the actual application's business requirements, and this application does not impose any limitations in this regard.

[0048] Furthermore, as shown in Figure 1a, the data processing system 10 can also have a communication connection with an external application 20. For example, the application 20 can be a high-performance computing (HPC) application or an artificial intelligence (AI) application, etc. During operation, the application 20 can provide data to be computed to the data processing system 10. For instance, when the application 20 is specifically an HPC application, it can provide large-scale meteorological data to the data processing system 10 to request the system to perform weather forecasting based on that large-scale meteorological data.

[0049] The data processing system 10 can perform corresponding calculations on the data provided by the application 20 based on numerical algorithms. Numerical algorithms are methods for approximating solutions to numerical problems using mathematical algorithms and computer technology, such as multigrid (MG) iterative algorithms, the finite element method (FEM), and numerical approximation algorithms. These calculations typically involve a large number of addition, subtraction, multiplication, and division operations. Compared to addition and subtraction, multiplication and division operations are more computationally time-consuming and require more computational resources. Therefore, the data processing device 200's step-by-step execution of addition, subtraction, multiplication, and division operations based on the computational logic of numerical algorithms results in higher overall computational latency and greater computational resource consumption.

[0050] Based on this, in the data processing system 10 provided in this application, for the data to be calculated provided by application 20, the data processing device 200 calculates the data based on the calculation process indicated by the numerical algorithm and obtains the corresponding calculation results. During the calculation of the data, at least one AI operator is invoked to participate in the calculation of the data. Specifically, the data processing device 200 may use at least one AI operator to replace part or all of the multiplication or division operation modules in the numerical algorithm, that is, to invoke at least one AI operator to perform the multiplication or division operation in the numerical algorithm. Here, an AI operator refers to an operator (or a wrapper around a calculation function) used to perform various tensor calculations in an AI scenario, such as a convolution operator or a linear operator.

[0051] For example, suppose the numerical algorithm includes five modules as shown in Figure 1b, where modules 1, 3, and 5 do not include multiplication and division operations, while modules 2 and 4 include either multiplication or division operations. Then, the data processing device 200 can determine AI operator 1 and AI operator 2 for modules 2 and 4 respectively. Following the calculation process indicated by the numerical algorithm, after completing the calculation in module 1, it calls AI operator 1 to perform the calculation and passes the result to module 3 for further calculation, and so on, until the calculation process corresponding to module 5 is completed.

[0052] Since the computational load generated by AI operators is typically much smaller than that generated by multiplication and division modules, the data processing device 200 can effectively reduce computational overhead and resource consumption by replacing multiplication and / or division modules with AI operators during data computation. Furthermore, the latency of computing data using AI operators is usually less than the latency of performing multiplication or division operations. Therefore, replacing multiplication and / or division modules in numerical algorithms with AI operators can also effectively reduce the overall latency of data computation. Simultaneously, the computational logic still satisfies the theoretical reasoning basis indicated by the numerical algorithm, enabling the data processing device 200 to achieve a high level of accuracy in the computational results obtained based on this numerical algorithm. Thus, while ensuring a high level of computational accuracy, the efficiency of data computation can be improved and the consumption of computational resources reduced.

[0053] Furthermore, the AI ​​operators invoked by the data processing device 200 run in the vector computation unit 102 or the matrix computation unit 103. This leverages the affinity between the AI ​​operators and the computing hardware to fully utilize the computational characteristics of the AI ​​operators, thereby further improving data computation efficiency, reducing overall data computation latency, and minimizing computational resource consumption. For addition and subtraction operations in numerical algorithms, the data processing device 200 can schedule the scalar computation unit 101 to perform them.

[0054] It is worth noting that the data processing system 10 shown in Figure 1a is merely an illustrative example and is not intended to limit the scope of the system. For instance, other possible data processing systems may include multiple scalar computation units, vector computation units, and matrix computation units. In this case, the multiple computation units in the data processing system can be centrally deployed on the same computing device, such as on different processor cores or processors; or, the multiple computation units in the data processing system can be distributed and deployed on processors or processor cores in different computing devices. Furthermore, other possible data processing systems may also include devices with other functions, such as a baseboard management controller (BMC) for managing multiple hardware components in the data processing system. Moreover, the data processing system 10 may also include an application, such as a client application, so that the data processing system 10 can provide data computing services, such as cloud services, to users based on the application.

[0055] For ease of understanding, embodiments of the data processing method provided in this application will be described below with reference to the accompanying drawings.

[0056] Referring to Figure 2, which is a flowchart illustrating a data processing method according to an embodiment of this application, this method can be applied to the data processing system 10 shown in Figure 1a, or to other applicable data processing systems. For ease of explanation, this embodiment uses the data processing system 10 shown in Figure 1a as an example for illustrative purposes.

[0057] The data processing method shown in Figure 2 may specifically include:

[0058] S201: Application 20 provides data to be calculated to data processing device 200.

[0059] In this embodiment, application 20 can request data processing system 10 to perform data calculations, such as requesting data processing system 10 to infer climate change in a certain region based on meteorological data of that region, or requesting data processing system 10 to infer the time and scale of a volcanic eruption based on information such as the temperature and activity status of the volcano.

[0060] In one possible implementation, application 20 can send a computation request to data processing system 10, requesting data processing system 10 to provide corresponding computation services. Data processing device 200 in data processing system 10 can send a response to application 20 in response to the computation request, instructing application 20 to provide data to be computed, so that data processing device 200 can obtain the data to be computed sent by application 20 through the communication connection between application 20 and data processing system 10.

[0061] In practical applications, the data processing device 200 may also acquire the data to be calculated through other means, and there is no limitation on this.

[0062] In this embodiment, after acquiring the data, the data processing device 200 can schedule at least one AI operator to run on the vector computing unit 102 or the matrix computing unit 103, and perform calculations on the data based on the calculation process indicated by the numerical algorithm. In the process of calculating the data, the data processing device 200 calls the at least one AI operator to participate in the calculation of the data. Specifically, the vector computing unit 102 or the matrix computing unit 103 can be used to execute the AI ​​operator to replace the multiplication or division operation of the data in the numerical algorithm, and the scalar computing unit 101 can be used to execute the addition or subtraction operation of the data in the numerical algorithm to complete the calculation of the data.

[0063] The following describes in detail the process by which the data processing device 200 calls at least one AI operator to perform calculations on the data, with reference to steps S202 to S205 in Figure 2.

[0064] S202: The data processing device 200 determines the numerical algorithm used to perform calculations on the data.

[0065] In this embodiment, the data processing device 200 can use different numerical algorithms to calculate data from different services provided by application 20; or, the data processing device 200 can use different numerical algorithms to calculate data from different applications. Therefore, the data processing device 200 can first determine one or more numerical algorithms to be used for calculating the data. For ease of understanding, this embodiment uses the example of the data processing device 200 determining one numerical algorithm for the data.

[0066] As a first implementation example, the data processing device 200 can determine the numerical algorithm to be used for the calculation of the data based on the business type to which the data to be calculated belongs. Specifically, the data processing device 200 can be pre-configured with a mapping relationship 1, such as by a technician, which is used to record the one-to-one correspondence between various business types and various numerical algorithms. In this way, when acquiring the data to be calculated, the data processing device 200 can simultaneously acquire the target business type to which the data belongs, and query the mapping relationship 1 based on the target business type to determine the numerical algorithm corresponding to the target business type. Thus, the data processing device 200 can determine to perform the corresponding calculation process on the data using the numerical algorithm.

[0067] As a second implementation example, the data processing device 200 can determine the numerical algorithm based on the computational requirements for the data to be calculated. These computational requirements could be, for example, data mining, data analysis, or data prediction requirements. Specifically, the data processing device 200 can be pre-configured with a mapping relationship 2, which can be pre-configured by technicians. This mapping relationship 2 records a one-to-one correspondence between various computational requirements and various numerical algorithms. In this way, while acquiring the data to be calculated, the data processing device 200 can simultaneously acquire the target computational requirements specified by the user for that data. Therefore, the data processing device 200 can query the mapping relationship 2 based on these computational requirements to determine the numerical algorithm corresponding to the target computational requirement and determine how to perform the corresponding computational process on the data using that numerical algorithm.

[0068] In practical applications, the data processing device 200 can also determine the numerical algorithm used for calculations on the data based on other methods, and there is no limitation on this. For example, a user can specify a specific numerical algorithm to the data processing device 200 through a client, so that the data processing device 200 can perform calculations on the data based on the user-specified numerical algorithm.

[0069] S203: The data processing device 200 determines the multiplication operation module and the division operation module in the numerical algorithm.

[0070] Typically, a numerical algorithm may include multiple computational steps (and other types of steps, such as initialization steps for assigning values ​​to variables), and each computational step may include at least one of addition, subtraction, multiplication, and division operations. Since multiplication and division operations usually incur significant computational overhead, the data processing device 200 may identify the multiplication and / or division modules in the numerical algorithm so that these modules can be replaced with AI operators that have lower computational overhead.

[0071] In one possible implementation, the data processing device 200 can decompose the expression in the calculation steps into modules including multiplication (i.e., modules containing multiplication operations), modules including division (i.e., modules containing division operations), and modules excluding multiplication and division (such as modules for assignment or modules containing only addition / subtraction operations). In practical applications, if the numerical algorithm only includes addition, subtraction, and multiplication operations, the data processing device 200 only needs to replace the multiplication module with the AI ​​operator after decomposing the calculation steps in the numerical method. Similarly, when the numerical algorithm only includes addition, subtraction, and division operations, the data processing device 200 only needs to replace the division module with the AI ​​operator after decomposing the calculation steps in the numerical method. In this embodiment, a numerical method that includes both multiplication and division modules is taken as an example.

[0072] For example, suppose the numerical algorithm could specifically be the multigrid iterative algorithm shown in Figure 3. Wherein, Let n be the iteration value at iteration step n, where 1 ≤ n i ≤N, where N is the total number of iterations; For iteration step n i Source item at location; A i R is the iteration matrix of the i-th layer mesh; i The constraint operator is used to map a fine mesh to a coarse mesh, i.e., R:x m →x n ,n <m;P i This is an interpolation operator used to map a coarse mesh to a fine mesh, i.e., P:x n →x m ν1 and ν2 are smoothing factors, with values ​​ranging from (0 to 0.5). The multigrid iterative algorithm shown in Figure 3 mainly includes seven calculation steps, as shown in equations (1.1), (1.2), (1.3), (1.5), (1.7), (1.8), and (1.9).

[0073] The data processing device 200 then breaks down the seven calculation steps into multiple modules as shown in Figure 4. The modules within the dashed boxes are multiplication operation modules that need to be replaced using AI operators.

[0074] In other embodiments, the data processing device 200 may also be configured with a module decomposition tool. The data processing device 200 can then use this tool to decompose each calculation step in the numerical algorithm to obtain the corresponding multiplication and / or division operation modules. The principle behind the module decomposition tool's decomposition of each module can be found in the description of the relevant aspects of the data processing device 200's decomposition of each module described above.

[0075] S204: The data processing device 200 determines multiple AI operators for replacing the multiplication operation module and the division operation module.

[0076] In this embodiment, the data processing device 200 can determine an AI operator for replacing each determined multiplication and division operation module, wherein the AI ​​operators used to replace different multiplication or division operation modules can be different.

[0077] In one possible implementation, the data processing device 200 can determine multiple AI operators by parsing the multiplication and division operation modules.

[0078] In specific implementation, the data processing device 200 can parse the multiplication and division operation modules. Specifically, it can parse the values ​​of each variable and the operational relationships between variables in the multiplication and division operation modules to obtain the input scale, output scale, and computational attributes corresponding to the multiplication and division operation modules, respectively. The input scale refers to the size of the input data, which can be indicated by the number or dimensions of the input data. The output scale refers to the size of the output data, which can be indicated by the number or dimensions of the output data. The computational attributes indicate the operation type of the multiplication or division operation module, such as dot product, matrix multiplication, etc.

[0079] For example, regarding the partial multiplication operation module shown in Figure 4, assume that the linear equation system of the multidimensional grid iterative algorithm is m-dimensional, and that the constraint operator R... i The scaling factor is 1 / 2, meaning the output data size is reduced to half the input data size. The interpolation operator P... i The scaling ratio is 2, meaning the output data size is magnified to twice the input data size. Thus, after the data processing device 200 parses this part of the multiplication operation module, it can obtain the input size, output size, and calculation attributes corresponding to each multiplication operation module, as shown in Figure 5. The calculation attributes shown in Figure 5 can include dot product and matrix multiplication operations. When the calculation attribute is 0, it indicates dot product; when the calculation attribute is 1, it indicates matrix multiplication. Regarding the multiplication operation module... Its input size It is used to refer to the value taken in each calculation stage, and may differ from the value of m.

[0080] Then, the data processing device 200 can determine multiple AI operators to replace each multiplication and division operation module based on their respective input scale, output scale, and computational attributes.

[0081] As a first implementation example, the data processing device 200 may have a pre-configured mapping relationship 2, such as one that can be pre-configured by a technician. This mapping relationship 2 is used to record the AI ​​operators corresponding to the input size, output size, and computational attributes. Thus, after determining the input size, output size, and computational attributes corresponding to each multiplication and division module, the data processing device 200 can determine the AI ​​operators to replace each multiplication and division module by searching the mapping relationship 2.

[0082] As a second implementation example, the data processing device 200 may be pre-configured with an AI model, such as a deep neural network model or a random forest model, for predicting AI operators. Then, the data processing device 200 can input the determined input scale, output scale, and computational attributes of each multiplication and division operation module into the AI ​​model, and the AI ​​model will perform inference based on the input information to obtain the corresponding inference result. This inference result may be, for example, an identifier for the AI ​​operator, indicating the AI ​​operator used to replace each multiplication or division operation module.

[0083] For example, for the multiple multiplication operation modules shown in Figure 4, the data processing device 200 can determine the AI ​​operator shown in Figure 6 for each multiplication operation module. Specifically, for each multiplication operation module... The AI ​​operators determined by the data processing device 200 for the multiplication module can specifically be the activation operator "act" and the convolution operator "nn.Conv2d"; for the multiplication module The AI ​​operators determined by the data processing device 200 for the multiplication operation module can specifically be the activation operator "act" and the average pooling operator "nn.AvgPool2d".

[0084] In practical applications, the data processing device 200 can also determine AI operators in other ways, such as determining AI operators for each multiplication or division module according to pre-configured rules / strategies, and there is no limitation on this.

[0085] The AI ​​operators used to replace the various multiplication and division operation modules can be pre-built AI operators. For example, the data processing device 200 can be pre-configured with an operator library that includes multiple AI operators. The data processing device 200 can then select the appropriate AI operators from the operator library to replace the various multiplication and division operation modules based on information such as input size, output size, and computational attributes. In practical applications, technicians can pre-develop multiple AI operators and configure an operator library containing these multiple AI operators in the data processing device 200.

[0086] Alternatively, the data processing device 200 can temporarily construct AI operators for each multiplication and division operation module. Specifically, taking the determination of an AI operator to replace a multiplication operation module as an example (for ease of distinction, this AI operator will be referred to as the target AI operator below), the data processing device 200 can construct an initial AI operator based on the input size, output size, and computational attributes of the multiplication operation module. The parameters in this initial AI operator are initial values. Then, the data processing device 200 can train this initial AI operator and use the trained initial AI operator as the target AI operator to replace the multiplication operation module. For example, the data processing device 200 can construct training samples based on the multiplication operation module. Specifically, it can use the multiplication operation module to calculate the output results corresponding to multiple sets of input data, and use each set of input data and its corresponding output result as a set of training samples. Then, the data processing device 200 can use the training samples to train the initial AI operator. The trained initial AI operator is the target AI operator used to replace the multiplication operation module. Similarly, the data processing device 200 can also determine a suitable AI operator for the division operation module based on the above-described similar method.

[0087] Furthermore, before determining whether to replace the multiplication / division module with an AI operator, the data processing device 200 can estimate whether the replacement benefit is positive, that is, whether the benefit generated by replacing the multiplication / division module with an AI operator is greater than the benefit generated by directly executing the multiplication / division module (if it is greater, the benefit is positive). And, when the replacement benefit is positive, the data processing device 200 determines to use the determined AI operator to replace the multiplication / division module; while when the replacement benefit is not positive (e.g., the replacement benefit is negative), the data processing device 200 does not use the AI ​​operator to replace the multiplication / division module. For example, taking the replacement of multiplication module X with an AI operator as an example, after determining the AI ​​operator for multiplication module X, the data processing device 200 can estimate the computational overhead (or computational delay) generated by the AI ​​operator and the computational overhead (or computational delay) generated by multiplication module X, and calculate the difference between these two computational overheads (or computational delays). When the difference is greater than a preset value, the data processing device 200 determines that the replacement benefit is positive and decides to use the AI ​​operator to replace the multiplication module X. When the difference is less than or equal to the preset value, the data processing device 200 determines that the replacement benefit is not positive and decides not to use the AI ​​operator to replace the multiplication module X; correspondingly, in subsequent data calculations, the corresponding multiplication calculation process is directly performed based on the multiplication module. Thus, by using the AI ​​operator to replace the multiplication module, the data processing device 200 can ensure that the overall data computation overhead is reduced. Similarly, the data processing device 200 can determine whether to use the AI ​​operator to replace the division module based on a similar method.

[0088] In addition to the above-described implementation methods for determining AI operators, in other embodiments, the data processing device 200 may also be configured with a module parsing tool and an operator selection tool. Then, the data processing device 200 can call the module parsing tool to parse each multiplication and division operation module, obtaining the corresponding input scale, output scale, and computational attributes. The principle of the module parsing tool in parsing each module can be found in the description of the relevant aspects of the data processing device 200 parsing each module described above. Then, the data processing device 200 calls the operator selection tool, which outputs multiple AI operators to replace each multiplication and division operation module. The principle of the operator selection tool in determining the AI ​​operators can be found in the description of the relevant aspects of the data processing device 200 determining the corresponding AI operators for each module described above.

[0089] It is worth noting that for each multiplication or division operation module, the data processing device 200 may determine one or more AI operators. For example, as shown in Figure 6, for the multiplication operation module... The data processing device 200 can determine one AI operator for it, namely the parameter operator "nn.parameter"; for the multiplication operation module The data processing device 200 can determine three AI operators for it, namely the parameter operator "nn.parameter", the activation operator "act", and the convolution operator "nn.Conv2d"; the other multiplication operation modules are similar, as shown in Figure 6.

[0090] Furthermore, taking the multiplication operation module as an example, when multiple AI operators are determined for a single multiplication operation module, the data processing device 200 can combine the multiple AI operators according to the calculation logic between multiple variables in the multiplication operation module to generate an AI module corresponding to the multiplication operation module. This AI module includes multiple AI operators executed sequentially. For example, as shown in Figure 7, for the multiplication operation module... AI module The other multiplication operation modules are similar, as shown in Figure 7. Therefore, during the subsequent execution of numerical algorithms, the data processing device 200 can use the combined generated AI modules to replace the corresponding multiplication operation modules.

[0091] Furthermore, the data processing device 200 can also determine the computing unit where each AI operator runs and schedule the AI ​​operator to run on the corresponding computing unit, as shown in Figure 2. It can be understood that when some multiplication or division modules correspond to the same AI operator, the data processing device 200 can deploy only one copy of the AI ​​operator on the computing unit, and then repeatedly call the same AI operator when executing those multiplication or division modules.

[0092] Typically, the computational unit in which AI operators run can be either the vector computation unit 102 or the matrix computation unit 103. Optionally, some AI operators can also run in the scalar computation unit 101.

[0093] In the first implementation example, the data processing device 200 can determine the computing unit in which the AI ​​operator runs based on its computational attributes. For example, when the AI ​​operator's computational attribute is dot multiplication, the data processing device 200 can determine that the AI ​​operator runs in the vector computing unit 102. When the AI ​​operator's computational attribute is matrix multiplication, the data processing device 200 can determine that the AI ​​operator runs in the matrix operation unit 103.

[0094] In the second implementation example, the data processing device 200 can determine the computing unit where each AI operator runs based on pre-configured rules, according to information such as the input scale and computational attributes of each AI operator. For example, when the computational attribute of an AI operator is dot product and the input scale is greater than a first threshold (the first threshold could be, for example, 2), the data processing device 200 can determine that the AI ​​operator runs in the vector computing unit 102. When the computational attribute of an AI operator is dot product and the input scale is less than or equal to the first threshold, the data processing device 200 can determine that the AI ​​operator runs in the scalar computing unit 101. When the computational attribute of an AI operator is matrix multiplication and the input scale is greater than a second threshold, the data processing device 200 can determine that the AI ​​operator runs in the matrix computing unit 103. When the computational attribute of an AI operator is matrix multiplication and the input scale is less than or equal to the second threshold, the data processing device 200 can determine that the AI ​​operator runs in the vector computing unit 102. For example, the second threshold could be 2, meaning that when the computational attribute of the AI ​​operator is matrix multiplication and the input data of the AI ​​operator is a two-dimensional matrix, the data processing device 200 can determine to run the AI ​​operator in the vector computation unit 102. In this way, the data processing device 200 can fully utilize the affinity between the computation unit and the AI ​​operator, running each AI operator on a computation unit with higher affinity, thereby improving the operating efficiency of the AI ​​operator and thus improving the overall performance of data computation.

[0095] In practical applications, the data processing system 10 may include multiple vector computing units and multiple matrix computing units, so that the multiple different AI operators determined by the data processing device 200 can be distributed and run on different vector computing units and different matrix computing units.

[0096] S205: The data processing device 200 calls the multiple AI operators to participate in the calculation of the data based on the calculation process indicated by the numerical algorithm, and obtains the calculation result.

[0097] It is understandable that the AI ​​operator determined by the data processing device 200 is mainly used to replace multiplication or division operations. During the calculation of the data, the data processing device 200 will still perform calculations step by step according to the calculation process indicated by the numerical algorithm. For example, for the multigrid iterative algorithm shown in Figure 2, if equation (1.1) is abbreviated as S, equations (1.2) and (1.3) are abbreviated as R, equation (1.5) is abbreviated as solver, equations (1.7) and (1.8) are abbreviated as P, and equation (1.9) is abbreviated as S, then the data processing device 200 can perform step-by-step calculations on the data based on the calculation process of the multigrid iterative algorithm shown in Figure 8 until the iterative calculation process ends and the corresponding calculation results are obtained. In the calculation process shown in Figure 8, the left side of step S is the calculation step in the numerical algorithm (including the multiplication operation module), and the right side of step S is the calculation step after replacing the multiplication operation module with the AI ​​operator (steps S, P, and slover are similar). In the calculation process shown in Figure 8, only one iteration of calculation steps S and R is reflected (i.e., steps S and R are executed only once). In actual application, the calculation process indicated by the numerical algorithm includes multiple iterations of calculation for steps S and R (i.e., the first step S and R in Figure 8 are executed cyclically). Thus, the data processing device 200 can perform multiple iterations of calculation for calculation steps S and R according to the calculation process indicated by the numerical algorithm (i.e., continue to execute step solver after iteratively executing steps S and R).

[0098] During data computation, when the multiplication and / or division operation modules in the numerical algorithm are executed, the data processing device 200 can call the corresponding AI operator for calculation. Specifically, the data processing device 200 calls the interface corresponding to the AI ​​operator and passes the input data into the AI ​​operator through the interface, so that the AI ​​operator can perform the corresponding calculation process based on the input data and output the result; then, the data processing device 200 can continue to perform subsequent calculations based on the output result.

[0099] For example, when the data processing device 200 executes the multigrid iterative algorithm shown in Figure 3, when it reaches the multiplication operation module... At that time, the data processing device 200 can schedule the interface corresponding to the parameter operator "nn.parameter" and send the input data. The data is passed into the parameter operator so that the parameter operator can perform the corresponding calculation process based on the input data. Then, the data processing device 200 can calculate the result based on the numerical value. Specifically, this can be achieved by sequentially calling each AI operator included in the AI ​​module for calculation.

[0100] In the first implementation, the data processing device 200 decomposes the various calculation steps in the numerical algorithm into multiple modules during the process of determining the AI ​​operator, as shown in Figure 4, where the calculation steps corresponding to equation (1.1) are decomposed into... There are three modules. Therefore, the data processing device 200 can perform calculations step by step according to the calculation process indicated by the numerical algorithm and the calculation logic between the multiple modules obtained from the breakdown. At this time, different modules in the calculation steps can be associated with each other using plus or minus signs, such as... Furthermore, during the calculation process, when encountering multiplication and / or division operation modules, the data processing device 200 can call the corresponding AI operator or AI module to perform calculations, thereby reducing computational overhead and improving computational efficiency.

[0101] In the second implementation, the data processing device 200 can perform calculations step by step according to the calculation order in each calculation step. Furthermore, during the calculation process, when encountering a multiplication operation module and / or a division operation module with higher priority, the data processing device 200 can call the corresponding AI operator or AI module to perform calculations, and after obtaining the corresponding results, continue to execute the subsequent calculation process until the calculation process of that calculation step is completed.

[0102] For example, when executing the calculation steps corresponding to equation (1.1) according to the calculation process indicated by the numerical algorithm, as shown in Figure 9, the data processing device 200 can execute the higher-priority multiplication operation module. At this time, the data processing device 200 can call the AI ​​module. (i.e., used for replacement) The combination of activation and convolution operators is used for calculation to obtain result 1. Then, the data processing device 200 can calculate according to the calculation order. The difference between this result and result 1. Next, the data processing device 200 can call the AI ​​operator "nn.parameter" based on this difference to obtain result 2. Finally, the data processing device 200 can calculate... The sum of the result 2 is used to complete the calculation process corresponding to the calculation step of equation (1.1). Similarly, for other calculation steps, the data processing device 200 can also perform calculations by referring to the above process, as shown in Figure 9.

[0103] During the data computation process, the data processing device 200 can utilize the scalar computation unit 101 to perform addition and subtraction operations in the numerical algorithm, and utilize the vector computation unit 102 and / or the matrix computation unit 103 to execute multiple AI operators invoked by the data processing device 200. Optionally, the scalar computation unit 101 can also execute some of the AI ​​operators.

[0104] In this way, the data processing device 200 can call multiple AI operators to complete the calculation of each calculation step according to the calculation process indicated by the numerical algorithm, and obtain the corresponding calculation results.

[0105] S206: The data processing device 200 feeds back the calculation results to the application 20.

[0106] In this embodiment, the data processing device 200 can feed back the calculation results to the application 20 to meet the business needs of the application 200. For example, the application 20 can provide the data processing system 10 with data such as the temperature and activity status of the volcano; the data processing device 200 can, based on a corresponding numerical algorithm, call at least one AI operator to calculate the time and scale of the volcanic eruption according to the data, and feed it back to the application 20 as the calculation result. In this way, the application 20 can perform corresponding business based on the calculation result, such as sending a volcanic eruption warning notification to the user.

[0107] In other embodiments, after generating a calculation result, the data processing device 200 can continue to execute subsequent calculations based on that result. For example, the numerical algorithm executed by the data processing device 200 may be the computational logic of a portion of the network layers in the AI ​​model. Then, after generating the calculation result, the data processing device 200 can pass the result to other network layers in the AI ​​model for further computation, so that the AI ​​model can complete the corresponding inference process. In this way, by using multiple determined AI operators to replace the multiplication and / or division modules in some network layers, the data processing device 200 can accelerate the inference process of the AI ​​model.

[0108] For example, the AI ​​model can be a generative pre-trained transformer (GPT), a bidirectional encoder representations from transformer (BERT) model, a vision transformer (ViT) model, a contrastive language-image pre-training (CLIP) model, etc., and there is no limitation on this.

[0109] Furthermore, when building AI models based on numerical algorithms, the parameter values ​​of the multiplication and division modules in the numerical algorithm usually need to be obtained by training the AI ​​model. The number of parameters in the multiplication and division modules is usually much greater than the number of parameters in the AI ​​operators. Therefore, replacing the multiplication and division modules in the numerical algorithm with AI operators can reduce the number of parameters required for model training and the number of samples required for training. This helps to reduce the overall training time of the AI ​​model while ensuring that the accuracy of the AI ​​model can reach a high level.

[0110] Furthermore, after determining multiple AI operators for replacing the multiplication and / or division modules in the numerical algorithm, the data processing device 200 can add the multiple AI operators corresponding to the numerical algorithm to the optimization library.

[0111] In specific implementation, the data processing device 200 can generate an optimization strategy based on the identifier of the numerical algorithm and a plurality of determined AI operators (or the identifiers of the plurality of AI operators), and add the optimization strategy to the optimization library. The optimization strategy may include the identifier of the numerical algorithm (or the numerical algorithm itself) and the identifier of at least one AI operator corresponding to the numerical algorithm (the at least one AI operator is used to replace the multiplication and / or division operation modules in the numerical algorithm). Alternatively, the optimization strategy may include the numerical algorithm (or the identifier of the numerical algorithm) and at least one AI operator corresponding to the numerical algorithm. In practical applications, for different numerical algorithms, the data processing device 200 can refer to the above process to determine at least one AI operator for the numerical algorithm, so as to use the determined at least one AI operator to replace the multiplication and / or division operation modules in the numerical algorithm, and generate an optimization strategy for the numerical algorithm (or the identifier of the numerical algorithm) and at least one AI operator (or the identifier of at least one AI operator) and add it to the optimization library. Thus, the optimization library may include one or more optimization strategies. In this way, when the data processing device 200 performs calculations on data from different services or data provided by different applications, after determining the numerical algorithm to be used for the data, it can determine the optimization strategy corresponding to the numerical algorithm from the optimization library, so as to use at least one AI operator (or at least one AI operator included) indicated by the optimization strategy to replace the multiplication and / or division operation modules in the numerical algorithm, thereby improving and reducing the resource overhead of data calculation and improving the efficiency of data calculation.

[0112] It is worth noting that the data processing method shown in Figure 2 is only an example. Based on this, the data processing device 200 can also complete the data calculation process based on other embodiments. The following is an example description.

[0113] In the first implementation example, the data processing method shown in Figure 2 illustrates the example of dynamically determining (and creating) AI operators to calculate data. However, in other embodiments, when the data processing device 200 performs calculations on data based on a fixed-configuration numerical algorithm, it can execute the calculation process based on a statically configured AI operator. For example, when application 20 requests data processing system 10 to perform a similar calculation process based on other data, data processing device 200 can directly call the aforementioned multiple AI operators and calculate the new data provided by application 20 based on the same numerical algorithm, without needing to determine the steps for multiple AI operators.

[0114] In the second implementation example, the data processing method shown in Figure 2 is illustrated by taking the data processing device 200 as an example to determine a numerical algorithm for the data. In other embodiments, the data processing device 200 may also determine multiple numerical algorithms to be executed sequentially for the data to be calculated. Thus, the data processing device 200 may replace the multiplication and division operation modules in each numerical algorithm with multiple AI operators in a similar manner as described above, and call multiple AI operators to perform the calculation process for the data based on the calculation steps indicated by the multiple numerical algorithms executed sequentially.

[0115] In the third implementation example, the data processing method shown in Figure 2 is illustrated by the example of the data processing device 200 replacing the multiplication or division operation module in the numerical algorithm with multiple AI operators. In other embodiments, the data processing device 200 may also replace the multiplication operation module in the numerical algorithm with only one AI operator, or replace the division operation module in the numerical algorithm with only one AI operator, etc.

[0116] It is worth noting that other reasonable combinations of steps that can be conceived by those skilled in the art based on the above description also fall within the scope of protection of this application. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to this application.

[0117] The data processing method provided by the embodiments of this application has been described above with reference to Figures 1 to 9. Next, the structure of the data processing device and computing device provided by the embodiments of this application will be described with reference to the accompanying drawings.

[0118] Referring to Figure 10, a schematic diagram of a data processing device is shown. The data processing device 1000 shown in Figure 10 is applied to a data processing system, which includes the data processing device 1000 and multiple storage devices for persistently storing data.

[0119] As shown in Figure 10, the data processing device 1000 includes:

[0120] Module 1001 is used to acquire data to be processed;

[0121] The calculation module 1002 is used to perform calculations on the data based on the calculation process indicated by the numerical algorithm to obtain the calculation results. During the calculation of the data, at least one artificial intelligence (AI) operator is invoked to participate in the calculation of the data. The AI ​​operator is used to replace the multiplication or division operation module in the numerical algorithm. The AI ​​operator runs in the vector calculation unit or matrix calculation unit. The addition and subtraction operations in the numerical algorithm are executed through the scalar calculation unit.

[0122] In one possible implementation, the computing module 1002 is used for:

[0123] Determine the numerical algorithm to be used to perform calculations on the data;

[0124] Determine whether the multiplication or division operation module is used in the numerical algorithm;

[0125] Identify at least one AI operator to replace the multiplication or division module;

[0126] Based on the computational process indicated by the numerical algorithm, at least one AI operator is invoked to participate in the computation of the data.

[0127] In one possible implementation, the computing module 1002 is used for:

[0128] The multiplication or division operation module is parsed to obtain the input size, output size, and calculation attributes of the multiplication or division operation module. The calculation attributes are used to indicate the operation type to which the multiplication or division operation module belongs.

[0129] Based on the input size, output size, and computational attributes of the multiplication or division module, determine at least one AI operator.

[0130] In one possible implementation, at least one AI operator includes a target AI operator, which is one of the at least one AI operators;

[0131] Calculation module 1002 is used for:

[0132] Construct the initial AI operator based on the input size, output size, and computational attributes of the multiplication or division operation module;

[0133] The initial AI operator is trained to obtain the target AI operator used to replace the multiplication or division operation module.

[0134] In one possible implementation, the data processing apparatus 1000 further includes:

[0135] The determination module 1003 is used to determine the vector calculation unit or matrix calculation unit where each AI operator in at least one AI operator is running, based on the input scale and calculation attributes corresponding to the multiplication operation module or the division operation module.

[0136] In one possible implementation, the computational property includes dot product or matrix multiplication.

[0137] In one possible implementation, numerical algorithms are used to construct AI models, and at least one AI operator is used to accelerate the inference process of the AI ​​models.

[0138] In one possible implementation, the data processing apparatus 1000 further includes:

[0139] Add module 1004 to add at least one AI operator for a numerical algorithm to an optimization library, the optimization library including at least one optimization strategy, each of the at least one optimization strategy including at least one AI operator corresponding to a numerical algorithm, or, each of the at least one optimization strategy is used to indicate at least one AI operator corresponding to a numerical algorithm.

[0140] Since the data processing device 1000 shown in FIG10 corresponds to the data processing device 200 in the embodiment shown in FIG2 above, the specific implementation of the data processing device 1000 shown in FIG10 and its technical effects can be found in the relevant descriptions in the embodiment shown in FIG2 above, and will not be repeated here.

[0141] Figure 11 is a schematic diagram of the hardware structure of a computing device 1100 provided in this application. The computing device 1100 can, for example, implement the data processing device 200 in the embodiment shown in Figure 3 above.

[0142] As shown in Figure 11, the computing device 1100 includes a processor 1101, a memory 1102, and a communication interface 1103. The processor 1101, memory 1102, and communication interface 1103 communicate via a bus 1104, or via wireless transmission or other means. The memory 1102 stores instructions, and the processor 1101 executes the instructions stored in the memory 1102. Furthermore, the computing device 1100 may also include a memory unit 1105, which is connected to the processor 1101, the storage medium 1102, and the communication interface 1103 via the bus 1104. The memory 1102 stores program code, and the processor 1101 can perform the following operations using the program code stored in the memory 1102:

[0143] Obtain the data to be processed;

[0144] Based on the computational process indicated by the numerical algorithm, the data is calculated to obtain the calculation result. During the calculation of the data, at least one artificial intelligence (AI) operator is invoked to participate in the calculation of the data. The AI ​​operator is used to replace the multiplication or division operation module in the numerical algorithm. The AI ​​operator runs in the vector calculation unit or matrix calculation unit. The addition and subtraction operations in the numerical algorithm are executed through the scalar calculation unit.

[0145] It should be understood that in this embodiment, the processor 1101 can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete device assemblies, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0146] The memory 1102 may include read-only memory and random access memory, and provides instructions and data to the processor 1101. The memory 1102 may also include non-volatile random access memory.

[0147] The memory 1102 can be volatile memory or non-volatile memory, or it can include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0148] The communication interface 1103 is used to communicate with other devices connected to the computing device 1100. The bus 1104 may include a data bus, as well as a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus 1104 in the figure.

[0149] It should be understood that the computing device 1100 in this application embodiment can correspond to the data processing device 200 in this application embodiment, and can be used to execute the method executed by the data processing device 200 in the method embodiment shown in FIG2 of this application embodiment. Therefore, the operation steps executed by the computing device 1100 can refer to the operation executed by the data processing device 200 in the method embodiment shown in FIG2. For the sake of brevity, it will not be described again here.

[0150] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to perform the aforementioned data processing method.

[0151] This application also provides a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in this application are generated.

[0152] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, or data center to another website, computer, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0153] The computer program product can be a software installation package. When any of the aforementioned data processing methods is required, the computer program product can be downloaded and executed on a computing device.

[0154] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0155] The terminology used in the above embodiments is for the purpose of describing specific embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the embodiments of this application, “one or more” refers to one, two, or more; the character “ / ” generally indicates that the preceding and following objects are in an “or” relationship. In the embodiments of this application, “simultaneously” means within the same time period, including situations where they are at the same moment.

[0156] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0157] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data processing method, characterized by, The method is applied to a data processing system comprising a scalar calculation unit, a vector calculation unit and a matrix calculation unit, and comprises: obtaining data to be processed; calculating the data based on a calculation process indicated by a numerical algorithm to obtain a calculation result, wherein at least one artificial intelligence (AI) operator is called to participate in the calculation of the data during the calculation of the data, the AI operator is used to replace a multiplication operation module or a division operation module in the numerical algorithm, the AI operator runs in the vector calculation unit or the matrix calculation unit, and addition and subtraction operations in the numerical algorithm are executed by the scalar calculation unit.

2. The method of claim 1, wherein, The calculation of the data based on the calculation process indicated by the numerical algorithm comprises: determining a numerical algorithm used for calculating the data; determining a multiplication operation module or a division operation module in the numerical algorithm; determining at least one AI operator for replacing the multiplication operation module or the division operation module; calling the at least one AI operator to participate in the calculation of the data based on the calculation process indicated by the numerical algorithm.

3. The method of claim 2, wherein, The determination of the at least one AI operator for replacing the multiplication operation module or the division operation module comprises: parsing the multiplication operation module or the division operation module to obtain an input size, an output size and a calculation attribute corresponding to the multiplication operation module or the division operation module, the calculation attribute being used to indicate an operation type to which the multiplication operation module or the division operation module belongs; determining the at least one AI operator according to the input size, the output size and the calculation attribute corresponding to the multiplication operation module or the division operation module.

4. The method of claim 3, wherein, The at least one AI operator comprises a target AI operator, which is one of the at least one AI operator. The determination of the at least one AI operator according to the input size, the output size and the calculation attribute corresponding to the multiplication operation module or the division operation module comprises: constructing an initial AI operator according to the input size, the output size and the calculation attribute corresponding to the multiplication operation module or the division operation module; training the initial AI operator to obtain the target AI operator for replacing the multiplication operation module or the division operation module.

5. The method according to claim 3 or 4, characterized in that, The method further comprises: determining a vector calculation unit or a matrix calculation unit in which each AI operator of the at least one AI operator runs according to the input size and the calculation attribute corresponding to the multiplication operation module or the division operation module.

6. The method according to any one of claims 3 to 5, characterized in that, The calculation attribute comprises a dot product operation or a matrix multiplication operation.

7. The method according to any one of claims 1 to 6, characterized in that, The numerical algorithm is used to construct an AI model, and the at least one AI operator is used to accelerate an inference process of the AI model.

8. The method according to any one of claims 1 to 7, characterized in that, The method further comprises: add the at least one AI operator for the numerical algorithm to an optimization library, the optimization library comprising at least one optimization strategy, each of the at least one optimization strategy comprising at least one AI operator corresponding to a numerical algorithm, or each of the at least one optimization strategy being used to indicate at least one AI operator corresponding to a numerical algorithm.

9. A data processing apparatus, characterized by, The data processing apparatus is applied to a data processing system, the data processing system comprising a scalar calculation unit, a vector calculation unit, and a matrix calculation unit, and the data processing apparatus comprises: an acquisition module, configured to acquire data to be processed; a calculation module, configured to perform calculation on the data based on a calculation process indicated by a numerical algorithm, to obtain a calculation result, wherein at least one artificial intelligence (AI) operator is called to participate in the calculation on the data in the process of performing calculation on the data, the AI operator is used to replace a multiplication operation module or a division operation module in the numerical algorithm, the AI operator runs in the vector calculation unit or the matrix calculation unit, and addition operation and subtraction operation in the numerical algorithm are performed by the scalar calculation unit.

10. The apparatus of claim 9, wherein, The calculation module is configured to: determine a numerical algorithm used for calculation on the data; determine a multiplication operation module or a division operation module in the numerical algorithm; determine at least one AI operator used for replacing the multiplication operation module or the division operation module; call the at least one AI operator to participate in the calculation on the data based on the calculation process indicated by the numerical algorithm.

11. The apparatus of claim 10, wherein, The calculation module is configured to: analyze the multiplication operation module or the division operation module to obtain an input size, an output size, and a calculation attribute corresponding to the multiplication operation module or the division operation module, the calculation attribute being used to indicate an operation type to which the multiplication operation module or the division operation module belongs; determine the at least one AI operator according to the input size, the output size, and the calculation attribute corresponding to the multiplication operation module or the division operation module.

12. The apparatus of claim 11, wherein, The at least one AI operator comprises a target AI operator, and the target AI operator is one of the at least one AI operator. The calculation module is configured to: construct an initial AI operator according to the input size, the output size, and the calculation attribute corresponding to the multiplication operation module or the division operation module; train the initial AI operator to obtain the target AI operator used for replacing the multiplication operation module or the division operation module.

13. The apparatus of claim 11 or 12, wherein, The apparatus further comprises: a determination module, configured to determine a vector calculation unit or a matrix calculation unit in which each of the at least one AI operator runs according to an input size and a calculation attribute corresponding to the multiplication operation module or the division operation module.

14. The apparatus of any one of claims 11 to 13, wherein, The calculation attribute comprises dot product operation or matrix multiplication operation.

15. The apparatus of any one of claims 9 to 14, wherein, The numerical algorithm is used to construct an AI model, and the at least one AI operator is used to accelerate an inference process of the AI model.

16. The apparatus of any one of claims 9 to 15, wherein, The apparatus further comprises: An adding module is configured to add the at least one AI operator for the numerical algorithm to an optimization library, the optimization library including at least one optimization strategy, each of the at least one optimization strategy including at least one AI operator corresponding to a numerical algorithm, or each of the at least one optimization strategy being used to indicate at least one AI operator corresponding to a numerical algorithm.

17. A data processing system, characterized by The data processing apparatus, the scalar calculation unit, the vector calculation unit, and the matrix calculation unit are included. The data processing apparatus is configured to perform the steps of the method of any one of claims 1 to 8. The scalar calculation unit is configured to perform addition and subtraction operations in the numerical algorithm. The vector calculation unit is configured to perform an artificial intelligence (AI) operator. The matrix calculation unit is configured to perform the AI operator.

18. A computing device, comprising: The processor is configured to execute instructions stored in the memory to cause the computing device to perform the steps of the method of any one of claims 1 to 8. The instructions, when executed on the computing device, cause the computing device to perform the steps of the method of any one of claims 1 to 8.

19. A computer-readable storage medium, characterized in that, The instructions, when executed on the at least one computing device, cause the at least one computing device to perform the method of any one of claims 1 to 8.

20. A computer program product comprising instructions, characterized in that, ​

Citation Information

Patent Citations

  • Neural network optimization method and device and processor

    CN112200297A

  • Model deployment method and system, electronic equipment and storage medium

    CN117892773A

  • Complex evolution recurrent neural networks

    US20190156819A1