Operator scheduling method and device, electronic equipment, storage medium and program product

By combining operator characteristics and device status, input into the operator scheduling model to determine the operator scheduling information, the problem of low operator scheduling efficiency in the prior art is solved, and more efficient calculation and resource utilization are achieved.

CN119621269APending Publication Date: 2025-03-14HUNAN KAIHONG ZHIGU DIGITAL IND DEV CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411674377.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The existing operator scheduling methods are too simple to effectively schedule operators in complex neural network models, resulting in inefficient computing efficiency.

Method used

By determining the operator characteristic vector and the device state characteristic vector of the operator to be scheduled and inputting them into the operator scheduling model, the operator scheduling information is determined to achieve a reasonable scheduling method.

Benefits of technology

It improves the computing efficiency of the operator, makes reasonable use of equipment resources, and can cope with dynamic changes in the performance of different operators and processors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621269A_ABST
    Figure CN119621269A_ABST
Patent Text Reader

Abstract

The invention discloses an operator scheduling method and device, electronic equipment, a storage medium and a program product, and particularly relates to the technical field of computers. According to the specific implementation scheme, the method comprises the steps of determining a first operator characteristic vector of an operator to be scheduled; determining a first state characteristic vector of the first equipment; preprocessing the first operator characteristic vector and the first state characteristic vector to obtain target data; and inputting the target data into an operator scheduling model, and determining scheduling information of the to-be-scheduled operator, the scheduling information indicating a scheduling mode of the to-be-scheduled operator under each processor. In the operator scheduling process, the operator characteristics and the state characteristics of the first device are comprehensively considered, dynamic changes of different operators and processor performance can be coped with, reasonable utilization of the device when the operators run on the device is achieved, and the calculation efficiency of the operators is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an operator scheduling method, device, electronic device, storage medium and program product. Background Art

[0002] With the rapid development of deep learning, neural network models are becoming more and more complex, and the amount of computation is becoming larger and larger. In order to efficiently run these models on resource-constrained devices, a scientific and reasonable operator scheduling strategy becomes particularly critical. In order to improve computing efficiency, different operators need to be scheduled to different processors to perform calculations. Efficient operator scheduling can not only significantly improve the inference speed of the model, but also maximize the use of limited computing and memory resources, which is very important for real-time applications and large-scale data processing.

[0003] At present, the more common operator scheduling methods include static scheduling, dynamic scheduling, priority-based scheduling, dependency graph-based scheduling, etc. However, these methods are too simple, resulting in deficiencies in operator scheduling. Summary of the invention

[0004] The present invention provides an operator scheduling method, device, electronic device, storage medium and program product, which realize the scheduling of operators under various processors by combining operator characteristics and device status.

[0005] According to one aspect of the present invention, there is provided an operator scheduling method, comprising:

[0006] Determine a first operator characteristic vector of the operator to be scheduled, where the first operator characteristic vector is a vector formed by operator characteristics of the operator to be scheduled;

[0007] Determine a first state characteristic vector of a first device, where the first state characteristic vector is a vector formed by state characteristics, where the state characteristics represent states of multiple processors in the first device, and the first device is a device that will run the operator to be scheduled;

[0008] Preprocessing the first operator characteristic vector and the first state characteristic vector to obtain target data;

[0009] The target data is input into the operator scheduling model to determine the scheduling information of the operator to be scheduled, where the scheduling information indicates the scheduling method of the operator to be scheduled under each processor.

[0010] According to another aspect of the present invention, there is provided an operator scheduling device, comprising:

[0011] A first determination module, used to determine a first operator characteristic vector of the operator to be scheduled, wherein the first operator characteristic vector is a vector formed by the operator characteristics of the operator to be scheduled;

[0012] A second determination module is used to determine a first state characteristic vector of a first device, where the first state characteristic vector is a vector formed by state characteristics, where the state characteristics represent states of multiple processors in the first device, and the first device is a device that will run the operator to be scheduled;

[0013] A preprocessing module, used for preprocessing the first operator characteristic vector and the first state characteristic vector to obtain target data;

[0014] The third determination module is used to input the target data into the operator scheduling model to determine the scheduling information of the operator to be scheduled, where the scheduling information indicates the scheduling method of the operator to be scheduled under each processor.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the operator scheduling method described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the operator scheduling method described in any embodiment of the present invention when executed.

[0020] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the operator scheduling method described in any embodiment of the present invention is implemented.

