A data processing method, device, storage medium and electronic equipment

By generating and evaluating multiple execution schemes, the computational operations of deep learning models on the server are optimized, solving the problem of low efficiency in adjusting execution schemes in existing technologies and achieving more efficient data processing.

CN116384505BActive Publication Date: 2026-02-17ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310164810.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-13
Publication Date
2026-02-17
Estimated Expiration
2043-02-13

AI Technical Summary

Technical Problem

When deep learning models perform computational tasks on servers, existing technologies struggle to effectively adjust the execution scheme, resulting in low computational efficiency.

Method used

By acquiring the device parameters of the target device, multiple candidate execution schemes are generated. The execution evaluation parameters of each scheme are monitored and evaluated, and the optimal scheme is selected to adjust the computational operations of the target device and optimize processor usage and data processing order.

Benefits of technology

It improves the computational efficiency of deep learning models on servers, reduces computation time and resource consumption, and ensures the effectiveness of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116384505B_ABST
    Figure CN116384505B_ABST
Patent Text Reader

Abstract

The specification discloses a data processing method, device, storage medium and electronic equipment. First, a target model and device parameters of a target device are obtained. Second, according to the device parameters, each candidate execution scheme adopted by the target device when performing an operation operation required by the target model is generated. Then, for each candidate execution scheme, the operation operation required when running the target model is executed through the candidate execution scheme to determine the execution evaluation parameter monitored when the target device executes the operation operation to obtain the output result of the target model as the execution evaluation parameter of the candidate execution scheme. Finally, according to the execution evaluation parameters corresponding to each candidate execution scheme, a target execution scheme is determined, and the operation operation required by the target device to execute the target model is adjusted to perform data processing through the target model according to the adjusted operation operation. The method can ensure that the target device can effectively perform data processing through the target model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present specification relates to the technical field of computer technology, and particularly relates to a data processing method and device, a storage medium and an electronic device. BACKGROUND

[0002] With the rise of deep learning, deep learning has been widely applied in image classification, natural language processing, autonomous driving, augmented reality, privacy data protection and other AI fields.

[0003] At present, deep learning models usually need to rely on servers for data processing. How to ensure that the server can effectively perform the operation tasks required by the deep learning model is a problem to be solved. SUMMARY

[0004] The present specification provides a data processing method and device, a storage medium and an electronic device to enable the server to effectively perform the operation tasks required by the deep learning model.

[0005] The present specification adopts the following technical solutions:

[0006] The present specification provides a data processing method, comprising:

[0007] Obtaining a target model and device parameters of a target device, the target device being used to perform operation operations required by the target model;

[0008] According to the device parameters, generating each candidate execution scheme adopted by the target device when performing the operation operations required by the target model;

[0009] For each candidate execution scheme, performing the operation operations required when running the target model through the candidate execution scheme to determine the execution evaluation parameters monitored when the target device obtains the output results of the target model by performing the operation operations, as the execution evaluation parameters corresponding to the candidate execution scheme;

[0010] According to the execution evaluation parameters corresponding to each candidate execution scheme, determining a target execution scheme, and adjusting the operation operations required by the target device to perform the target model through the target execution scheme, so as to perform data processing through the target model according to the adjusted operation operations.

[0011] Optionally, according to the device parameters, generating each candidate execution scheme adopted by the target device when performing the operation operations required by the target model, specifically comprising:

[0012] Determining the dimension number of the input data of the target model, and determining the maximum dimension number of the data that can be processed by a single processor in the target device;

[0013] determining the number of processors required for the target device to perform the operation required by the target model according to the dimension number of the input data of the target model and the maximum dimension number;

[0014] generating each candidate execution scheme adopted by the target device to perform the operation required by the target model according to the number of processors required for the target device to perform the operation required by the target model;

[0015] Optionally, the determination of the number of processors required for the target device to perform the operation required by the target model according to the dimension number of the input data of the target model and the maximum dimension number specifically includes:

[0016] determining the dimension ratio corresponding to the target model according to the input data and the output data of the target model, the dimension ratio being used to represent the ratio between the dimension number of the input data and the dimension number of the output data of the target model;

[0017] if it is determined that the dimension ratio exceeds the dimension ratio threshold value corresponding to the target device, splitting the input data according to the dimension ratio and the maximum dimension number, and determining the number of split data;

[0018] determining the number of processors required for the target device to perform the operation required by the target model according to the number of split data.

[0019] Optionally, the generation of each candidate execution scheme adopted by the target device to perform the operation required by the target model according to the device parameter specifically includes:

[0020] determining the dimension number of the input data of the target model, and determining the maximum dimension number of data that can be processed by a single processor in the target device;

[0021] splitting the input data according to the maximum dimension number and the dimension number of the input data, and determining the dimension number of the split data;

[0022] determining the number of split data that can be processed in parallel by a single processor in the target device according to the dimension number of the split data and the maximum dimension number;

[0023] determining the number of threads adopted by a single processor in the target device to perform parallel operation according to the number of split data that can be processed in parallel by a single processor in the target device;

[0024] generating each candidate execution scheme according to the number of threads.

