WO2024082679A1 - 计算图的处理方法和装置 - Google Patents
计算图的处理方法和装置 Download PDFInfo
- Publication number
- WO2024082679A1 WO2024082679A1 PCT/CN2023/102301 CN2023102301W WO2024082679A1 WO 2024082679 A1 WO2024082679 A1 WO 2024082679A1 CN 2023102301 W CN2023102301 W CN 2023102301W WO 2024082679 A1 WO2024082679 A1 WO 2024082679A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- subgraph
- operators
- tasks
- subgraphs
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/06—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
- G06N3/063—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/10—Interfaces, programming languages or software development kits, e.g. for simulating neural networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/10—Interfaces, programming languages or software development kits, e.g. for simulating neural networks
- G06N3/105—Shells for specifying net layout
Definitions
- the present application relates to neural network technology, and more particularly to a method and device for processing a computational graph.
- each dimension of the static shape is a known value, for example, [10,10,20,30].
- the present application provides a method and device for processing a computational graph to solve the software compilation and efficient execution of a dynamic shape network model, and implements a program execution method with a computational graph as the core under a dynamic shape.
- the present application provides a method for processing a computational graph, comprising: obtaining a computational graph to be compiled, wherein the input data of the computational graph adopts a dynamic shape, and the computational graph includes multiple operators; dividing the computational graph to obtain multiple subgraphs, any one of the subgraphs including at least one of the operators in the computational graph; compiling and generating multiple executable tasks according to the multiple subgraphs; and running the computational graph based on the multiple executable tasks.
- a graph scheduling software solution is provided with subgraph as the basic scheduling execution unit (different from the stream scheduling mechanism with node as the unit) to solve the software compilation and efficient execution of the dynamic shape network model, and realize the program execution method with computational graph as the core under dynamic shape.
- the input/output of the computation graph uses a dynamic shape, that is, in the input/output, the shape used to represent the pixel composition structure is a dynamic shape, in which one or more dimensions have a value of -1, and the dimension corresponding to the -1 is unknown during the compilation phase.
- the computation graph can include multiple operators (i.e., Nodes). For example, in the computation graph shown in Figure 1, each layer corresponds to an operator, so the computation graph includes 11 operators.
- the input/output can be split.
- the convolution operator can support continuous multi-equal splitting of input/outputinput/output, and can also support jump splitting of input/outputinput/output.
- the input/outputinput/output can be split into multiple copies of data, thereby reducing the amount of data in each copy, increasing the number of operators, and improving execution efficiency through concurrent execution.
- the strategy for dividing subgraphs in the embodiment of the present application may include classifying operators with the same and continuous segmentation methods into the same subgraph, and may also classify operators with different and continuous segmentation methods into the same subgraph.
- multiple subgraphs can be statically compiled to obtain multiple thread tasks; then the data to be processed is obtained; and the multiple thread tasks are dynamically compiled according to the data to be processed to obtain multiple executable tasks.
- the compilation process of the computation graph can include two parts: static compilation and dynamic compilation.
- the computation graph can be divided into several subgraphs according to the hardware resource situation in the compilation state, so as to realize the static processing of the computation graph irrelevant to the shape and generate thread tasks.
- the execution steps related to the static graph are executed in advance before the operation, which can reduce the runtime compilation overhead.
- connection operator can be inserted at the beginning and end of the first subgraph.
- the connection operator can include inlabel, AT-start, AT-end, outlabel, etc. These operators can be customized to achieve the connection function.
- the m operators included in the first subgraph may be optimized, including various fusion optimizations, single operator optimizations, constant folding optimizations, dtype, format optimizations, and the like.
- cache operations can be performed on N thread tasks.
- Cache operations (for example, prefetch, invalid, writeback, etc.) can be performed on multiple operators in a subgraph.
- the dynamic shape of the data to be processed is obtained; the unknown parameters in multiple thread tasks are updated according to the dynamic shape of the data to be processed to obtain multiple executable tasks.
- the concurrency parameters of the thread task can be calculated according to the actual dynamic shape, and the dynamic shape and thread concurrency related parameters in the thread task can be updated (for example, the part related to -1 in the shape in the thread task is refreshed), and finally an executable task is generated.
- host tasks and device tasks can be executed in the host and device pipelines to improve execution efficiency.
- threadnum can be calculated in real time according to the dynamic shape of the data to be processed, and threadnum represents the number of segments of the data to be processed.
- the dynamic shape is substituted into a preset formula to obtain threadnum, and the preset formula is used to express the corresponding relationship between the dynamic shape and threadnum.
- the cache strategy can also be called a cache strategy.
- all data will not be cached, and the cache bandwidth will be used to improve the subgraph execution performance.
- threadnum is obtained with the goal of fully operating the engine in the first subgraph.
- each engine runs computing resources at full capacity.
- the blockdim of engines of the same type integer multiples of chip cores; the computing resources of the engine bound run at full capacity, and the computing resources of the engine non-bound do not block the operation of bound computing resources; in the compilation state, based on the fitted shape, the best pipeline of engine concurrency is evaluated, and the recommended value of threadnum that meets the best pipeline is given; combined with the cache resource strategy, the threadnum value is actually synthesized in the running state.
- threadnum subtasks included in the first subgraph are scheduled based on multiple executable tasks, threadnum represents the number of divisions of the data to be processed in the first subgraph, each subtask includes m operators, m ⁇ 1, and the first subgraph is any one of the multiple subgraphs.
- the embodiment of the present application issues executable tasks in units of subgraphs, and concurrently schedules and executes tasks in units of subgraphs, which can improve the concurrent efficiency of resources.
- bandwidth is allocated to multiple executable tasks with the goal of minimizing the total running time.
- the Qos strategy It can also be called the Qos strategy. It adjusts the Qos value of the thread subtask according to the optimal pipeline mentioned above. When the subgraphs are executed concurrently, the priority of each computing resource and bandwidth is coordinated to ensure the efficient execution of the entire graph.
- the present application provides a processing device, including: an acquisition module, used to obtain a calculation graph to be compiled, the input data of the calculation graph adopts a dynamic shape, and the calculation graph includes multiple operators; a partitioning module, used to partition the calculation graph to obtain multiple sub-graphs, any one of the sub-graphs includes at least one of the operators in the calculation graph; a compilation module, used to compile and generate multiple executable tasks according to the multiple sub-graphs; and a running module, used to run the calculation graph based on the multiple executable tasks.
- the partitioning module is specifically used to obtain partitioning information of the multiple operators, where the partitioning information is used to indicate input data partitioning methods supported by corresponding operators; and to obtain the multiple subgraphs according to the partitioning information of the multiple operators.
- the first subgraph when the first subgraph includes n operators, the n operators are arranged consecutively, and the input data segmentation methods supported by the n operators are the same, n>1, and the first subgraph is any one of the multiple subgraphs.
- the compilation module is specifically used to statically compile the multiple subgraphs respectively to obtain multiple thread tasks; obtain data to be processed; and dynamically compile the multiple thread tasks according to the data to be processed to obtain the multiple executable tasks.
- the compilation module is specifically used to obtain the total number of engines in a first subgraph, where the first subgraph is any one of the multiple subgraphs, and the first subgraph includes m operators, where m ⁇ 1; determine N based on the total number of engines in the first subgraph, where N>1, and N represents the number of threads that can run concurrently; obtain N thread tasks, where any one of the thread tasks includes m structures, and the N thread tasks correspond to N threads.
- the compiling module is specifically used to obtain the dynamic shape of the data to be processed; and update the unknown parameters in the multiple thread tasks according to the dynamic shape of the data to be processed to obtain the multiple executable tasks.
- the compiling module is further configured to obtain threadnum according to the dynamic shape of the data to be processed, where threadnum represents the number of divisions of the data to be processed.
- the compiling module is specifically configured to substitute the dynamic shape into a preset formula to obtain the threadnum, where the preset formula is configured to represent a corresponding relationship between the dynamic shape and the threadnum.
- the compiling module is specifically configured to obtain the threadnum with the goal of fully operating the engine in the first subgraph.
- the compiling module is further configured to insert a connection operator at the beginning and the end of the first subgraph.
- the compilation module is further used to optimize the m operators included in the first subgraph.
- the compiling module is further configured to perform a cache operation on the N thread tasks.
- the running module is specifically used to schedule threadnum subtasks included in the first subgraph based on the multiple executable tasks in a manner of multiplexing executable tasks, where threadnum represents the number of divisions of the data to be processed in the first subgraph, and each of the subtasks includes m operators, m ⁇ 1, and the first subgraph is any one of the multiple subgraphs.
- the running module is further configured to allocate bandwidth to the multiple executable tasks with the goal of minimizing the total running time.
- the present application provides a device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement a method as described in any one of the above-mentioned first aspects.
- the present application provides a computer-readable storage medium, comprising a computer program, wherein when the computer program is executed on a computer, the computer executes any one of the methods described in the first aspect.
- the present application provides a computer program product, wherein the computer program product comprises a computer program code, and when the computer program code is executed on a computer, the computer executes any one of the methods in the first aspect.
- FIG1 is an exemplary schematic diagram of a computation graph
- FIG2 is an exemplary structural diagram of the hardware system of the present application.
- FIG3 is a flow chart of a process 300 of a method for processing a computational graph of the present application
- FIG4 is a schematic diagram of sub-graph segmentation
- Fig. 5 is a schematic diagram of a connection operator
- Fig. 6 is a schematic diagram of dynamic compilation
- FIG7 is a schematic diagram of the implementation process of the subgraph operation
- FIG. 8 is a schematic diagram of the structure of a processing device 800 according to an embodiment of the present application.
- At least one (item) means one or more, and “plurality” means two or more.
- “And/or” is used to describe the association relationship of associated objects, indicating that three relationships may exist.
- a and/or B can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural.
- the character “/” generally indicates that the objects associated before and after are in an “or” relationship.
- At least one of the following” or similar expressions refers to any combination of these items, including any combination of single or plural items.
- At least one of a, b or c can mean: a, b, c, "a and b", “a and c", “b and c", or "a and b and c", where a, b, c can be single or multiple.
- a neural network is a machine learning model.
- a neural network can be composed of neural units.
- a neural unit can refer to an operation unit with xs and intercept 1 as input.
- the output of the operation unit can be:
- f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into the output signal.
- the output signal of the activation function can be used as the input of the next convolutional layer.
- the activation function can be a nonlinear function such as ReLU.
- a neural network is a network formed by connecting many of the above-mentioned single neural units together, that is, the output of one neural unit can be the input of another neural unit.
- the input of each neural unit can be connected to the local receptive field of the previous layer to extract the characteristics of the local receptive field.
- the local receptive field can be an area composed of several neural units.
- Multi-layer perception (MLP)
- MLP is a simple deep neural network (DNN) (different layers are fully connected), also known as a multi-layer neural network, which can be understood as a neural network with many hidden layers. There is no special metric for "many" here. From the position of different layers of DNN, the neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer. Although DNN looks complicated, the work of each layer is actually not complicated.
- DNN simple deep neural network
- the coefficients from the kth neuron in the L-1th layer to the jth neuron in the Lth layer are defined as It should be noted that the input layer does not have a W parameter.
- W the weight parameter
- more hidden layers allow the network to better describe complex situations in the real world. Theoretically, the more parameters a model has, the higher its complexity and the greater its "capacity", which means it can complete more complex learning tasks.
- Training a deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (a weight matrix formed by many layers of vectors W).
- a convolutional neural network is a deep neural network with a convolutional structure. It is a deep learning architecture, which refers to multiple levels of learning at different levels of abstraction through machine learning algorithms. As a deep learning architecture, CNN is a feed-forward artificial neural network in which each neuron can respond to the image input into it.
- a convolutional neural network contains a feature extractor consisting of a convolutional layer and a pooling layer. The feature extractor can be regarded as a filter, and the convolution process can be regarded as using a trainable filter to convolve an input image or convolution feature map.
- a convolutional layer is a layer of neurons in a convolutional neural network that performs convolution on the input signal.
- a convolutional layer can include many convolution operators, also known as kernels. Their role in image processing is equivalent to a filter that extracts specific information from the input image matrix.
- the convolution operator can essentially be a weight matrix, which is usually predefined. During the convolution operation on the image, the weight matrix is usually processed horizontally on the input image one pixel after another (or two pixels after two pixels... depending on the value of the stride) to complete the work of extracting specific features from the image.
- the size of the weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix is the same as the depth dimension of the input image.
- the weight matrix will extend to the entire depth of the input image. Therefore, convolution with a single weight matrix will produce a convolution output with a single depth dimension, but in most cases, instead of using a single weight matrix, multiple weight matrices of the same size (row ⁇ column) are applied, that is, multiple isotype matrices.
- the output of each weight matrix is stacked up to form the depth dimension of the convolution image, where the dimension can be understood as being determined by the "multiple" mentioned above.
- Different weight matrices can be used to extract different features in the image, for example, one weight matrix is used to extract image edge information, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to blur unnecessary noise points in the image.
- the multiple weight matrices have the same size (rows ⁇ columns), and the size of the feature maps extracted by the multiple weight matrices of the same size is also the same.
- the extracted multiple feature maps of the same size are then merged to form the output of the convolution operation.
- the weight values in these weight matrices need to be obtained through a lot of training in practical applications.
- the weight matrices formed by the weight values obtained through training can be used to extract information from the input image, so that the convolutional neural network can make correct predictions.
- the initial convolutional layer often extracts more general features, which can also be called low-level features; as the depth of the convolutional neural network deepens, the features extracted by the later convolutional layers become more and more complex, such as high-level semantic features. Features with higher semantics are more suitable for the problem to be solved.
- the pooling layer can include an average pooling operator and/or a maximum pooling operator to sample the input image to obtain an image of smaller size.
- the average pooling operator can calculate the pixel values in the image within a specific range to produce an average value as the result of average pooling.
- the maximum pooling operator can take the pixel with the largest value in the range as the result of maximum pooling within a specific range.
- the operator in the pooling layer should also be related to the image size.
- the size of the image output after processing by the pooling layer can be smaller than the size of the image input to the pooling layer.
- Each pixel in the image output by the pooling layer represents the average value or maximum value of the corresponding sub-region of the image input to the pooling layer.
- the convolution neural network After being processed by the convolution layer/pooling layer, the convolution neural network is not sufficient to output the required output information. Because as mentioned above, the convolution layer/pooling layer will only extract features and reduce the parameters brought by the input image. However, in order to generate the final output information (the required class information or other related information), the convolution neural network needs to use the neural network layer to generate one or a group of outputs of the required number of classes. Therefore, the neural network layer may include multiple hidden layers, and the parameters contained in the multiple hidden layers can be pre-trained according to the relevant training data of the specific task type. For example, the task type may include image recognition, image classification, image super-resolution reconstruction, etc.
- an output layer of the entire convolutional neural network is also included.
- the output layer has a loss function similar to the classification cross entropy, which is specifically used to calculate the prediction error.
- Recurrent neural networks are used to process sequence data.
- the layers are fully connected, and the nodes within each layer are disconnected.
- this ordinary neural network has solved many difficult problems, it is still powerless for many problems. For example, if you want to predict the next word in a sentence, you generally need to use the previous word, because the previous and next words in a sentence are not independent. The reason why RNN is called a recurrent neural network is that the current output of a sequence is also related to the previous output.
- RNN can process sequence data of any length.
- the training of RNN is the same as the training of traditional CNN or DNN.
- the same error back propagation algorithm is used, but there is one difference: that is, if the RNN is expanded, the parameters, such as W, are shared; this is not the case with the traditional neural network mentioned above.
- the output of each step depends not only on the network at the current step, but also on the state of the network at the previous steps. This learning algorithm is called the Back Propagation Through Time (BPTT).
- BPTT Back Propagation Through Time
- Convolutional neural networks can use the error back propagation (BP) algorithm to correct the size of the parameters in the initial super-resolution model during the training process, so that the reconstruction error loss of the super-resolution model becomes smaller and smaller.
- BP error back propagation
- the forward transmission of the input signal to the output will generate error loss, and the error loss information is back-propagated to update the parameters in the initial super-resolution model, so that the error loss converges.
- the back propagation algorithm is a back propagation movement dominated by error loss, which aims to obtain the optimal parameters of the super-resolution model, such as the weight matrix.
- Generative adversarial networks are a deep learning model.
- the model includes at least two modules: one module is the generative model, and the other module is the discriminative model. Through the game learning between these two modules, better output can be produced.
- Both the generative model and the discriminative model can be neural networks, specifically deep neural networks or convolutional neural networks.
- the basic principle of GAN is as follows: Taking the GAN that generates pictures as an example, suppose there are two networks, G (Generator) and D (Discriminator), where G is a network that generates pictures. It receives a random noise z and generates pictures through this noise, denoted as G(z); D is a discriminative network, which is used to determine whether a picture is "real".
- Its input parameter is x
- x represents a picture
- the output D(x) represents the probability that x is a real picture. If it is 1, it means that it is 100% a real picture, and if it is 0, it means that it cannot be a real picture.
- the goal of the generative network G is to generate realistic images as much as possible to deceive the discriminative network D, while the goal of the discriminative network D is to distinguish the images generated by G from the real images as much as possible. In this way, G and D constitute a dynamic "game” process, which is also the "adversary" in the "generative adversarial network”.
- a neural network model can use a computational graph to express each layer and the connection relationship between layers.
- Figure 1 is an exemplary schematic diagram of a computational graph.
- the computational graph includes 6 convolutional layers, 5 activation layers ReLU, and the size of the convolution kernel is 3 ⁇ 3. That is, the computational graph includes a total of 11 operators (also referred to as nodes), and one operator corresponds to one of the aforementioned layers (for example, a convolutional layer or an activation layer).
- the output of the previous layer can be used as the input of the next layer, where the input of the first operator is also the input of the computational graph, and the output of the last operator is also the output of the computational graph.
- the computational graph can adopt any of the topological structures of the neural network mentioned above, and there is no specific limitation on this.
- the computational graph can realize some functions in use, such as image recognition, intelligent translation, intelligent recommendation, etc. Before implementing the aforementioned functions, the computational graph needs to be compiled to generate an executable expression, and then the aforementioned executable expression is run in the hardware environment to execute the function of the computational graph. It should be noted that the executable expression can be a file or a data structure of a program, etc., and the embodiments of this application do not specifically limit this.
- the input/output of the computational graph can use a dynamic shape.
- a dynamic shape also called dynamic tensor/dynamic shape/unknown shape
- the dynamic shape is unknown at compile time, and the specific dim value is only known at actual runtime. For example:
- the concept of shape can be used to represent the arrangement of input/output in memory, and can also be understood as the composition structure of input/outputinput/output.
- input/output can be a picture, or it can be voice, text, etc., and there is no specific limitation on this.
- the size of a two-dimensional picture can be expressed as 100*50
- a three-dimensional picture can be expressed as 3*100*50 using red, green and blue.
- the number of pictures 100 can be expressed as 100*3*100*50.
- Shape can be considered as the arrangement structure of the pixels of the input picture in memory.
- Dynamic shape can be understood as the pixels of the image to be processed each time are different, for example, this time it is 100*50, next time it is 10*5, and next time it is 1000*500. It can also be understood as the sentences to be processed each time are different, for example, the length and characters of the sentences are different. Also, the specifications of the objects to be processed are not fixed.
- 100 images each composed of red, yellow and blue, with a size of 100*50, can be represented as shape[100,3,100,50].
- the input data of the calculation graph includes the actual data (the pixel values of all pixels) and the aforementioned shape (indicating the emission structure of all multi-pixel points).
- the output data of the calculation graph also includes the actual data (the pixel values of all pixels) and shape (indicating the emission structure of all multi-pixel points).
- the shape can be the same as or different from the shape of the input data, for example, shape[50,3,100,50].
- FIG2 is an exemplary structural diagram of the hardware system of the present application.
- the processing program on the host sends the compiled model to the device, and the neural network processor/chip/central processing unit (CPU) on the device executes the neural network model.
- the model can be compiled offline on other personal computers (PC) machines or on the host machine.
- the host and device of the present application can be integrated into the same electronic device to jointly complete memory operations, and the electronic device has storage capabilities; the host and device can also be respectively set on different electronic devices, for example, the host is set on a user device such as a mobile phone or tablet computer, and the device is set on a neural network processor.
- FIG3 is a flowchart of process 300 of the method for processing a computational graph of the present application. As shown in FIG3 , process 300 may be performed by the host and the device described above. Process 300 is described as a series of steps or operations. It should be understood that process 300 may be performed in various orders and/or occur simultaneously, and is not limited to the execution order shown in FIG3 . Process 300 includes the following steps:
- Step 301 Obtain the computation graph to be compiled.
- the input/output of the computational graph uses a dynamic shape, that is, in the input/output, the shape used to represent the pixel composition structure is a dynamic shape, in which one or more dimensions have a value of -1, and the dimension corresponding to the -1 is unknown during the compilation stage.
- a computation graph may include multiple operators (ie, Nodes).
- each layer corresponds to an operator, and the computation graph includes 11 operators.
- Step 302 Divide the computation graph to obtain multiple subgraphs.
- segmentation information of multiple operators included in a computational graph may be obtained, and the segmentation information is used to indicate the input/output segmentation method supported by the corresponding operator; and then the graph is divided into multiple subgraphs according to the segmentation information features of the multiple operators.
- the input/output can be split.
- the convolution operator can support continuous multiple equal splitting of the input/output, and can also support jump splitting of the input/output.
- the input/output can be split into multiple copies of data, thereby reducing the amount of data in each copy, and then increasing the number of operators to improve execution efficiency through concurrent execution.
- the strategy for dividing the subgraphs in the embodiment of the present application may include classifying operators with the same segmentation method and being continuous into the same subgraph, or classifying operators with different segmentation methods and being continuous into the same subgraph.
- the computation graph has 10 operators 1-10, among which: Operators 1-3 support the same segmentation method, so operators 1-3 can be included in the same subgraph.
- Operators 4 and 6 have the same segmentation method, they are not continuous, so operator 4 can only be included in one subgraph, operator 5 in another subgraph, and operator 6 in another subgraph.
- Operators 7-10 support the same segmentation method, so operators 7-10 can be included in the same subgraph.
- Step 303 compile and generate multiple executable tasks according to the multiple subgraphs.
- multiple subgraphs can be statically compiled to obtain multiple thread tasks; then the data to be processed is obtained; and the multiple thread tasks are dynamically compiled according to the data to be processed to obtain multiple executable tasks.
- the compilation process of the computation graph can include two parts: static compilation and dynamic compilation.
- the computation graph can be divided into several subgraphs according to the hardware resource situation in the compilation state, so as to realize the static processing of the computation graph irrelevant to the shape and generate thread tasks.
- the execution steps related to the static graph are executed in advance before the operation, which can reduce the runtime compilation overhead.
- connection operator can be inserted at the beginning and end of the first subgraph.
- the connection operator can include inlabel, AT-start, AT-end, outlabel, etc. These operators can be customized to achieve the connection function.
- the m operators included in the first subgraph may be optimized, including various fusion optimizations, single operator optimizations, constant folding optimizations, dtype, format optimizations, and the like.
- cache operations can be performed on N thread tasks.
- Cache operations (for example, prefetch, invalid, writeback, etc.) can be performed on multiple operators in a subgraph.
- the dynamic shape of the data to be processed is obtained; the unknown parameters in multiple thread tasks are updated according to the dynamic shape of the data to be processed to obtain multiple executable tasks.
- the concurrency parameters of the thread task can be calculated according to the actual dynamic shape, and the dynamic shape and thread concurrency related parameters in the thread task can be updated (for example, the part related to -1 in the shape in the thread task is refreshed), and finally an executable task is generated, and the final executable task is generated.
- host tasks and device tasks can be executed in the host and device pipelines to improve execution efficiency.
- the number of slices (threadnum) of the data to be processed can be calculated in real time according to the dynamic shape of the data to be processed.
- the dynamic shape is substituted into a preset formula to obtain threadnum, and the preset formula is used to express the corresponding relationship between the dynamic shape and threadnum.
- the cache strategy can also be called a cache strategy.
- all data will not be cached, and the cache bandwidth will be used to improve the subgraph execution performance.
- threadnum is obtained with the goal of fully operating the engine in the first subgraph.
- each engine runs computing resources at full specification.
- the blockdim of engines of the same type integer multiples of chip cores; the bound computing resources of the engine run at full capacity, and the non-bound computing resources of the engine do not block the operation of bound computing resources; in the compilation state, based on the fitted shape, the best pipeline of engine concurrency is evaluated, and the recommended value of threadnum that meets the best pipeline is given; combined with the cache resource strategy, the threadnum value is actually synthesized in the running state.
- Step 304 Run the computation graph based on multiple executable tasks.
- threadnum subtasks included in the first subgraph are scheduled based on multiple executable tasks, threadnum represents the number of divisions of the data to be processed in the first subgraph, each subtask includes m operators, m ⁇ 1, and the first subgraph is any one of the multiple subgraphs.
- the embodiment of the present application issues executable tasks in units of subgraphs, and concurrently schedules and executes tasks in units of subgraphs, which can improve the concurrent efficiency of resources.
- bandwidth is allocated to multiple executable tasks with the goal of minimizing the total running time.
- the Qos strategy It can also be called the Qos strategy. It adjusts the Qos value of the thread subtask according to the optimal flow mentioned above. When the subgraphs are executed concurrently, the priority of each computing resource and bandwidth is coordinated to ensure the efficient execution of the entire graph.
- a graph scheduling software solution is provided with subgraph as the basic scheduling execution unit (different from the stream scheduling mechanism with node as the unit) to solve the software compilation and efficient execution of the dynamic shape network model, and realize the program execution method with computational graph as the core under dynamic shape.
- the subgraph scope strategy is defined. Given a computational graph, the scope is determined according to the segmentation information (the range of the consistent segmentation axis is found according to the segmentation information), and the graph is segmented according to the automatic threading method (continuous equal segmentation method. If the graph cannot be evenly segmented, the tail block can be different from the non-tail block).
- the window size (the number of threads executed simultaneously on the runtime devcie) is solidified, and threadnum is used as a variable to perform fitting evaluation on resources.
- a fast formula is evaluated in the compilation state, and the threadnum of the segmentation is calculated by substituting the actual shape into the fast formula in the running state.
- the evaluated resources include but are not limited to: cache resources, computing resources, etc.
- Figure 4 is a schematic diagram of subgraph segmentation. As shown in Figure 4, the subgraph in this example includes 4 operators (conv, vec, conv, vec from top to bottom). The input/output of the subgraph can be divided into 8 parts (the method for obtaining the number of parts can be referred to below), and the processing of 8 parts of data can be processed by 8 threads, and the operator corresponding to each thread is the same.
- the thread subtask context task under automatic threading is expressed by thread windows size threads. Even if the actual threadnum is unknown, the subgraph level task is expressed by automatic threading. When it exceeds or falls below the thread windows size, the tasks in the subgraph are adjusted during dynamic compilation.
- each engine runs the computing resources at full specification.
- the blockdim of the same type of engine is an integer multiple of the chip core; the bound computing resources of the engine run at full load, and the non-bound computing resources of the engine do not block the operation of the bound computing resources; in the compiled state, the optimal pipeline of the engine concurrency is evaluated according to the fitted shape, and the recommended value of threadnum that meets the optimal pipeline is given; combined with the cache resource strategy, the threadnum value is actually synthesized in the running state. Since the full load of each engine is different, the best situation can be found.
- threadnum can be obtained by using only (2) or (3), or by using (2) and (3) to obtain threadnum.
- connection operators such as inlabel, AT-start, AT-end, and outlabel at the beginning and end of the subgraph.
- inlabel and outlabel indicate the beginning and end of the subgraph.
- the operator name can be named arbitrarily.
- AT-start and AT-end are the start and end operators of each thread.
- the AT-start and AT-end descriptors contain threadid (the number of threads) and threadnum (the total number of threads).
- Outlabel records the total number of threadnums that need to be executed. After each thread is executed, outlabel is reduced by 1. When threadnum in outlabel is reduced to 0, the subgraph is executed.
- threadmun tasks can be fixedly expressed in the compiled state. When a thread is completed, a thread in threadnum-thread window size is replaced with the thread that has been executed in thread window size to achieve the purpose of reuse.
- Shape-related parameter updates are implemented in dynamic compilation.
- the subgraph is first dynamically compiled on the host to complete the derivation of shape information.
- the number of threads in the subgraph is determined according to the aforementioned algorithm, memory is allocated, and the information that has not been obtained in the compiled state in the subgraph task is updated (the actual value can only be calculated when the actual shape is obtained during dynamic compilation).
- the information required by the device is transferred through host to device, and the launch of the thread task is initiated to stimulate the device to start executing the task.
- Multiple subgraphs on the host can be executed concurrently in a pipelined manner. After the previous subgraph infershapes the shape of the last node, the next subgraph obtains the shape of the first node, so that the host of the second subgraph begins to execute. Therefore, multiple subgraphs can be executed in a pipeline.
- the host side refreshes the unknown part of the dynamic shape in the subgraph in the compiled state.
- the dynamic shape is in the compiled state, because the shape is unknown, a lot of execution information cannot be determined. After obtaining the shape, the actual value of the execution information can be refreshed to the task.
- Dynamic shape operators (the shape of the next operator depends on the output value of the previous operator, and this operator is called a dynamic shape operator) are not placed in the subgraph range, and need to obtain shape and other information through the interaction between the host and the device. They are executed as a single operator or an independent subgraph.
- the execution process of the subgraph is completed by the cooperation of software and hardware.
- the software is responsible for the scheduling of the subgraph.
- the specific process is as follows:
- the hardware preloads the subgraph into the cache and notifies the device scheduling software to start execution.
- the device scheduling software reads the initial ready task (the preceding node count is 0).
- the device scheduling software pushes the ready tasks to the hardware execution device for execution.
- the hardware execution device reads the task descriptor from the cache and executes the ready tasks, including scheduling them to multiple heterogeneous engines for execution.
- the device scheduling software takes the subsequent task of the currently completed task and counts the predecessor node of the subsequent task -. When the count is 0, the task is pushed to the hardware execution device for execution.
- Steps 2 to 5 are repeated until the subgraph is executed.
- the device scheduler After the device scheduler completes the execution of a thread task sequence, it will replace the entire thread with a new thread and modify the thread id and other information in the new thread context until all threads are executed.
- the QoS value of thread subtask is adjusted.
- the priority of each computing resource and bandwidth is coordinated to ensure the efficient execution of the whole graph.
- Eight threads can run in parallel at the same time, which will grab the memory bandwidth.
- QoS can allocate bandwidth according to the strategy. Bandwidth means that the computer has many buses. The higher the bus bandwidth, the better the performance.
- FIG8 is a schematic diagram of the structure of a processing device 800 according to an embodiment of the present application.
- the processing device 800 can be used in the hardware system described above, and includes: an acquisition module 801, a division module 802, a compilation module 803, and an operation module 804.
- An acquisition module 801 is used to acquire a computational graph to be compiled, wherein the input data of the computational graph adopts a dynamic shape, and the computational graph includes multiple operators; a partitioning module 802 is used to partition the computational graph to obtain multiple subgraphs, wherein any of the subgraphs includes at least one of the operators in the computational graph; a compilation module 803 is used to compile and generate multiple executable tasks according to the multiple subgraphs; and a running module 804 is used to run the computational graph based on the multiple executable tasks.
- the partitioning module 802 is specifically used to obtain partitioning information of the multiple operators, where the partitioning information is used to indicate input data partitioning methods supported by corresponding operators; and to obtain the multiple subgraphs according to the partitioning information of the multiple operators.
- the first subgraph when the first subgraph includes n operators, the n operators are arranged consecutively, and the input data segmentation methods supported by the n operators are the same, n>1, and the first subgraph is any one of the multiple subgraphs.
- the compilation module 803 is specifically used to statically compile the multiple subgraphs respectively to obtain multiple thread tasks; obtain data to be processed; and dynamically compile the multiple thread tasks according to the data to be processed to obtain the multiple executable tasks.
- the compilation module 803 is specifically used to obtain the total number of engines in a first subgraph, where the first subgraph is any one of the multiple subgraphs, and the first subgraph includes m operators, where m ⁇ 1; determine N according to the total number of engines in the first subgraph, where N>1, and N represents the number of threads that can run concurrently; obtain N thread tasks, where any one of the thread tasks includes m structures, and the N thread tasks correspond to N threads.
- the compiling module 803 is specifically configured to obtain a dynamic shape of the data to be processed; and update unknown parameters in the multiple thread tasks according to the dynamic shape of the data to be processed to obtain the multiple executable tasks.
- the compiling module 803 is further configured to obtain threadnum according to the dynamic shape of the data to be processed, where threadnum indicates the number of divisions of the data to be processed.
- the compiling module 803 is specifically configured to substitute the dynamic shape into a preset formula to obtain the threadnum, where the preset formula is used to represent a corresponding relationship between the dynamic shape and the threadnum.
- the compiling module 803 is specifically configured to obtain the threadnum with the goal of fully operating the engine in the first subgraph.
- the compiling module 803 is further configured to insert a connection operator at the beginning and the end of the first subgraph.
- the compiling module 803 is further configured to optimize the m operators included in the first subgraph.
- the compiling module 803 is further configured to perform a cache operation on the N thread tasks.
- the running module 804 is specifically used to schedule threadnum subtasks included in the first subgraph based on the multiple executable tasks in a manner of multiplexing executable tasks, where threadnum represents the number of divisions of the data to be processed in the first subgraph, and each of the subtasks includes m operators, m ⁇ 1, and the first subgraph is any one of the multiple subgraphs.
- the running module 804 is further configured to allocate bandwidth to the multiple executable tasks with the goal of minimizing the total running time.
- the device of this embodiment can be used to execute the technical solution of the method embodiment shown in Figure 3. Its implementation principle and technical effects are similar and will not be repeated here.
- each step of the above method embodiment can be completed by the hardware integrated logic circuit in the processor or the instruction in the form of software.
- the processor can be a general processor, a digital signal processor (digital signal processor, DSP), an application-specific integrated circuit (application-specific integrated circuit, ASIC), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
- the general processor can be a microprocessor or the processor can also be any conventional processor, etc.
- the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware coding processor to be executed, or the hardware and software modules in the coding processor are combined to be executed.
- the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc.
- the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
- the memory mentioned in the above embodiments may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories.
- the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
- the volatile memory may be a random access memory (RAM), which is used as an external cache.
- RAM random access memory
- SRAM static RAM
- DRAM dynamic RAM
- SDRAM synchronous DRAM
- DDR SDRAM double data rate SDRAM
- ESDRAM enhanced SDRAM
- SLDRAM synchlink DRAM
- DR RAM direct rambus RAM
- the disclosed systems, devices and methods can be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
- Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
- the technical solution of the present application or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Biophysics (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Neurology (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Image Analysis (AREA)
Abstract
Description
Claims (31)
- 一种计算图的处理方法,其特征在于,包括:获取待编译的计算图,所述计算图的输入数据采用动态shape,所述计算图包括多个算子;对所述计算图进行划分以得到多个子图,任意一个所述子图包括所述计算图中的至少一个所述算子;根据所述多个子图编译生成多个可执行任务;基于所述多个可执行任务运行所述计算图。
- 根据权利要求1所述的方法,其特征在于,所述对所述计算图进行划分以得到多个子图,包括:获取所述多个算子的切分信息,所述切分信息用于指示对应算子所支持的输入数据切分方式;根据所述多个算子的切分信息获取所述多个子图。
- 根据权利要求2所述的方法,其特征在于,当第一子图包括n个算子时,所述n个算子连续排列,且所述n个算子所支持的输入数据切分方式相同,n>1,所述第一子图为所述多个子图中的任意一个。
- 根据权利要求1-3中任一项所述的方法,其特征在于,所述根据所述多个子图编译生成多个可执行任务,包括:对所述多个子图分别进行静态编译,以得到多个线程任务;获取待处理数据;根据所述待处理数据对所述多个线程任务进行动态编译,以得到所述多个可执行任务。
- 根据权利要求4所述的方法,其特征在于,所述对所述多个子图分别进行静态编译,以得到多个线程任务,包括:获取第一子图内的引擎总数,所述第一子图为所述多个子图中的任意一个,所述第一子图包括m个算子,m≥1;根据所述第一子图内的引擎总数确定N,N>1,N表示可并发运行的线程数量;获取N个线程任务,任意一个所述线程任务包括m个结构体,所述N个线程任务对应N个线程。
- 根据权利要求4或5所述的方法,其特征在于,所述根据所述待处理数据对所述多个线程任务进行动态编译,以得到所述多个可执行任务,包括:获取所述待处理数据的动态shape;根据所述待处理数据的动态shape对所述多个线程任务中的未知参数进行更新,以得到所述多个可执行任务。
- 根据权利要求6所述的方法,其特征在于,还包括:根据所述待处理数据的动态shape获取threadnum,threadnum表示所述待处理数据的切分数量。
- 根据权利要求7所述的方法,其特征在于,所述根据所述待处理数据的动态shape获取threadnum,包括:将所述动态shape代入预设公式以得到所述threadnum,所述预设公式用于表示所述动态shape和所述threadnum之间的对应关系。
- 根据权利要求7或8所述的方法,其特征在于,所述根据所述待处理数据的动态shape获取threadnum,包括:以所述第一子图内的引擎满负荷工作为目的获取所述threadnum。
- 根据权利要求5-9中任一项所述的方法,其特征在于,还包括:在所述第一子图的开头和结尾插入连接算子。
- 根据权利要求5-10中任一项所述的方法,其特征在于,还包括:对所述第一子图包括的所述m个算子进行优化。
- 根据权利要求5-11中任一项所述的方法,其特征在于,还包括:对所述N个线程任务进行缓存操作。
- 根据权利要求1-12中任一项所述的方法,其特征在于,所述基于所述多个可执行任务运行所述计算图,包括:以复用可执行任务的方式,基于所述多个可执行任务调度第一子图包括的threadnum个子任务,threadnum表示所述第一子图的待处理数据的切分数量,每个所述子任务包括m个算子,m≥1,所述第一子图为所述多个子图中的任意一个。
- 根据权利要求13所述的方法,其特征在于,还包括:以运行总时长最短为目的,给所述多个可执行任务分配带宽。
- 一种处理装置,其特征在于,包括:获取模块,用于获取待编译的计算图,所述计算图的输入数据采用动态shape,所述计算图包括多个算子;划分模块,用于对所述计算图进行划分以得到多个子图,任意一个所述子图包括所述计算图中的至少一个所述算子;编译模块,用于根据所述多个子图编译生成多个可执行任务;运行模块,用于基于所述多个可执行任务运行所述计算图。
- 根据权利要求15所述的装置,其特征在于,所述划分模块,具体用于获取所述多个算子的切分信息,所述切分信息用于指示对应算子所支持的输入数据切分方式;根据所述多个算子的切分信息获取所述多个子图。
- 根据权利要求16所述的装置,其特征在于,当第一子图包括n个算子时,所述n个算子连续排列,且所述n个算子所支持的输入数据切分方式相同,n>1,所述第一子图为所述多个子图中的任意一个。
- 根据权利要求15-17中任一项所述的装置,其特征在于,所述编译模块,具体用于对所述多个子图分别进行静态编译,以得到多个线程任务;获取待处理数据;根据所述待处理数据对所述多个线程任务进行动态编译,以得到所述多个可执行任务。
- 根据权利要求18所述的装置,其特征在于,所述编译模块,具体用于获取第一子图内的引擎总数,所述第一子图为所述多个子图中的任意一个,所述第一子图包括m个算子,m≥1;根据所述第一子图内的引擎总数确定N,N>1,N表示可并发运行的线程数量;获取N个线程任务,任意一个所述线程任务包括m个结构体,所述N个线程任务对应N个线程。
- 根据权利要求18或19所述的装置,其特征在于,所述编译模块,具体用于获取所述待处理数据的动态shape;根据所述待处理数据的动态shape对所述多个线程任务中的未知参数进行更新,以得到所述多个可执行任务。
- 根据权利要求20所述的装置,其特征在于,所述编译模块,还用于根据所述待处理数据的动态shape获取threadnum,threadnum表示所述待处理数据的切分数量。
- 根据权利要求21所述的装置,其特征在于,所述编译模块,具体用于将所述动态shape代入预设公式以得到所述threadnum,所述预设公式用于表示所述动态shape和所述threadnum之间的对应关系。
- 根据权利要求21或22所述的装置,其特征在于,所述编译模块,具体用于以所述第一子图内的引擎满负荷工作为目的获取所述threadnum。
- 根据权利要求19-23中任一项所述的装置,其特征在于,所述编译模块,还用于在所述第一子图的开头和结尾插入连接算子。
- 根据权利要求19-24中任一项所述的装置,其特征在于,所述编译模块,还用于对所述第一子图包括的所述m个算子进行优化。
- 根据权利要求19-25中任一项所述的装置,其特征在于,所述编译模块,还用于对所述N个线程任务进行缓存操作。
- 根据权利要求15-26中任一项所述的装置,其特征在于,所述运行模块,具体用于以复用可执行任务的方式,基于所述多个可执行任务调度第一子图包括的threadnum个子任务,threadnum表示所述第一子图的待处理数据的切分数量,每个所述子任务包括m个算子,m≥1,所述第一子图为所述多个子图中的任意一个。
- 根据权利要求27所述的装置,其特征在于,所述运行模块,还用于以运行总时长最短为目的,给所述多个可执行任务分配带宽。
- 一种设备,其特征在于,包括:一个或多个处理器;存储器,用于存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-14中任一项所述的方法。
- 一种计算机可读存储介质,其特征在于,包括计算机程序,所述计算机程序在计算机上被执行时,使得所述计算机执行权利要求1-14中任一项所述的方法。
- 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序代码,当所述计算机程序代码在计算机上运行时,使得计算机执行权利要求1-14中任一项所述的方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP23878676.8A EP4597362A4 (en) | 2022-10-19 | 2023-06-26 | METHOD AND APPARATUS FOR PROCESSING COMPUTING GRAPHS |
| US19/182,292 US20250306991A1 (en) | 2022-10-19 | 2025-04-17 | Computational graph processing method and apparatus |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211277782.4 | 2022-10-19 | ||
| CN202211277782.4A CN117908894A (zh) | 2022-10-19 | 2022-10-19 | 计算图的处理方法和装置 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US19/182,292 Continuation US20250306991A1 (en) | 2022-10-19 | 2025-04-17 | Computational graph processing method and apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024082679A1 true WO2024082679A1 (zh) | 2024-04-25 |
Family
ID=90684411
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/102301 Ceased WO2024082679A1 (zh) | 2022-10-19 | 2023-06-26 | 计算图的处理方法和装置 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US20250306991A1 (zh) |
| EP (1) | EP4597362A4 (zh) |
| CN (1) | CN117908894A (zh) |
| WO (1) | WO2024082679A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120430354A (zh) * | 2025-07-03 | 2025-08-05 | 沪渝人工智能研究院 | 一种动静态合并的算子调度与高低位扫描轻量化加速方法 |
| US20250291732A1 (en) * | 2024-03-14 | 2025-09-18 | Nvidia Corporation | Data transfer technique |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119902771B (zh) * | 2024-12-28 | 2025-10-24 | 腾讯科技(深圳)有限公司 | 计算图的处理方法、装置、设备及存储介质 |
| CN120723249B (zh) * | 2025-09-02 | 2026-01-06 | 北京清微智能科技有限公司 | 基于动态shape场景的编译方法、装置、存储介质及电子装置 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20190303762A1 (en) * | 2018-03-30 | 2019-10-03 | Xilinx, Inc. | Methods of optimization of computational graphs of neural networks |
| CN111338635A (zh) * | 2020-02-20 | 2020-06-26 | 腾讯科技(深圳)有限公司 | 计算图的图编译方法、装置、设备及存储介质 |
| CN114385181A (zh) * | 2021-12-17 | 2022-04-22 | 飞腾信息技术有限公司 | 一种数据处理方法、装置、设备及计算机存储介质 |
| CN114580653A (zh) * | 2022-01-12 | 2022-06-03 | 阿里云计算有限公司 | 机器学习计算优化方法和编译器 |
-
2022
- 2022-10-19 CN CN202211277782.4A patent/CN117908894A/zh active Pending
-
2023
- 2023-06-26 EP EP23878676.8A patent/EP4597362A4/en active Pending
- 2023-06-26 WO PCT/CN2023/102301 patent/WO2024082679A1/zh not_active Ceased
-
2025
- 2025-04-17 US US19/182,292 patent/US20250306991A1/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20190303762A1 (en) * | 2018-03-30 | 2019-10-03 | Xilinx, Inc. | Methods of optimization of computational graphs of neural networks |
| CN111338635A (zh) * | 2020-02-20 | 2020-06-26 | 腾讯科技(深圳)有限公司 | 计算图的图编译方法、装置、设备及存储介质 |
| CN114385181A (zh) * | 2021-12-17 | 2022-04-22 | 飞腾信息技术有限公司 | 一种数据处理方法、装置、设备及计算机存储介质 |
| CN114580653A (zh) * | 2022-01-12 | 2022-06-03 | 阿里云计算有限公司 | 机器学习计算优化方法和编译器 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4597362A4 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20250291732A1 (en) * | 2024-03-14 | 2025-09-18 | Nvidia Corporation | Data transfer technique |
| CN120430354A (zh) * | 2025-07-03 | 2025-08-05 | 沪渝人工智能研究院 | 一种动静态合并的算子调度与高低位扫描轻量化加速方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| EP4597362A1 (en) | 2025-08-06 |
| EP4597362A4 (en) | 2026-01-14 |
| US20250306991A1 (en) | 2025-10-02 |
| CN117908894A (zh) | 2024-04-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12406488B2 (en) | Neural network model training method, image processing method, and apparatus | |
| CN110175671B (zh) | 神经网络的构建方法、图像处理方法及装置 | |
| US12555362B2 (en) | Neural network model training method, image processing method, and apparatus | |
| CN111295675B (zh) | 用于使用内核来处理卷积运算的设备和方法 | |
| CN111882031B (zh) | 一种神经网络蒸馏方法及装置 | |
| EP4428754A1 (en) | Neural network model processing method and device | |
| US11093225B2 (en) | High parallelism computing system and instruction scheduling method thereof | |
| EP4597362A1 (en) | Method and apparatus for processing computational graph | |
| TW202026858A (zh) | 在深度神經網路中利用啟動稀疏性 | |
| CN111368993A (zh) | 一种数据处理方法及相关设备 | |
| CN110689115A (zh) | 神经网络模型处理方法、装置、计算机设备及存储介质 | |
| CN111797983A (zh) | 一种神经网络构建方法以及装置 | |
| WO2022007867A1 (zh) | 神经网络的构建方法和装置 | |
| CN111488177A (zh) | 数据处理方法、装置、计算机设备和存储介质 | |
| CN111783937A (zh) | 一种神经网络构建方法以及系统 | |
| WO2020062299A1 (zh) | 一种神经网络处理器、数据处理方法及相关设备 | |
| CN113449859A (zh) | 一种数据处理方法及其装置 | |
| CN115169548B (zh) | 基于张量的持续学习方法和装置 | |
| US11461662B1 (en) | Compilation time reduction for memory and compute bound neural networks | |
| WO2022156475A1 (zh) | 神经网络模型的训练方法、数据处理方法及装置 | |
| CN114008636A (zh) | 优化机器学习模型性能 | |
| WO2021243489A1 (zh) | 一种神经网络的数据处理方法及装置 | |
| KR102714536B1 (ko) | 신경 프로세싱 유닛 및 이의 동작 방법 | |
| CN114298289B (zh) | 一种数据处理的方法、数据处理设备及存储介质 | |
| Zhu et al. | A Wireless Collaborated Inference Acceleration Framework for Plant Disease Recognition |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23878676 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2023878676 Country of ref document: EP |
|
| ENP | Entry into the national phase |
Ref document number: 2023878676 Country of ref document: EP Effective date: 20250429 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| WWP | Wipo information: published in national office |
Ref document number: 2023878676 Country of ref document: EP |