[0021] The technical solution of the embodiment of the present invention first determines the first operator characteristic vector of the operator to be scheduled, and the first operator characteristic vector is a vector formed by the operator characteristics of the operator to be scheduled. Then, the first state characteristic vector of the first device is determined, and the first state characteristic vector is a vector formed by the state characteristics. The state characteristics characterize the states of multiple processors in the first device, and the first device is the device that will run the operator to be scheduled. Then, the first operator characteristic vector and the first state characteristic vector are preprocessed to obtain target data, and finally the target data is input into the operator scheduling model to determine the scheduling information of the operator to be scheduled, and the scheduling information indicates the scheduling method of the operator to be scheduled under each processor. By representing the operator characteristics and the state characteristics of the first device with vectors, and linking the two, and inputting them into the operator scheduling model, the scheduling method of the operator under each processor is obtained, so that in the process of scheduling the operator, the operator characteristics and the state characteristics of the first device are comprehensively considered, and the dynamic changes of the performance of different operators and processors can be coped with, and the reasonable use of the device when the operator runs on the device is realized, and the computing efficiency of the operator is improved.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0024] Figure 1 is a flowchart of an operator scheduling method provided according to Embodiment 1 of the present invention;

[0025] Figure 2 is a flowchart of a method for determining a training set of an operator scheduling model provided in accordance with Embodiment 2 of the present invention;

[0026] Figure 3 is a structural diagram of an operator scheduling device provided according to Embodiment 3 of the present invention;

[0027] Figure 4 It is a block diagram of an electronic device provided according to a fourth embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Embodiment 1

[0031] Figure 1 A flowchart of an operator scheduling method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of scheduling operators. The method can be executed by an operator scheduling device. The operator scheduling device can be implemented in the form of hardware and / or software. The operator scheduling device can be configured in an electronic device. The electronic device can be a computer or other device used to schedule operators to be scheduled. Figure 1 As shown, the method includes:

[0032] S110. Determine a first operator characteristic vector of the operator to be scheduled, where the first operator characteristic vector is a vector formed by operator characteristics of the operator to be scheduled.

[0033] In this embodiment, operators can be understood as various basic operations in a neural network, which are basic components for building a neural network, such as convolution, pooling, activation functions, etc. Each operator usually corresponds to one or more computing tasks. The operator to be scheduled can be understood as an operator that needs to be scheduled in a neural network. Scheduling refers to the process of determining the execution order, parallelism, and computing platform of the operator. Reasonable scheduling can reduce computing time, reduce memory usage, and improve the utilization of hardware resources. The first operator characteristic vector can be understood as representing the various operator characteristics of the operator to be scheduled in the form of a vector. Operator characteristics can be understood as the properties and behaviors of the operator when performing computing tasks in a neural network.

[0034] Specifically, in a neural network, operator characteristics may include static characteristics, dynamic characteristics, and topological characteristics. A plurality of operator characteristics of the operator to be scheduled are expressed in the form of vectors to obtain a first operator characteristic vector of the operator to be scheduled.

[0035] For example, assume that one of the operators to be scheduled in the model is O i , the operator to be scheduled can be represented by a feature vector, where the static feature is represented by f static (O i ), the dynamic feature is represented by f dynamic ( O i), the topological feature is represented by f topological (O i ), the operator to be scheduled is recorded as: V(O i )=[f static (O i ),f dynamic (O i ),f topological (O i )].

[0036] Optionally, the operator characteristics include: static characteristics, dynamic characteristics and topological characteristics of the operator to be scheduled.

[0037] In this embodiment, static features can be understood as the inherent attributes of the operator to be scheduled, which are determined when the operator to be scheduled is constructed. Dynamic features can be understood as the characteristics exhibited by the operator to be scheduled during execution, and dynamic features can change with the operating environment, input data or time of the operator to be scheduled. Topological features can be understood as the importance and connection mode of the operator to be scheduled in the network.

[0038] Exemplarily, the static characteristics of the operator to be scheduled may include: the name and type of the operator to be scheduled, which are used to directly identify the basic properties of the operator to be scheduled; the number and shape of input and output tensors, which are used to reflect the data processing capability and computing scale of the operator to be scheduled; computational complexity including time and space, which is used to quantify the computing requirements of the operator to be scheduled; floating-point operation estimate per second, which is used to accurately quantify the computing intensity and required resources, and the floating-point operation estimate per second is an indicator to measure hardware performance; a parameter list and its attributes, which are used to describe the configurability and flexibility of the floating-point operation estimate per second; numerical accuracy requirements, that is, the supported data types, and quantization sensitivity, which are used to reflect the numerical characteristics of the operator to be scheduled.