[0025] Optionally, the generating of the candidate execution schemes adopted by the target device when performing the operation required by the target model comprises:

[0026] determining data having an operation sequence relationship in the operation process as related data;

[0027] adjusting the operation sequence of data other than the related data to determine the operation sequence of each data processed by the processor when the target device performs the operation required by the target model;

[0028] generating the candidate execution schemes according to the operation sequences.

[0029] Optionally, the determining of the target execution scheme comprises:

[0030] obtaining a preset basic scheme;

[0031] determining the execution evaluation parameter monitored by the target device when obtaining the output result of the target model by executing the basic scheme as the execution evaluation parameter corresponding to the basic scheme;

[0032] determining the target execution scheme according to the execution evaluation parameter corresponding to the basic scheme and the execution evaluation parameter corresponding to each candidate execution scheme.

[0033] Optionally, the method further comprises:

[0034] receiving a service request of a user;

[0035] inputting the service data corresponding to the service request into the target model according to the service request, so as to execute the operation required by the target model to process the service data through the target execution scheme, and obtain a service result.

[0036] The present specification provides a data processing apparatus, comprising:

[0037] an obtaining module configured to obtain a target model and device parameters of a target device, the target device being configured to perform an operation required by the target model;

[0038] a generating module configured to generate, according to the device parameters, candidate execution schemes adopted by the target device when performing the operation required by the target model;

[0039] determining, for each candidate execution scheme, an execution evaluation parameter corresponding to the candidate execution scheme by executing the operation operation required for running the target model through the candidate execution scheme, as an execution evaluation parameter monitored when the target device executes the output result of the target model through the operation operation;

[0040] adjusting, according to the execution evaluation parameters corresponding to the candidate execution schemes, a target execution scheme, and adjusting the operation operation required for the target device to execute the target model through the target execution scheme, so as to execute data processing through the target model according to the adjusted operation operation.

[0041] The specification provides a computer readable storage medium, the storage medium stores a computer program, the computer program is executed by a processor to realize the method of data processing.

[0042] The specification provides an electronic device, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor executes the program to realize the method of data processing.

[0043] The above at least one technical scheme adopted by the specification can achieve the following beneficial effects:

[0044] In the method of data processing provided by the specification, first, the target model and the device parameters of the target device are obtained, and the target device is used to execute the operation operation required for the target model. Secondly, according to the device parameters, each candidate execution scheme adopted by the target device when executing the operation operation required for the target model is generated. Then, for each candidate execution scheme, the operation operation required for running the target model is executed through the candidate execution scheme, so as to determine the execution evaluation parameter monitored when the target device executes the output result of the target model through the operation operation as the execution evaluation parameter corresponding to the candidate execution scheme. Finally, according to the execution evaluation parameters corresponding to the candidate execution schemes, a target execution scheme is determined, and the operation operation required for the target device to execute the target model is adjusted through the target execution scheme, so as to execute data processing through the target model according to the adjusted operation operation.

[0045] As can be seen from the above method, the method can generate each candidate execution scheme adopted by the target device when executing the operation operation required for the target model according to the device parameters. Secondly, the execution evaluation parameters corresponding to the candidate execution schemes are determined through the candidate execution schemes. Finally, the target execution scheme is determined according to the execution evaluation parameters corresponding to the candidate execution schemes. Thus, it is ensured that the target device can effectively execute data processing through the target model. BRIEF DESCRIPTION OF DRAWINGS

[0046] The accompanying drawings, which are included to provide a further understanding of the present description and constitute a part of the present description, illustrate the preferred embodiments of the present description and serve to explain the present description together with the specification. The above and other objects, features and advantages of the present description will become more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:

[0047] In the drawings:

[0048] Figure 1 A flowchart of a data processing method provided by an embodiment of the present description is shown in the figure.

[0049] Figure 2 A schematic diagram of determining a target execution scheme provided by an embodiment of the present description is shown in the figure.

[0050] Figure 3 A structural schematic diagram of a data processing device provided by an embodiment of the present description is shown in the figure.

[0051] Figure 4 A structural schematic diagram of an electronic device provided by an embodiment of the present description is shown in the figure. DETAILED DESCRIPTION

[0052] In order to make the objects, technical solutions and advantages of the present description clearer, the technical solutions of the present description will be described below in conjunction with the specific embodiments of the present description and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present description, rather than all the embodiments. Based on the embodiments in the present description, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present description.

[0053] The technical solutions provided by the embodiments of the present description will be described in detail below with reference to the drawings.

[0054] Figure 1 A flowchart of a data processing method provided by an embodiment of the present description is shown in the figure, which specifically includes the following steps:

[0055] S100: Obtain a target model and device parameters of a target device, wherein the target device is used to perform an operation operation required by the target model.

[0056] In the embodiments of the present description, the execution subject of the data processing method can be a target device, which can be a server, a desktop computer or other electronic devices. For ease of description, the data processing method provided by the present description will be described below with the target device as the execution subject.