[0039] Exemplarily, the dynamic characteristics of the operators to be scheduled may include: mathematical properties, such as commutativity, associativity, linear / nonlinear characteristics, etc., among which commutativity and associativity can be used to distinguish the computational logic of certain operators, such as addition and subtraction. For linear / nonlinear characteristics, further differentiation is provided for the operator characteristics, such as addition is a strict linear operation, while matrix multiplication exhibits nonlinear characteristics; computational path, for the specific computational logic path of the complex operators to be scheduled, a computational graph can be used for quantization, and the computational logic of the complex operators to be scheduled can be represented as a small computational graph, and then the graph embedding technology is used to convert this small computational graph into a vector of fixed dimension.

[0040] Exemplarily, the topological features of the operators to be scheduled may include: in-degree, out-degree, and centrality metrics, which are used to describe the importance and connection mode of the operators in the network. By mathematically modeling the static, dynamic, and topological features of the operators to be scheduled through vector representation, the operator characteristics can be visualized and the characteristics of different operators can be accurately measured.

[0041] S120. Determine a first state characteristic vector of a first device, where the first state characteristic vector is a vector formed by state characteristics, and the state characteristics represent states of multiple processors in the first device, and the first device is a device that will run the operator to be scheduled.

[0042] In this embodiment, the first device may be a specific hardware resource or computing unit for executing operations or tasks related to the operator to be scheduled, and the operator may be scheduled to different processors of the first device to perform calculations to improve the calculation efficiency of the operator. In a neural network, a processor may be used for neural network operations, and the processor may include a central processing unit, a graphics processing unit, and / or a neural network processor, etc.

[0043] The first state characteristic vector can be understood as representing multiple state characteristics of the first device in the form of a vector. The state characteristic can be understood as a description of various states of the first device at different times, including the performance, computing resources, etc. of the first device.

[0044] Specifically, in a neural network, state characteristics may include processor utilization, load, memory occupancy, network speed and / or operating frequency, etc. The state characteristics of the first device at different times are expressed in the form of vectors to obtain a first state characteristic vector corresponding to the state of the first device. The first state characteristic vector may be a one-dimensional vector, such as including only the dimension of the state, or a two-dimensional vector, such as including not only the dimension of the state but also the dimension of time.

[0045] Exemplarily, it is assumed that the first state characteristic vector of the first device is S=[f1,f2,…,f n ], where element f iIndicates the various state characteristics of the first device at the current moment, such as CPU utilization, memory occupancy, neural network processor load, operating frequency and / or network speed. Introducing the historical event window size k, constructing a time series for each element, it can represent the various state characteristics of the first device at different times, F i (t) = [f i (tk),f i (t-k+1),…,f i (t)], where f i (tk) represents the various state characteristics of the first device at the historical moment k.

[0046] S130: Preprocess the first operator characteristic vector and the first state characteristic vector to obtain target data.

[0047] In this embodiment, the target data can be understood as data obtained according to the first operator characteristic vector and the first state characteristic vector, which can be used as input of the operator scheduling model to train the operator scheduling model. The operator scheduling model can be understood as a model for scheduling operators in a neural network to determine the execution order of operators and to reasonably allocate the resources of the computing first device.

[0048] Specifically, since the first operator characteristic vector is a one-dimensional vector and the first state characteristic vector is a two-dimensional vector, in order to link the operator characteristics with the state characteristics of the device, the first operator characteristic vector is first converted and updated to a two-dimensional vector, and features are extracted, and then features are also extracted from the first state characteristic vector. Finally, the matrices obtained after extracting features from the first operator characteristic vector and the first state characteristic vector are concatenated to obtain the target data.

[0049] Exemplarily, the target data is data that can be processed by the operator scheduling model, and can be data obtained by fusing the first operator characteristic vector and the first state characteristic vector. Since the first operator characteristic vector is a one-dimensional vector that only considers the operator characteristics, and the first state characteristic vector is a two-dimensional vector that considers the state characteristics and time, in order to link the two, the first operator characteristic vector needs to be converted into a two-dimensional vector and then feature extraction is performed. Features are also extracted from the first state characteristic vector, and the two are spliced ​​to obtain the target data.

[0050] S140: Input the target data into an operator scheduling model to determine scheduling information of the operator to be scheduled, where the scheduling information indicates a scheduling method of the operator to be scheduled under each processor.

[0051] In this embodiment, the scheduling information can be understood as the information of scheduling the operator to be scheduled on multiple processors in the first device. The scheduling information can indicate the order in which the operators are run on the processors, or the processors that execute the operators. The scheduling method can be understood as a strategy for determining the execution method of the operator, such as the execution order. The scheduling method of the operator can be obtained according to the operator scheduling model.

[0052] Specifically, the target data obtained from the first operator characteristic vector and the first state characteristic vector is input into the operator scheduling model for calculation, and the operator scheduling model can output the scheduling information of the operator to be scheduled. According to the scheduling mode of the operator to be scheduled indicated by the scheduling information, the operation mode of the operator to be scheduled under the processor is scheduled.

[0053] Exemplarily, it is assumed that the processors in the first device include a central processing unit, a graphics processing unit, and a neural network processor, so the operator scheduling model is a three-category model. When an operator to be scheduled needs to be scheduled, the target data obtained by the first operator characteristic vector of the operator to be scheduled and the first state characteristic vector of the first device is input into the operator scheduling model, and the operator to be scheduled is scheduled according to the scheduling method indicated by the scheduling information output by the operator scheduling model. The scheduling method can be to determine the order in which the operator to be scheduled is executed on the central processing unit, the graphics processing unit, and the neural network processor.

[0054] The technical solution of the embodiment of the present invention first determines the first operator characteristic vector of the operator to be scheduled, and the first operator characteristic vector is a vector formed by the operator characteristics of the operator to be scheduled. Then, the first state characteristic vector of the first device is determined, and the first state characteristic vector is a vector formed by the state characteristics. The state characteristics characterize the states of multiple processors in the first device, and the first device is the device that will run the operator to be scheduled. Then, the first operator characteristic vector and the first state characteristic vector are preprocessed to obtain target data, and finally the target data is input into the operator scheduling model to determine the scheduling information of the operator to be scheduled, and the scheduling information indicates the scheduling method of the operator to be scheduled under each processor. By representing the operator characteristics and the state characteristics of the first device with vectors, and linking the two, and inputting them into the operator scheduling model, the scheduling method of the operator under each processor is obtained, so that in the process of scheduling the operator, the operator characteristics and the state characteristics of the first device are comprehensively considered, and the dynamic changes of the performance of different operators and processors can be coped with, and the reasonable use of the device when the operator is calculated on the device is realized, and the calculation efficiency of the operator is improved.

[0055] Based on the above embodiment, a modified embodiment of the above embodiment is proposed. It should be noted that in order to make the description concise, only the differences from the above embodiment are described in the modified embodiment.

[0056] In one embodiment, determining a first state characteristic vector of the first device includes:

[0057] Determining state characteristics of the first device at different times and in different states;

[0058] The state characteristic is represented in the form of a two-dimensional vector, and the dimensions of the two-dimensional vector include a time dimension and a state dimension.

[0059] In this embodiment, the time dimension refers to the measurement of the state characteristics of the first device in time, and the time dimension takes into account the historical state of the first device. The state dimension refers to the measurement of the state characteristics of the first device, and the first state characteristic vector is a two-dimensional vector that takes into account the time dimension and state dimension of the first device.

[0060] Specifically, the state characteristics of the first device in different states at the current moment are first determined, and a one-dimensional vector representing the state characteristics of the first device in different states at the current moment is constructed. Then, the characteristics in the time dimension are introduced, and a time series is constructed for the state characteristics in each state of the first device, so that a two-dimensional vector including the time dimension and the state dimension can be obtained, and the two-dimensional vector is the first state characteristic vector of the first device.

[0061] For example, it is assumed that the first state characteristic vector of the first device at the current moment is S=[f1,f2,…,f n ], for each state feature f of the first device at the current moment i Construct a time series, namely F i (t) = [f i (tk),f i (t-k+1),…,f i (t)], we can get an n*k two-dimensional vector, which is used as the first state characteristic vector considering the time dimension and state dimension.

[0062] In one embodiment, the preprocessing of the first operator characteristic vector and the first state characteristic vector to obtain target data includes:

[0063] Converting the first operator characteristic vector into a two-dimensional vector to obtain an updated first operator characteristic vector;