[0057] In the embodiments of the present specification, the target device can obtain a target model and device parameters of the target device, where the target device is used to perform operation operations required by the target model. The target model mentioned herein can refer to various deep learning models used to perform services, or can refer to network structures inside various deep learning models, for example, batch normalization (BN), layer normalization (LN), etc. The present specification does not limit the deep learning model and the network structure inside the deep learning model.

[0058] The device parameters of the target device mentioned herein can refer to hardware parameters such as parameters of CPU cores, number of CPU cores, parameters of GPU cores, number of GPU cores, parameters of registers, number of registers, etc.

[0059] Of course, the device parameters of the target device mentioned herein can also refer to the distribution of various hardware in the target device, the power consumption of various hardware, etc.

[0060] Specifically, the device parameter configuration table of the target device can be pre-configured in the target device, and the device parameter configuration table can record the device parameters corresponding to target devices of different models. The target device can determine the device parameters corresponding to the target device from the pre-configured device parameter configuration table through the model of the target device.

[0061] Of course, the manufacturer corresponding to the target device can provide a query interface for querying the device parameters corresponding to the target device, so that the target device can call the query interface of the pre-configured device parameter configuration table to obtain the device parameters corresponding to the target device. For example, the manufacturer corresponding to the target device can provide an API interface for querying the device parameters corresponding to the target device, so that the device parameters corresponding to the target device can be obtained through the API interface provided by the manufacturer corresponding to the target device.

[0062] S102: According to the device parameters, generate each candidate execution scheme adopted by the target device when performing operation operations required by the target model.

[0063] In actual applications, the target model usually needs to rely on the target device for data processing. In order to improve the efficiency of training the target model or applying the target model, it is usually necessary to adjust the execution scheme applied by the target device when processing data to improve the operation efficiency of the target device when performing operation operations required by the target model. However, the above execution scheme usually needs to be manually written by experts based on the algorithm of the target model, which is time-consuming and low in efficiency.

[0064] Since the execution scheme manually written by an expert cannot be adjusted for the operation process on different target devices and the operation required by different target models, the efficiency of determining the execution scheme is low.

[0065] Therefore, the target device can determine the target execution scheme by generating each candidate execution scheme and determining the execution evaluation parameter after executing each candidate execution scheme.

[0066] In the embodiments of the present disclosure, the target device can generate each candidate execution scheme used when the target device performs the operation required by the target model according to the device parameter. Since the actual form of the target model is code deployed in the target device, the candidate execution scheme mentioned here can mean that the target device executes the target model in different ways, that is, the code is run in different ways by the target device.

[0067] The candidate execution scheme includes multiple influence factors of the execution evaluation parameter monitored when the output result of the target model is influenced. For example, the number of processors used when the target device performs the operation required by the target model, the number of data that can be processed in parallel by a single processor when the target device performs the operation required by the target model, the operation sequence of each data when the target device performs the operation required by the target model, and the like. The target device can generate each candidate execution scheme used when the target device performs the operation required by the target model according to at least one of the above influence factors.

[0068] In actual application, when the target model is processed, usually only one processor is started to perform the operation required by the target model for data processing. However, this method requires a long operation time, which will cause the training time of the target model to be long. Therefore, the target device can split the input data into multiple data of the same dimension number, and perform operation on the multiple data of the same dimension number by multiple processors to obtain multiple intermediate operation results, and then determine the output data according to the multiple intermediate operation results, so as to improve the efficiency of processing data of the target model by starting multiple processors at the same time.

[0069] In the embodiments of the present disclosure, the target device can determine the dimension number of the input data of the target model, and determine the maximum dimension number of the data that can be processed by a single processor in the target device.

[0070] Secondly, the target device can determine the number of processors required when the target device performs the operation required by the target model according to the dimension number of the input data of the target model and the maximum dimension number.

[0071] For example, the dimension number of the input data of the target model is one thousand, and the maximum dimension number of the data that can be processed by a single processor is one hundred, then the number of processors required when the target device performs the operation required by the target model is at least ten. Of course, the number of processors required when the target device performs the operation required by the target model can be determined according to at least one of the above-mentioned influencing factors.

[0072] Finally, the target device can generate each candidate execution scheme adopted by the target device when performing the operation required by the target model according to the number of processors required when the target device performs the operation required by the target model.

[0073] Further, the target device can determine the dimension ratio corresponding to the target model according to the input data and the output data of the target model, where the dimension ratio is used to represent the ratio between the dimension number of the input data of the target model and the dimension number of the output data.

[0074] If it is determined that the dimension ratio exceeds the dimension ratio threshold value corresponding to the target device, then the input data is split according to the dimension ratio and the maximum dimension number, and the number of split data is determined.

[0075] Then, the target device can determine the number of processors required when the target device performs the operation required by the target model according to the number of split data.

[0076] Specifically, the target device can determine various intermediate operation results, and the dimension number of the intermediate operation result in each candidate execution scheme can be different, and there is a dimension number of the intermediate operation result corresponding to one candidate execution scheme.

[0077] Secondly, for each intermediate operation result, the target device can determine the dimension ratio corresponding to the intermediate operation result according to the ratio between the dimension of the input data of the target model and the dimension number of the intermediate operation result.