[0064] Performing feature extraction on the first operator characteristic vector to obtain a first feature matrix;

[0065] Performing feature extraction on the first state characteristic vector to obtain a second feature matrix;

[0066] The first feature matrix and the second feature matrix are concatenated to obtain target data.

[0067] In this embodiment, the first feature matrix may be a feature matrix obtained by extracting features from the updated first operator feature vector through several convolution layers. Similarly, the second feature matrix may be a feature matrix obtained by extracting features from the first state feature vector through several convolution layers.

[0068] Specifically, in order to link the first operator characteristic vector with the first state characteristic vector, the first operator characteristic vector needs to be transformed and updated to be converted into a two-dimensional vector to obtain an updated first operator characteristic vector. The updated first operator characteristic vector and the first state characteristic vector are respectively subjected to several convolutional layers to extract features to obtain a first feature matrix and a second feature matrix. Finally, the first feature matrix and the second feature matrix are spliced ​​to obtain the target data. The splicing can be to merge the first feature matrix and the second feature matrix into a three-dimensional matrix.

[0069] Exemplarily, a reshape operation can be performed on the one-dimensional first operator characteristic vector to convert and update it into a two-dimensional vector to obtain an updated first operator characteristic vector. The updated first operator characteristic vector is subjected to several convolutional layers to extract features to obtain a first characteristic matrix of size x*y. The first state characteristic vector is also subjected to several convolutional layers to extract features to obtain a second characteristic matrix of size x*y. Finally, the first characteristic matrix and the second characteristic matrix are concatenated to obtain target data of size x*y*2, thereby linking the operator characteristics with the state characteristics.

[0070] In one embodiment, the operator to be scheduled is an operator in a neural network model.

[0071] For example, in a neural network model, operators to be scheduled are basic building blocks for building and training neural networks. Operators to be scheduled play a role in different layers and stages of the neural network, and together build a neural network model that can process complex data and tasks.

[0072] Embodiment 2

[0073] Figure 2 This is a flowchart of a method for determining a training set of an operator scheduling model provided in the second embodiment of the present invention. This embodiment expands upon the construction of the operator scheduling model in the above embodiment and refines the method for determining the training set required for training the operator scheduling model. Figure 2 As shown, the method includes:

[0074] S210: Determine a second operator characteristic vector of the operator to be trained, where the second operator characteristic vector is a vector formed by operator characteristics of the operator to be trained.

[0075] In this embodiment, the operator to be trained can be understood as an operator used in the training set determination process of the operator scheduling model. The second operator characteristic vector represents multiple operator characteristics of the operator to be trained in the form of a vector, and there is no necessary connection between the first operator characteristic vector and the second operator characteristic vector.

[0076] Specifically, in the training process of the operator scheduling model, the operator characteristics may also include static characteristics, dynamic characteristics and topological characteristics. The multiple operator characteristics of the operator to be trained are expressed in the form of vectors to obtain a second operator characteristic vector of the operator to be trained.

[0077] S220: Determine a second state characteristic vector of a second device, where the second state characteristic vector is a vector formed by states of a plurality of processors in the second device, and the second device is a device that will run the operator to be trained.

[0078] In this embodiment, the second device can be understood as a specific hardware resource or computing unit that is to be used to perform operations or tasks related to the operator to be trained. The operator can be scheduled to different processors of the second device to perform calculations, and there is no necessary connection between the first device and the second device. The second state characteristic vector can be understood as representing the states of multiple processors of the second device in the form of a vector, and there is no necessary connection between the first state characteristic vector and the second state characteristic vector.

[0079] Specifically, during the training process of the operator scheduling model, the states of the multiple processors in the second device at different times are represented in the form of vectors to obtain a second state characteristic vector related to the state of the second device and time.

[0080] S230 . For each of the operators to be trained, determine identification information of a processor corresponding to the operator to be trained in each of the processors, and determine the identification information as label data of the operator to be trained.

[0081] In this embodiment, the identification information may be understood as information used to identify each processor in the second device.

[0082] Specifically, during the training process of the operator scheduling model, each operator to be trained is run on the second device, and the running time of the operator to be trained on each processor in the second device is recorded. The corresponding processor is selected according to the running time, and the identification information of the processor is determined as the label data of the operator to be trained.

[0083] For example, it is assumed that the second device includes three processors, namely a central processing unit, a graphics processing unit, and a neural network processor. The operator to be trained is run on the three processors, and the running time is recorded respectively. A corresponding processor is selected from the three processors according to the running time, and the identification information of the processor is determined as the label data of the operator to be trained. The operator scheduling model can be trained through the label data.

[0084] S240: Add the second operator characteristic vector, the second state characteristic vector, and the label data to a training set of the operator scheduling model.

[0085] Specifically, the training set of the operator scheduling model can be used to store the second operator characteristic vector, the second state characteristic vector and the label data obtained by the operator to be trained running in the second device. The data in the training set is input into the operator scheduling model, and appropriate parameters are selected for training until convergence, so as to obtain the final operator scheduling model.

[0086] The technical solution of the embodiment of the present invention first determines the second operator characteristic vector of the operator to be trained, the second operator characteristic vector is a vector formed by the operator characteristics of the operator to be trained, then determines the second state characteristic vector of the second device, the second state characteristic vector is a vector formed by the states of multiple processors in the second device, the second device is the device that will run the operator to be trained, and then for each operator to be trained, determines the identification information of the processor corresponding to the operator to be trained in each processor, determines the identification information as the label data of the operator to be trained, and finally adds the second operator characteristic vector, the second state characteristic vector and the label data to the training set of the operator scheduling model. By representing the operator characteristics of the operator to be trained and the state characteristics of the second device with vectors, and determining the label data according to the running time of the operator to be trained on each processor in the second device, the method of obtaining the training set of the operator scheduling model is further refined. By updating the state of the operator to be trained or the second device, the operator scheduling model can be updated, thereby optimizing the operator scheduling method.

[0087] Optionally, the determining the identification information of the processor corresponding to the operator to be trained in each of the processors includes:

[0088] Running the operator to be trained on different processors of the second device to obtain the running time of the operator to be trained on the different processors;

[0089] Selecting the shortest running time from among the running times;

[0090] Determining a processor corresponding to the selected runtime;

[0091] The determined identification information of the processor is determined as the identification information of the processor corresponding to the operator to be trained in each of the processors.

[0092] Specifically, the operator to be trained is run on the second device, and the running time of the operator to be trained on each processor in the second device is recorded. The shortest running time is selected from multiple running times, and the processor corresponding to the shortest running time is selected. At this time, it is considered that the time required for the operator to be trained to run on the processor is the shortest and the efficiency is the highest. That is, the identification information of the processor is determined as the identification information of the processor corresponding to the operator to be trained in each processor in the second device.

[0093] Exemplarily, assume that the second device includes three processors, namely a central processing unit, a graphics processing unit, and a neural network processor; set the identification information of the central processing unit to 0, the identification information of the graphics processing unit to 1, and the identification information of the neural network processor to 2. Run the operator to be trained on the three processors, and record the running time of the operator to be trained on each processor. Select the shortest running time from multiple running times, and select the processor corresponding to the shortest running time. For example, if the running time of the operator to be trained on the central processing unit is the shortest, set the identification information 0 of the central processing unit as the identification information of the operator to be trained.

[0094] Embodiment 3

[0095] Figure 3 This is a schematic diagram of the structure of an operator scheduling device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:

[0096] A first determination module 310, configured to determine a first operator characteristic vector of the operator to be scheduled, wherein the first operator characteristic vector is a vector formed by operator characteristics of the operator to be scheduled;

[0097] A second determination module 320 is configured to determine a first state characteristic vector of a first device, where the first state characteristic vector is a vector formed by state characteristics, where the state characteristics represent states of a plurality of processors in the first device, and the first device is a device that will run the operator to be scheduled;

[0098] A preprocessing module 330, configured to preprocess the first operator characteristic vector and the first state characteristic vector to obtain target data;

[0099] The third determination module 340 is used to input the target data into the operator scheduling model to determine the scheduling information of the operator to be scheduled, where the scheduling information indicates the scheduling method of the operator to be scheduled under each processor.