[0078] Then, if the dimension ratio of the intermediate operation result is less than the dimension ratio threshold value corresponding to the target device, the target device can split the input data according to the dimension number of the intermediate operation result, and determine the number of split data.

[0079] Finally, the target device can determine the number of processors required when the target device performs the operation required by the target model according to the number of split data.

[0080] For example, the input data is one-thousand-dimensional data, the output data is one-dimensional data, if the dimension number of the intermediate operation result is determined to be ten, the maximum dimension number that can be processed by a single processor in the target device is one hundred, and the dimension ratio corresponding to the intermediate operation result is not greater than the dimension ratio threshold corresponding to the target device, the target device determines the number of enabled processors (one to ten) according to the dimension number (ten) of the intermediate operation result and the dimension number (one thousand) of the input data. That is, by the number of enabled processors, the one-thousand-dimensional input dimension is determined to be ten-dimensional intermediate operation result, and the one-dimensional output dimension is determined according to the ten-dimensional intermediate operation result.

[0081] Here, the obtained intermediate operation result can be stored in a global memory, and all processors can obtain data from the global memory. The intermediate operation result can also be stored in a shared memory. For example, the target device has 16 processors, which can form 4 computing groups, and the shared memory inside each computing group can share data.

[0082] In actual applications, different intermediate operation results correspond to different dimension numbers of the split data, and the operation amount required for processing different split data is not the same. Therefore, the target device needs to determine the number of threads used by a single processor in the target device to perform parallel operation according to the dimension number of the split data.

[0083] In the embodiments of the present specification, the target device can determine the dimension number of the input data of the target model, and determine the maximum dimension number of data that can be processed by a single processor in the target device.

[0084] Secondly, the target device can split the input data according to the maximum dimension number and the dimension number of the input data, and determine the dimension number of the split data.

[0085] Then, the target device can determine the number of split data that can be processed in parallel by a single processor in the target device according to the dimension number of the split data and the maximum dimension number.

[0086] Then, the target device can determine the number of threads used by a single processor in the target device to perform parallel operation according to the determined number of split data that can be processed in parallel by a single processor in the target device.

[0087] Finally, the target device can generate each candidate execution scheme according to the number of threads.

[0088] For example, the input data is one thousand dimensional data, the output data is one dimensional data, if the dimension number of the intermediate operation result is determined to be one hundred, the maximum dimension number that can be processed by a processor in the target device in a single time is one hundred, then the number of data that can be processed in parallel by a single processor in the target device is determined to be ten. Thus, the number of threads used by a single processor in the target device to perform parallel operation is determined to be ten. Of course, the dimension number of different split data is different, and the number of threads used by a single processor to perform parallel operation is also different.

[0089] Further, the intermediate operation result obtained by the thread used by the processor to perform parallel operation needs to be stored in the register, but the memory capacity of the register is limited. If the stored intermediate operation result is too much, the stored data exceeds the content capacity of the register, which will cause the operation time of the processor to perform the operation required by the target model to increase. Based on this, the target device cannot directly determine the number of threads used by the processor to perform parallel operation according to the device parameters, and needs to determine the number of threads used by the processor to perform parallel operation in each candidate execution scheme used by the target device to perform the operation required by the target model, so as to select the target execution scheme according to the operation time corresponding to each candidate execution scheme in subsequent execution.

[0090] In actual application, in the process of the target device executing the target model, there is an operation sequence relationship between each data, for example, data A needs to be operated first, and then data B is operated based on the operation result of data A. However, if there are two data without operation sequence relationship, the target device adjusts the operation order of the two data, which can reduce the operation time of the target device to perform the operation required by the target model.

[0091] In the embodiments of the present specification, the target device can determine each data having an operation sequence relationship in the operation process as related data.

[0092] Secondly, the target device can adjust the operation order of other data except the related data, and determine each operation order of the data processed by the processor when the target device performs the operation required by the target model.

[0093] Finally, the target device can generate each candidate execution scheme according to each operation order.

[0094] In actual application, in the process of the target device executing the target model, there is an operation sequence relationship between each data. However, some target models may calculate the two parts separately, which will cause repeated access. If each data having an operation sequence relationship is put into the same processor for operation, the number of memory access can be reduced, and the operation time can be reduced.

[0095] In the embodiments of the present specification, the target device can determine each data having an operation sequence in the operation process as the related data.

[0096] Secondly, the target device can put the related data into the same processor for operation.

[0097] Specifically, the target device can put the related data into the same processor, determine the operation result of the first related data, and store the operation result of the first related data into the register of the processor for the operation of the next related data, determine the operation result of the next related data, until the output result is calculated.

[0098] For example, the present specification takes layer normalization as an example to describe the above method in detail.

[0099] The forward propagation formula of layer normalization is as follows.

[0100]

[0101] In the above formula, E[x] can be used to represent the average. Var[x] can be used to represent the variance, which is the average of the square value of the difference between each sample value and the average of all sample values. That is, there is an operation sequence relationship between Var[x] and E[x], which needs to operate the code corresponding to E[x] first, and then operate the code corresponding to Var[x]. The target device can put the code corresponding to Var[x] and the code corresponding to E[x] into the same processor for operation, thereby reducing the number of memory access and reducing the operation time.

[0102] The backward propagation formula of layer normalization is as follows.

[0103]

[0104]

[0105]

[0106] In the above formula, x i can be used to represent the data of the i-th input. μ can be used to represent the average. δ 2 can be used to represent the variance, which is the average of the square value of the difference between each sample value and the average of all sample values. x can be used to represent the gradient of the input. That is, there is an operation sequence relationship between μ, δ 2 and x, which needs to operate the code corresponding to μ first, then operate the code corresponding to δ 2 , and finally operate the code corresponding to x. The target device can put the code corresponding to μ, the code corresponding to δ 2Corresponding code and x corresponding code are put into the same processor for operation, thereby reducing the number of memory access and reducing the operation time.

[0107] In actual application, in the process that the target device executes the target model, there is an operation sequence relationship among the data. However, if there are two data without operation sequence relationship, the target device performs parallel operation on the two data, which can reduce the operation time when the target device performs operation operation required by the target model.

[0108] In the embodiments of the present specification, the target device can determine each data with operation sequence relationship in the operation process as related data.

[0109] Secondly, the target device can perform parallel operation on each data without operation sequence relationship in the operation process.

[0110] It should be noted that the target device can select one or more of the above candidate execution schemes to obtain a target execution scheme. For example, the target execution scheme can simultaneously include at least one of the number of processors used by the target device when performing operation operation required by the target model, the number of data parallel operated by a single processor of the target device when performing operation operation required by the target model, and the operation sequence of the processor processing each data when the target device performs operation operation required by the target model.

[0111] Moreover, different candidate execution schemes can not be completely the same. For example, the number of processors used by the target device when performing operation operation required by the target model in the candidate execution scheme A and the candidate execution scheme B is the same, the number of data parallel operated by a single processor of the target device when performing operation operation required by the target model is the same, and the operation sequence of the processor processing each data when the target device performs operation operation required by the target model is different.

[0112] S104: For each candidate execution scheme, the operation operation required when running the target model is performed through the candidate execution scheme, so as to determine the execution evaluation parameter monitored by the target device when the target device obtains the output result of the target model through the operation operation as the execution evaluation parameter corresponding to the candidate execution scheme.

[0113] In the embodiments of the present specification, the target device can perform operation operation required when running the target model through each candidate execution scheme, so as to determine the execution evaluation parameter monitored by the target device when the target device obtains the output result of the target model through the operation operation as the execution evaluation parameter corresponding to the candidate execution scheme. The execution evaluation parameter mentioned here can be operation time, operation resource consumption and the like.

[0114] The output result mentioned herein can refer to an output result of the test data input into the target model by the target device, obtained in the process of determining the execution evaluation parameter corresponding to each candidate execution scheme through each candidate execution scheme.

[0115] S106: Determine the target execution scheme according to the execution evaluation parameter corresponding to each candidate execution scheme, and adjust the operation operation required by the target device for executing the target model through the target execution scheme, so as to execute data processing through the target model according to the adjusted operation operation.

[0116] In the embodiments of the present specification, the target device can determine the target execution scheme according to the execution evaluation parameter corresponding to each candidate execution scheme, and adjust the operation operation required by the target device for executing the target model through the target execution scheme, so as to execute data processing through the target model according to the adjusted operation operation.

[0117] Specifically, the target device can determine the target execution scheme according to the operation time length, operation resource consumption and other execution evaluation parameters of each candidate execution scheme.

[0118] Of course, the target device can determine the comprehensive score according to the operation time length, operation resource consumption and other execution evaluation parameters of the candidate execution scheme. The target execution scheme is determined according to the comprehensive score of each candidate execution scheme. The comprehensive score mentioned herein can refer to the score determined according to the execution evaluation parameter. For example, the shorter the operation time length, the higher the score. For another example, the less the operation resource consumption, the higher the score. The formula corresponding to the comprehensive score can be determined according to actual needs. The present specification does not limit the formula corresponding to the comprehensive score.

[0119] In actual application, in order to ensure that the user can obtain the execution scheme in a short time. The target device can pre-set a basic execution scheme to avoid that the target execution scheme that can execute the target model on the target device cannot be determined in a short time.

[0120] In the embodiments of the present specification, the target device can obtain a preset basic scheme. The basic scheme mentioned herein can be obtained through expert experience.

[0121] Then, the target device can determine the execution evaluation parameter monitored by the target device when the target device obtains the output result of the target model through the execution of the basic scheme as the execution evaluation parameter corresponding to the basic scheme.

[0122] Finally, the target device can determine the target execution scheme according to the execution evaluation parameter corresponding to the basic scheme and the execution evaluation parameter corresponding to each candidate execution scheme.

[0123] Specifically, within a set time, the target device can perform the operation operation required by the target model through each candidate execution scheme and the basic scheme, determine the execution evaluation parameter corresponding to each candidate execution scheme and the execution evaluation parameter corresponding to the basic scheme. The target device can select the execution scheme with the shortest operation time or the highest comprehensive score as the target execution scheme.