[0100] The operator scheduling device provided by the embodiment of the present invention first determines the first operator characteristic vector of the operator to be scheduled through the first determination module, and the first operator characteristic vector is a vector formed by the operator characteristics of the operator to be scheduled. Then, the first state characteristic vector of the first device is determined through the second determination module, and the first state characteristic vector is a vector formed by the state characteristics. The state characteristics represent the states of multiple processors in the first device, and the first device is the device that will run the operator to be scheduled. Then, the first operator characteristic vector and the first state characteristic vector are preprocessed by the preprocessing module to obtain target data, and finally, the target data is input into the operator scheduling model through the third determination module to determine the scheduling information of the operator to be scheduled, and the scheduling information indicates the scheduling mode of the operator to be scheduled under each processor. Through the cooperation between the modules, the operator characteristics and the state characteristics of the first device are represented by vectors, and the two are linked and input into the operator scheduling model to obtain the scheduling mode of the operator under each processor, so that in the process of scheduling the operator, the operator characteristics and the state characteristics of the first device are comprehensively considered, and the dynamic changes of the performance of different operators and processors can be coped with, and the reasonable use of the device when the operator is running on the device is realized, and the calculation efficiency of the operator is improved.

[0101] In one embodiment, the second determining module 320 is specifically configured to:

[0102] Determining state characteristics of the first device at different times and in different states;

[0103] The state characteristic is represented in the form of a two-dimensional vector, and the dimensions of the two-dimensional vector include a time dimension and a state dimension.

[0104] In one embodiment, the preprocessing module 330 is specifically configured to:

[0105] Converting the first operator characteristic vector into a two-dimensional vector to obtain an updated first operator characteristic vector;

[0106] Performing feature extraction on the first operator characteristic vector to obtain a first feature matrix;

[0107] Performing feature extraction on the first state characteristic vector to obtain a second feature matrix;

[0108] The first feature matrix and the second feature matrix are concatenated to obtain target data.

[0109] In one embodiment, the training set determination module of the operator scheduling model includes:

[0110] A first determining unit, configured to determine a second operator characteristic vector of the operator to be trained, wherein the second operator characteristic vector is a vector formed by operator characteristics of the operator to be trained;

[0111] a second determining unit, configured to determine a second state characteristic vector of a second device, where the second state characteristic vector is a vector formed by states of a plurality of processors in the second device, and the second device is a device that will run the operator to be trained;

[0112] A third determining unit is used to determine, for each of the operators to be trained, identification information of a processor corresponding to the operator to be trained in each of the processors, and determine the identification information as label data of the operator to be trained;

[0113] An adding unit is used to add the second operator characteristic vector, the second state characteristic vector and the label data to a training set of the operator scheduling model.

[0114] In one embodiment, the third determining unit is specifically configured to:

[0115] Running the operator to be trained on different processors of the second device to obtain the running time of the operator to be trained on the different processors;

[0116] Selecting the shortest running time from among the running times;

[0117] Determining a processor corresponding to the selected runtime;

[0118] The determined identification information of the processor is determined as the identification information of the processor corresponding to the operator to be trained in each of the processors.

[0119] In one embodiment, the first determining module 310 is specifically configured to:

[0120] The static characteristics, dynamic characteristics and topological characteristics of the operator to be scheduled.

[0121] In one embodiment, the operator to be scheduled is an operator in a neural network model.

[0122] The operator scheduling device provided in the embodiment of the present invention can execute the operator scheduling method provided in any embodiment of the present invention, completes the scheduling of operators through the mutual cooperation and collaboration between modules, and has the functional modules and beneficial effects corresponding to the execution method.

[0123] Embodiment 4

[0124] According to an embodiment of the present invention, the present invention also provides an electronic device, a computer-readable storage medium and a computer program product.

[0125] Figure 4It is a block diagram of an electronic device provided according to Embodiment 4 of the present invention, which can implement the operator scheduling method described in the embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0126] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.

[0127] A number of components in the electronic device are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0128] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 executes the various methods and processes described above, such as the operator scheduling method.

[0129] In some embodiments, the operator scheduling method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the operator scheduling method described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured to execute the operator scheduling method in any other appropriate manner (e.g., by means of firmware).

[0130] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0131] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0132] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0133] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0134] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0135] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0136] In some embodiments, the computer program product includes a computer program, and when the computer program is executed by a processor, the operator scheduling method provided by the embodiment of the present invention is implemented.