[0124] In actual application, since each execution scheme is determined based on the experience rule to determine a single device parameter, the influence between different device parameters is not considered, and whether the determined device parameter is optimal cannot be determined. Therefore, the determined device parameter can not be the optimal parameter value. Based on this, the target device can determine the initial value of the device parameter based on the operation process and the device parameter, and then take the initial value as a reference to continuously adjust the value of the device parameter until the comprehensive score of the determined execution evaluation parameter is the highest, so as to obtain the target execution scheme.

[0125] In the embodiment of the present specification, the target device can determine the candidate execution scheme by taking the execution evaluation parameter monitored by the target device when the target device executes the operation operation to obtain the output result of the target model as the adjustment target.

[0126] It should be noted that the method for determining the candidate execution scheme in the present specification can be a random search algorithm.

[0127] Of course, the target device can adjust the value of each device parameter separately until the comprehensive score of the determined execution evaluation parameter is the highest, so as to obtain the target execution scheme.

[0128] In the embodiment of the present specification, after the target device adjusts the operation operation required by the target model to execute the target model through the target execution scheme, the target device can receive a service request of a user, input the service data corresponding to the service request into the target model according to the service request, and execute the operation operation required by the target model to process the service data through the target execution scheme to obtain a service result.

[0129] In the embodiment of the present specification, the specific process of the target device to determine the target execution scheme is as shown in Figure 2

[0130] Figure 2 A schematic diagram for determining the target execution scheme provided by the embodiment of the present specification.

[0131] In Figure 2 , the target device can generate each candidate execution scheme used by the target device to execute the operation operation required by the target model according to the device parameter. Then, the target device can determine the execution evaluation parameter corresponding to each candidate execution scheme. According to the execution evaluation parameter corresponding to each candidate execution scheme, the target execution scheme is determined. ​

[0132] As can be seen from the above method, the method can generate each candidate execution scheme adopted by the target device when performing the operation operation required by the target model according to the device parameters. Secondly, the execution evaluation parameters corresponding to each candidate execution scheme are determined through each candidate execution scheme. Finally, the target execution scheme is determined according to the execution evaluation parameters corresponding to each candidate execution scheme. Thus, it is ensured that the target device can effectively perform data processing through the target model.

[0133] The above is a data processing method provided by an embodiment of the present specification. Based on the same idea, the present specification also provides a corresponding device, a storage medium and an electronic device.

[0134] Figure 3 The structure diagram of a data processing device provided by an embodiment of the present specification is shown in the figure. The device comprises:

[0135] The acquisition module 300 is configured to acquire a target model and device parameters of a target device, wherein the target device is configured to execute the target model.

[0136] The generation module 302 is configured to generate each candidate execution scheme adopted by the target device when executing the target model according to the device parameters.

[0137] The determination module 304 is configured to, for each candidate execution scheme, execute the operation operation required by the target model through the candidate execution scheme to determine the execution evaluation parameters monitored by the target device when executing the operation operation to obtain the output result of the target model as the execution evaluation parameters corresponding to the candidate execution scheme.

[0138] The adjustment module 306 is configured to determine a target execution scheme according to the execution evaluation parameters corresponding to each candidate execution scheme, and adjust the operation operation required by the target device to execute the target model through the target execution scheme, so as to execute data processing through the target model according to the adjusted operation operation.

[0139] Optionally, the generation module 302 is specifically configured to determine the dimension number of the input data of the target model, and determine the maximum dimension number of the data that can be processed by a single processor in the target device, determine the number of processors required by the target device when executing the operation operation required by the target model according to the dimension number of the input data of the target model and the maximum dimension number, and generate each candidate execution scheme adopted by the target device when executing the operation operation required by the target model according to the number of processors required by the target device when executing the operation operation required by the target model.

[0140] Optionally, the generating module 302 is specifically configured to determine a dimension ratio corresponding to the target model according to the input data and the output data of the target model, the dimension ratio being used to represent a ratio between a dimension number of the input data and a dimension number of the output data of the target model, if it is determined that the dimension ratio exceeds a dimension ratio threshold corresponding to the target device, split the input data according to the dimension ratio and the maximum dimension number, and determine a number of split data, and determine a number of processors required by the target device when performing an operation required by the target model according to the number of split data.

[0141] Optionally, the generating module 302 is specifically configured to determine a dimension number of the input data of the target model, and determine a maximum dimension number of data that can be processed by a single processor in the target device, split the input data according to the maximum dimension number and the dimension number of the input data, and determine a dimension number of split data, determine a number of split data that can be processed in parallel by a single processor in the target device according to the dimension number of split data and the maximum dimension number, determine a number of threads used by a single processor in the target device for performing parallel operation according to the number of split data that can be processed in parallel by a single processor in the target device, and generate each candidate execution scheme according to the number of threads.

[0142] Optionally, the generating module 302 is specifically configured to determine each data having an operation sequence relationship in an operation process as related data, adjust an operation sequence of other data except the related data, determine each operation sequence of data processed by a processor when the target device performs an operation required by the target model, and generate each candidate execution scheme according to the operation sequence.

[0143] Optionally, the adjusting module 306 is specifically configured to obtain a preset basic scheme, determine an execution evaluation parameter monitored when the target device obtains an output result of the target model by executing the basic scheme as an execution evaluation parameter corresponding to the basic scheme, and determine a target execution scheme according to the execution evaluation parameter corresponding to the basic scheme and the execution evaluation parameter corresponding to each candidate execution scheme.

[0144] Optionally, the adjusting module 306 is specifically configured to receive a service request of a user, input service data corresponding to the service request into the target model to perform an operation required by the target model for processing the service data through the target execution scheme, and obtain a service result.

[0145] The specification also provides a computer readable storage medium storing a computer program, the computer program being executable by a processor to perform the above Figure 1 The method of data processing is provided.

[0146] The specification also provides a computer readable storage medium storing a computer program, the computer program being executable by a processor to perform the above Figure 4 The structural diagram of the electronic device is shown. As shown in the figure Figure 4 At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and of course can also include other hardware required by the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs to implement the above Figure 1 The method of data processing is provided.

[0147] Of course, in addition to the software implementation, the specification does not exclude other implementation manners, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or a logic device.

[0148] It should be noted that all the actions of obtaining signals, information or data in this application are carried out in accordance with the corresponding data protection regulations and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.

[0149] In the 1990s, it was quite obvious to distinguish whether an improvement in a technology was in hardware (e.g., improvement in circuit structures of diodes, transistors, switches, etc.) or in software (improvement in method flow). However, as technology has evolved, many improvements in method flow today can be considered as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structures by programming the improved method flow into hardware circuits. Therefore, it cannot be said that an improvement in a method flow cannot be implemented by hardware entity modules. For example, a programmable logic device (PLD) such as a field programmable gate array (FPGA) is an integrated circuit whose logic function is determined by user programming of the device. A digital system is "integrated" on a piece of PLD by the designer programming it by himself, without having to ask a chip manufacturer to design and manufacture a special integrated circuit chip. Moreover, instead of manually fabricating an integrated circuit chip, this programming is now mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing a program, and the original code before compilation also has to be written in a specific programming language, which is called a hardware description language (HDL), and there are many such languages, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., and the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should be aware that, as long as the method flow is logically programmed in the above-mentioned hardware description languages and programmed into an integrated circuit, a hardware circuit implementing the logical method flow can be easily obtained.

[0150] The controller can be implemented in any suitable way, e.g. the controller can take the form of a microprocessor or processor and a computer readable medium storing computer readable program code, e.g. software or firmware, executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller and an embedded microcontroller, examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91 SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to being implemented in pure computer readable program code form, the controller can perfectly well be implemented by means of logic programmed into logic gates, switches, application specific integrated circuits, programmable logic controllers and embedded microcontrollers, etc. to perform the same functions. The controller can thus be considered as a hardware component, and the means comprised therein for performing various functions can be considered as structures within the hardware component. Alternatively, or even, the means for performing various functions can be considered as both a software module implementing a method and a structure within a hardware component.

[0151] The systems, apparatuses, modules or units illustrated by the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0152] For the sake of description, the above apparatuses are described in functional division and are described respectively as various units. Of course, the functions of the units can be implemented in the same or multiple software and / or hardware in implementing the present specification.

[0153] Those skilled in the art will understand that the embodiments of the present specification can be provided as a method, a system or a computer program product. Therefore, the present specification can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0154] The specification is presented with reference to flow diagrams and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing element or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Although the flow diagrams and / or block diagrams can present a method, apparatus or computer program product according to embodiments of the specification, it can be understood that each block in the flow diagrams and / or block diagrams and combinations of blocks in the flow diagrams and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing element or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flow diagrams and / or block diagrams block or blocks.

[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Although the flow diagrams and / or block diagrams can present a method, apparatus or computer program product according to embodiments of the specification, it can be understood that each block in the flow diagrams and / or block diagrams and combinations of blocks in the flow diagrams and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing element or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flow diagrams and / or block diagrams block or blocks.

[0156] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Although the flow diagrams and / or block diagrams can present a method, apparatus or computer program product according to embodiments of the specification, it can be understood that each block in the flow diagrams and / or block diagrams and combinations of blocks in the flow diagrams and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing element or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. ​ These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flow diagrams and / or block diagrams block or blocks.

[0157] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0158] The memory can include non-persistent memory, random access memory (RAM), and / or non-volatile memory, etc. in the form of a computer-readable medium, such as read only memory (ROM) or flash memory. The memory is an example of computer-readable media.

[0159] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0160] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but also other elements not explicitly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0161] Those skilled in the art will appreciate that embodiments of the present specification can be provided as methods, systems or computer program products. Therefore, the present specification can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer-usable program code.

[0162] The present specification can be described in the general context of computer-executable instructions, such as program modules, executed by computers. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.