[0137] The technical solution of the embodiment of the present invention, through an operator scheduling method, device, electronic device, storage medium and program product, first determines the first operator characteristic vector of the operator to be scheduled, the first operator characteristic vector is a vector formed by the operator characteristics of the operator to be scheduled. Then, the first state characteristic vector of the first device is determined, the first state characteristic vector is a vector formed by the state characteristics, the state characteristics represent the state of multiple processors in the first device, and the first device is the device that will run the operator to be scheduled. Then, the first operator characteristic vector and the first state characteristic vector are preprocessed to obtain target data, and finally the target data is input into the operator scheduling model to determine the scheduling information of the operator to be scheduled, and the scheduling information indicates the scheduling method of the operator to be scheduled under each processor. By representing the operator characteristics and the state characteristics of the first device with vectors, linking the two, and inputting them into the operator scheduling model, the scheduling method of the operator under each processor is obtained, so that in the process of operator scheduling, the operator characteristics and the state characteristics of the first device are comprehensively considered, and the dynamic changes of the performance of different operators and processors can be coped with, and the reasonable use of the device when the operator is running on the device is realized, and the calculation efficiency of the operator is improved.

[0138] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0139] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An operator scheduling method, characterized in that: include: Determine a first operator characteristic vector of the operator to be scheduled, where the first operator characteristic vector is a vector formed by operator characteristics of the operator to be scheduled; Determine a first state characteristic vector of a first device, where the first state characteristic vector is a vector formed by state characteristics, where the state characteristics represent states of a plurality of processors in the first device, and the first device is a device that will run the operator to be scheduled; Preprocessing the first operator characteristic vector and the first state characteristic vector to obtain target data; The target data is input into the operator scheduling model to determine the scheduling information of the operator to be scheduled, where the scheduling information indicates the scheduling method of the operator to be scheduled under each processor.

2. The method according to claim 1, characterized in that The determining a first state characteristic vector of the first device comprises: Determining state characteristics of the first device at different times and in different states; The state characteristic is represented in the form of a two-dimensional vector, and the dimensions of the two-dimensional vector include a time dimension and a state dimension.

3. The method according to claim 2, characterized in that The preprocessing of the first operator characteristic vector and the first state characteristic vector to obtain target data includes: Converting the first operator characteristic vector into a two-dimensional vector to obtain an updated first operator characteristic vector; Performing feature extraction on the first operator characteristic vector to obtain a first feature matrix; Performing feature extraction on the first state characteristic vector to obtain a second feature matrix; The first feature matrix and the second feature matrix are concatenated to obtain target data.

4. The method according to claim 1, characterized in that: The training set of the operator scheduling model is determined by the following operations: Determine a second operator characteristic vector of the operator to be trained, where the second operator characteristic vector is a vector formed by operator characteristics of the operator to be trained; Determine a second state characteristic vector of a second device, where the second state characteristic vector is a vector formed by states of a plurality of processors in the second device, and the second device is a device that will run the operator to be trained; For each of the operators to be trained, determining identification information of a processor corresponding to the operator to be trained in each of the processors, and determining the identification information as label data of the operator to be trained; The second operator characteristic vector, the second state characteristic vector and the label data are added to a training set of the operator scheduling model.

5. The method according to claim 4, characterized in that The determining the identification information of the processor corresponding to the operator to be trained in each of the processors includes: Running the operator to be trained on different processors of the second device to obtain the running time of the operator to be trained on the different processors; Selecting the shortest running time from among the running times; Determining a processor corresponding to the selected runtime; The determined identification information of the processor is determined as the identification information of the processor corresponding to the operator to be trained in each of the processors.

6. The method according to claim 1, characterized in that The operator characteristics include: The static characteristics, dynamic characteristics and topological characteristics of the operator to be scheduled.

7. The method according to claim 1, characterized in that The operator to be scheduled is an operator in a neural network model.

8. An operator scheduling device, characterized in that: include: A first determination module, used to determine a first operator characteristic vector of the operator to be scheduled, wherein the first operator characteristic vector is a vector formed by the operator characteristics of the operator to be scheduled; A second determination module is used to determine a first state characteristic vector of a first device, where the first state characteristic vector is a vector formed by state characteristics, where the state characteristics represent states of multiple processors in the first device, and the first device is a device that will run the operator to be scheduled; A preprocessing module, used for preprocessing the first operator characteristic vector and the first state characteristic vector to obtain target data; The third determination module is used to input the target data into the operator scheduling model to determine the scheduling information of the operator to be scheduled, where the scheduling information indicates the scheduling method of the operator to be scheduled under each processor.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the operator scheduling method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the operator scheduling method according to any one of claims 1 to 7 when executed.

11. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the operator scheduling method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Mapping method for neural network calculation in heterogeneous environment

    CN122242603A

  • Mapping method for neural network computing in heterogeneous environment

    CN122242603B