[0163] The various embodiments described in this specification are described using a numbering of embodiments approach: these are each individually integrated contributions pertaining to different but related aspects of the description. Each of the various embodiments can stand on its own, and each can be combined with the subject matter of other embodiments to produce further embodiments. Where appropriate, therefore, the contents of the specification can be regarded as being incorporated by reference, including the description, drawings, claims, abstract and the like.

[0164] The above only describes the embodiments of the specification and is not intended to limit the specification. The specification can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the specification shall be included in the scope of claims of the specification.

Claims

1.A method for data processing, comprising: obtaining a target model and device parameters of a target device, the target device being configured to perform operation operations required by the target model; generating, according to the device parameters, each candidate execution scheme adopted by the target device when performing the operation operations required by the target model; for each candidate execution scheme, performing the operation operations required when running the target model through the candidate execution scheme to determine an execution evaluation parameter monitored when the target device performs the operation operations to obtain an output result of the target model through the candidate execution scheme as an execution evaluation parameter corresponding to the candidate execution scheme; determining a target execution scheme according to the execution evaluation parameters corresponding to each candidate execution scheme, and adjusting the operation operations required by the target device to perform the target model through the target execution scheme, so as to perform data processing through the target model according to the adjusted operation operations. 2.The method of claim 1, wherein the generating, according to the device parameters, each candidate execution scheme adopted by the target device when performing the operation operations required by the target model comprises: determining a dimension number of input data of the target model, and determining a maximum dimension number of data that can be processed by a single processor in the target device; determining a number of processors required by the target device when performing the operation operations required by the target model according to the dimension number of the input data of the target model and the maximum dimension number; and generating, according to the number of processors required by the target device when performing the operation operations required by the target model, each candidate execution scheme adopted by the target device when performing the operation operations required by the target model. 3.The method of claim 2, wherein the determining a number of processors required by the target device when performing the operation operations required by the target model according to the dimension number of the input data of the target model and the maximum dimension number comprises: determining a dimension ratio corresponding to the target model according to the input data and output data of the target model, the dimension ratio being used to represent a ratio between the dimension number of the input data and a dimension number of the output data of the target model; if it is determined that the dimension ratio exceeds a dimension ratio threshold corresponding to the target device, splitting the input data according to the dimension ratio and the maximum dimension number, and determining a number of split data; and determining the number of processors required by the target device when performing the operation operations required by the target model according to the number of split data. 4.The method of claim 1, wherein the generating, according to the device parameters, each candidate execution scheme adopted by the target device when performing the operation operations required by the target model comprises: determining a dimension number of input data of the target model, and determining a maximum dimension number of data that can be processed by a single processor in the target device; splitting the input data according to the maximum dimension number and the dimension number of the input data, and determining a dimension number of split data; and determine, according to the number of dimensions of the split data and the maximum number of dimensions, a number of data that can be processed in parallel by a single processor in the target device; determine, according to the determined number of data that can be processed in parallel by a single processor in the target device, a number of threads used by the single processor in the target device for performing parallel operation operations; generate each candidate execution scheme according to the number of threads. 5.The method of claim 1, wherein the generating each candidate execution scheme according to the device parameters, specifically comprises: determining each data having an operation sequence relationship in an operation process as related data; adjusting an operation sequence of each data other than the related data to determine each operation sequence of the processor processing each data when the target device performs the operation operation required by the target model; and generating each candidate execution scheme according to the each operation sequence. 6.The method of claim 1, wherein the determining a target execution scheme according to the execution evaluation parameters corresponding to each candidate execution scheme, specifically comprises: obtaining a preset basic scheme; determining an execution evaluation parameter monitored when the target device obtains an output result of the target model by executing the basic scheme as an execution evaluation parameter corresponding to the basic scheme; and determining a target execution scheme according to the execution evaluation parameter corresponding to the basic scheme and the execution evaluation parameters corresponding to each candidate execution scheme. 7.The method of claim 1, further comprising: receiving a service request of a user; and inputting service data corresponding to the service request into the target model to execute an operation operation required by the target model processing the service data through the target execution scheme to obtain a service result. 8.A data processing apparatus, comprising: an obtaining module, configured to obtain a target model and device parameters of a target device, the target device being used to perform an operation operation required by the target model; a generating module, configured to generate each candidate execution scheme used by the target device when performing the operation operation required by the target model according to the device parameters; a determining module, configured to, for each candidate execution scheme, execute the operation operation required when running the target model through the candidate execution scheme to determine an execution evaluation parameter monitored when the target device obtains an output result of the target model by executing the operation operation as an execution evaluation parameter corresponding to the candidate execution scheme; and an adjusting module, configured to determine a target execution scheme according to the execution evaluation parameters corresponding to each candidate execution scheme, and adjust the operation operation required by the target device performing the target model through the target execution scheme to perform data processing through the target model according to the adjusted operation operation. 9.A computer readable storage medium, the storage medium storing a computer program, the computer program being executed by a processor to implement the method of any one of claims 1-7. ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ 10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and loadable on the processor, the processor implementing the method of any of claims 1-7 when executing the program.

Citation Information

Patent Citations

  • Operation processing apparatus, reproduction apparatus, operation processing method, and program

    JP2018159794A

  • KR20210052404A