Training Neural Networks Using Data Flow Graphs and Dynamic Memory Management

By optimizing GPU memory usage through data flow graph modifications and memory-saving operations, the method addresses memory constraints in deep neural networks, enabling larger data samples to be processed efficiently and improving computational capacity.

JP7556652B2Active Publication Date: 2024-09-26INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2022533240
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-12-05
Filing Date
2020-12-02
Publication Date
2024-09-26
Estimated Expiration
2040-12-02

AI Technical Summary

Technical Problem

The limited memory capacity of GPUs in deep neural networks constrains the size and resolution of data samples, affecting the accuracy of computations, and existing methods to alleviate memory constraints are inefficient or time-consuming.

Method used

A method for reducing GPU memory usage by determining insertion points for memory-saving operations within a data flow graph, utilizing tensor timing slacks and candidate lists to implement memory reduction and restoration operations, including data transfer to CPU and compression/decompression to free up memory space.

Benefits of technology

Significantly reduces GPU memory requirements, allowing larger data samples to be processed efficiently by serializing and prefetching data operations, thereby enhancing the computational capacity of GPUs in neural networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007556652000004
    Figure 0007556652000004
  • Figure 0007556652000009
    Figure 0007556652000009
  • Figure 0007556652000010
    Figure 0007556652000010
Patent Text Reader

Abstract

A neural network data flow graph containing a set of nodes and a set of edges is processed. An insertion point for a memory reduction or memory restoration operation is determined. This determination is based on calculating tensor timing slack (TTS) for a set of input tensors, assembling a candidate list (SI) of input tensors from the set of input tensors using input tensors with corresponding TTS values ​​greater than a threshold (thTTS), filtering the SI to retain input tensors whose size meets the threshold (thS), and, based on this filtering, using the SI to determine the insertion point for the operation. This process is used to generate a new data flow graph or modify an existing data flow graph.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates generally to processing large machine learning and neural network models in memory-constrained environments. More particularly, the present invention relates to modifications to computational data flow graphs that reduce the memory footprint, i.e., larger graphs or larger data samples (or more samples at a time) can be processed because less memory is required during evaluation of the graph. [Background technology]

[0002] A neural network is an artificial neural network (ANN) that mimics the functions of the human brain, including weighted connections between nodes or "neurons". A deep neural network (DNN) is an artificial neural network that includes multiple "hidden" layers between the input and output layers. The hidden layers of a DNN allow the modeling of complex nonlinear relationships that feature a higher abstract representation of the data, with each hidden layer determining the nonlinear transformation of the previous layer. Training large deep neural networks is a challenging computational problem. The adoption of graphic processors (GPUs) with their impressive performance has only made it possible to move from recognizing handwritten digits (MNIST) and small images (CIFR 10) to classifying high-resolution images (ImageNet). A key factor in the computational performance of GPUs is their fast memory. However, GPU memory is much smaller than the computer's main memory (CPU memory). The size of the graphic processor (GPU) memory limits both the depth of the DNN and the size of the data samples. As a result, there are often constraints on the size and resolution of images, which affects the accuracy of DNNs. Memory constraints can be alleviated by reducing the memory occupied by data. In an example embodiment, the GPU can send data in memory to the CPU to free up additional memory space, and then retrieve the data from the CPU after using the additional memory space for its intended function. Summary of the Invention

[0003] Embodiments of the present invention provide methods, systems, and computer program products for reducing overall GPU memory usage while processing a neural network by automatically determining insertion points for memory-saving operations in an underlying data flow graph that includes a set of nodes and a set of edges.

[0004] In an embodiment, a method for reducing overall GPU memory usage as described above includes calculating tensor timing slacks (TTS) for a set of input tensors, using input tensors with corresponding TTS values ​​greater than a threshold (thTTS) to assemble a candidate list (SI) of input tensors from the set of input tensors, filtering the SI to retain input tensors with sizes that satisfy the threshold (thS), and using the SI to determine insertion points for actions based on the filtering.

[0005] In an embodiment, the operations are a combination of reduction and restoration operations, where the reduction operation includes either or both of a copy operation and a compression operation to a central processing unit (CPU) memory, and the restoration operation includes either or both of a copy operation and a decompression operation from the CPU memory.

[0006] In an embodiment, computing the TTS includes performing a timing analysis using the input tensor.

[0007] In an embodiment, the timing analysis includes initializing values ​​of tensor arrival time (TAT), tensor required time (TRT), and tensor timing slack (TTS) for input tensors, and performing, for a set Q of input tensors, while Q is not empty, the steps of selecting a node q in Q for removal, removing q from Q, and for each input tensor s succeeding q, setting the TAT of s equal to the TAT of q.

[0008] In an embodiment, initializing includes initializing the values ​​of TAT, TRT, and TTS to unknown values ​​or to zero.

[0009] In an embodiment, all inputs of node n have known TAT values, n is a node where s is an input tensor, and the method further includes performing, for a set Q of input tensors, the steps of setting the TRT of n to be the maximum among the TATs of n's inputs s, setting the TTS of each input i of n as the difference between the TRT of n and the TAT of s, setting the TAT of n based on the TRT of n augmented by the node's delay, and including n in Q.

[0010] In an embodiment, a data flow graph includes pairs (N,E), where N includes a set of nodes and E includes a set of hyperedges, and where a particular node in N implements one or more operators on one or more tensors.

[0011] In an embodiment, a particular node comprises a triplet (f,I,O), where f is a function of the operators implemented by the particular node, I is the set of input tensors of the particular node, and O is the set of outputs of the particular node that are generated based on the operators.

[0012] In an embodiment, a hyperedge defines how tensors are passed from operators that produce tensors to operators that use tensors as arguments.

[0013] In an embodiment, a hyperedge comprises a pair (s,H), where s is the output of the node and H is the set of inputs of the node.

[0014] In an embodiment, the method further includes inserting a subgraph node corresponding to the operation into the data flow graph.

[0015] In an embodiment, inserting generates a new data flow graph or modifies an existing data flow graph.

[0016] In an embodiment, the inserting generates a new data flow graph, where the new data flow graph comprises a complete data flow graph or a partial data flow graph.

[0017] In an embodiment, the method further includes processing the set of input tensors using the data flow graph based on the insertion, and generating an output based on the processing.

[0018] In an embodiment, the operation is a memory reduction operation, and the method further includes inserting a memory reduction sub-graph node corresponding to the memory reduction operation.

[0019] In an embodiment, the inserting further includes connecting a first node to the memory reduced subgraph node via a first hyperedge, where the first node corresponds to a source node, and connecting the memory reduced subgraph node to a second node via a second hyperedge, where the second hyperedge comprises a serialization hyperedge and where the second node corresponds to an intermediate or destination node.

[0020] In an embodiment, the inserting further includes connecting the first node to the second node via a third hyperedge.

[0021] In an embodiment, the operation is a memory restore operation, and the method further includes inserting a memory restore subgraph node corresponding to the memory restore operation.

[0022] In an embodiment, the inserting further includes connecting the first node to the memory restoration subgraph node via a first hyperedge, where the first hyperedge includes a serialization hyperedge or a prefetching hyperedge, connecting the memory restoration subgraph node to a second node via a second hyperedge, where the second node corresponds to a destination node, and connecting the memory reduction subgraph node to the memory restoration subgraph node via a third hyperedge.

[0023] In an embodiment, the method further includes connecting two nodes of the data flow graph via a hyperedge, the connecting including either a direct connection via a hyperedge between the two nodes and an indirect connection via one or more additional nodes and a hyperedge between the two nodes.

[0024] In an embodiment, the method steps are performed iteratively to perform at least one memory reduction operation and at least one memory restoration operation to insert a set of subgraph nodes into the flow graph.

[0025] In an embodiment, iteratively performing the method steps includes inserting a set of hyperedges into the flow graph, the set of hyperedges including at least one serialization hyperedge, or at least one prefetch hyperedge, or at least one serialization hyperedge and at least one prefetch hyperedge.

[0026] In an embodiment, the methods described above are stored as programming instructions stored on one or more tangible storage media of one or more computer systems and executed by one or more processors of the one or more computer systems executing the programming instructions. The programming instructions may be stored as a computer programming product.

[0027] According to one aspect, a method is provided for reducing overall GPU memory usage while processing a neural network, the method including automatically determining insertion points for memory-saving operations in an underlying data flow graph including a set of nodes and a set of edges.

[0028] According to another aspect, a method is provided that includes selecting an insertion point for an operation in a data flow graph based on a set of tensor timing slacks (TTS) and a candidate list (SI) of input tensors; computing tensor timing slacks (TTS) for the set of input tensors; assembling a candidate list (SI) of input tensors from the set of input tensors using input tensors having corresponding TTS values ​​greater than a threshold (thTTS); filtering the SI to retain input tensors having sizes that satisfy the threshold (thS); and determining insertion points for reduction and restoration operations using the SI based on the filtering.

[0029] According to another aspect, a method is provided that includes determining to apply a memory reduction action using subgraph node A and node P by identifying a memory requirement of output data generated by node P; sending data from a source node to subgraph node A and node P; allowing subgraph node A to perform the memory reduction action prior to execution of node P, where the memory reduction action causes additional memory space to be made available by a graphics processor (GPU) for executing one or more functions; causing subgraph node B to delay a memory restore action until node Q completes execution; and sending the data from a central processor (CPU) of subgraph node B to the GPU and restoring the data to the GPU.

[0030] According to another aspect, there is provided a computer program comprising program code means adapted to perform the method of any of paragraphs 0027, 0028 or 0029 when said program is run on a computer.

[0031] According to another aspect, a system for reducing overall GPU memory usage while processing a neural network is provided, the system operable to automatically determine insertion points for memory saving operations in an underlying data flow graph including a set of nodes and a set of edges.

[0032] According to another aspect, a system is provided that is operable to select an insertion point for an operation in a data flow graph based on a set of tensor timing slacks (TTS) and a candidate list of input tensors (SI); calculate tensor timing slacks (TTS) for a set of input tensors; assemble a candidate list of input tensors (SI) from the set of input tensors using input tensors that have corresponding TTS values ​​greater than a threshold (thTTS); filter the SI to retain input tensors with sizes that satisfy the threshold (thS); and determine insertion points for reduction and restoration operations using the SI based on the filtering.

[0033] According to another aspect, a system is provided that is operable to determine to apply a memory reduction action using subgraph nodes A and P by identifying memory requirements for output data generated by node P; sending data from a source node to subgraph node A and node P; allowing subgraph node A to perform the memory reduction action prior to execution of node P, where the memory reduction action causes additional memory space to be made available by a graphics processor (GPU) for executing one or more functions; causing subgraph node B to delay a memory restore action until node Q has completed execution; and sending data from a central processor (CPU) of subgraph node B to the GPU and restoring the data to the GPU.

[0034] Preferred embodiments of the present invention will now be described, by way of example only, with reference to the following drawings: [Brief description of the drawings]

[0035] [Figure 1] FIG. 1 depicts a block diagram of a network of data processing systems in which example embodiments may be implemented. [Diagram 2]FIG. 1 illustrates a block diagram of a data processing system in which example embodiments may be implemented. [Diagram 3] FIG. 2 illustrates a data flow graph, according to an example embodiment. [Figure 4] FIG. 2 illustrates a data flow graph including a memory reduction subgraph, in accordance with an example embodiment. [Diagram 5] FIG. 2 illustrates a data flow graph including prefetching and serialization, in accordance with an example embodiment. [Figure 6] FIG. 2 illustrates a data flow subgraph, according to an example embodiment. [Figure 7] FIG. 2 illustrates a data flow subgraph, according to an example embodiment. [Figure 8] FIG. 2 illustrates a data flow subgraph, according to an example embodiment. [Figure 9] FIG. 2 illustrates a data flow subgraph, according to an example embodiment. [Figure 10A] FIG. 4 illustrates a flowchart of an exemplary process for determining insertion points for reduce and restore operations, in accordance with an example embodiment. [Figure 10B] FIG. 4 illustrates a flowchart of an exemplary process for performing timing analysis in accordance with an example embodiment. [Figure 11] FIG. 1 illustrates a memory profile graph, in accordance with an example embodiment. [Figure 12] FIG. 1 illustrates a memory profile graph, in accordance with an example embodiment. [Figure 13] FIG. 1 illustrates a flowchart of an exemplary process for memory reduction in a graphics processor, according to an example embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0036] A GPU only has certain memory spaces that it uses to perform calculations or execute various functions. Example embodiments recognize that the GPU can efficiently move data to the CPU or compress data on the GPU itself to free up additional memory space needed to execute the calculations and / or functions. A swap-out node moves input tensors from the GPU to the CPU. A swap-in node moves data from the CPU back to the GPU. Restoration of data to the GPU is delayed until the data is needed for further calculations.

[0037] Example embodiments recognize that serialization, along with tensor swapping, can minimize GPU memory requirements. Tensor swapping and data compression are used for reduction. Data compression significantly reduces computation time because the GPU compresses data much faster than it can transfer it to the CPU. The application of data compression alone can minimize lost execution time and save memory space. Compressing swapped tensors can reduce the time lost due to data transfer.

[0038] The example embodiments show how proper serialization of data flows improves memory reduction. The example embodiments recognize that data flow graphs, along with memory management, are an efficient technique for training deep neural networks. The data flow graph shows the tensor flow or data flow occurring from the GPU to the CPU and from one data node to another among the nodes of a data processing system. The memory management refers to the GPU being able to efficiently free up additional memory space. Typically, a data flow graph has computation nodes that receive input data and generate output data. The GPU is responsible for the timely allocation and deallocation of these tensors or data. However, the scarcity of GPU memory can impose severe limitations on the size of the data flow graph and the corresponding tensors.

[0039] The example embodiments show how the GPU can free up additional memory space by transferring data to the CPU. However, a problem with swapping data between the GPU and the CPU, where the GPU transfers a portion of the data to the CPU to free up additional memory space, is how to perform this process in a timely manner as the data flows through the data processing system and is transmitted through various nodes. Swapping large amounts of data from the GPU to the CPU can be time consuming. The swap-out node moves data or input tensors from the GPU memory to the CPU memory. The swap-in node, upon memory restoration, moves the data or input tensors back to the GPU memory. Thus, large data flow graphs can be executed using limited GPU memory. The swapping of tensors between the GPU and the CPU and data compression can be effectively used to free up additional memory space required to execute large data flow graphs. The example embodiments recognize that the more tensors involved in the memory savings, the better the memory savings and the larger the data flow graphs that can be processed in the GPU memory due to the additional memory space available in the GPU. Additionally, the GPU may decide to free up memory space by transferring a larger number of smaller or medium-sized tensors, which may take less time than moving larger data to the CPU.

[0040] Example embodiments recognize that the process of memory reduction can be improved by proper serialization or prefetching of the execution of the data flow graph. As a result of swapping tensors with the CPU, the memory requirements of the GPU are significantly reduced. With prefetching, restoration of data to the GPU can be delayed until the data is actually needed.

[0041] Example embodiments recognize that data transfer from one device to another, such as from a GPU to a CPU and from a CPU to a GPU, can take significant time. In embodiments, memory savings should only be applied to tensors that occupy GPU memory for a long enough time without participating in any computation, since memory savings incur time for data transfer, compression, and decompression (the term decompress and other forms of decompression are used interchangeably with uncompress and other forms of decompression). Thus, the GPU can transfer data (tensors) to the CPU and receive the same data from the CPU without participating in any computation or function. With serialization, additional structural changes can be added to the data flow graph in the form of control dependency edges, as opposed to standard data transmission edges. The GPU can swap or transfer tensors (data) to the CPU, freeing up additional memory space required to perform a set of functions or computations.

[0042] In example embodiments, memory restoration can be delayed. Additional structural changes can be added to the data flow graph in the form of control dependency edges. The GPU can retrieve data that it initially forwarded to the CPU to perform functions and / or computations. A node can apply control dependency edges to subgraph nodes to delay memory restoration until the node completes execution.

[0043] In example embodiments, the GPU may also decide not to swap tensors with the CPU or another device. Instead, the GPU may decide to compress the tensors internally to free up additional memory space. Serialization allows the GPU time to start compressing data and free up additional memory space before allowing data transfer between nodes to resume. Prefetching may allow the GPU to delay decompression of data so that nodes can transfer data before the GPU decompresses the compressed data.

[0044] Example embodiments provide memory reduction and memory restoration actions that may enable the GPU to transfer data to the CPU to free up additional memory space for performing computations and / or functions, and then reacquire the data from the CPU after the additional memory space has been used. Example embodiments also provide program products and computer systems that include the aforementioned memory reduction and memory restoration for transferring data to the CPU to free up additional memory space, and then reacquiring the data from the CPU after the additional memory space has been used.

[0045] The example embodiments used to describe the present invention generally address and solve the aforementioned problems of memory management in a GPU in a data processing system in a deep learning system. The example embodiments provide a method, computer program product, and computer system for memory management in a GPU in a deep learning system.

[0046] In an embodiment, timing analysis computes the time moments of events occurring in the data flow graph during execution. Time is the criterion for selecting tensors (data) for memory reduction. Timing analysis also assumes that the computation of data at all outputs of a particular node completes at the same time.

[0047] Timing quantities used in timing analysis include Tensor Arrival Time (TAT), Tensor Required Time (TRT), and Tensor Timing Slack (Slack Time). TAT is the time when the computation on data is completed and the data is available to the operator / node. TRT is the time when the data at the input of a node is required for the execution of the node. TTS is the difference between TRT and TAT.

[0048] The timing analysis algorithm starts by initializing TAT, TRT, and TTS in the data flow graph to be unknown. For each source node in the data flow graph, let TAT, TRT, and TTS = 0. Any node can be selected from the data flow graph to perform timing analysis including TAT, TRT, and TTS.

[0049] Basic criteria for selecting candidate tensors for memory savings include the size of the tensor, tensor timing slack, and the total number of tensors. Small tensors may not be the best candidates for data swapping. In contrast, larger tensor timing slack may remain in CPU memory longer or remain compressed. Furthermore, a larger number of tensors participating in memory savings may free up more GPU memory for other computations.

[0050] In an example embodiment, timing analysis may be used to identify one or more nodes in a data flow group. One or more nodes in a data flow graph that generate output data with the largest memory requirements may be identified. Structural modifiers such as "serialize" and "prefetch" may be inserted into one or more nodes in the data flow graph. Serialization of nodes in a data flow graph is performed by defining a control dependency of one node on another node. Execution of node B does not start before execution of node A is fully completed. This means that the output tensor of node B is not allocated before execution of node A is completed. Prefetching is performed by invoking a control dependency edge from one node to another node to delay tensor reconstruction or memory restoration. The node that applies the control dependency edge completes execution before tensor reconstruction or memory restoration occurs.

[0051] An embodiment provides a method for memory management in a GPU by which the GPU transfers data to the CPU to free up additional memory space for performing one or more functions or calculations. The method also includes memory restoration, where the CPU can return restored data to the GPU. Another embodiment provides a computer program product including program instructions for the GPU to transfer data to the CPU to free up additional memory space. The computer program product also includes program instructions including memory restoration, so that the GPU can again receive data from the CPU. Another embodiment provides a computer system including program instructions for the GPU to transfer data to the CPU. The computer system also includes program instructions for using memory restoration to return data to the GPU.

[0052] Completion time refers to the time when a tensor or data computation is completed at a node and made available to other nodes.By definition, slack time refers to the amount of time the arrival of a particular input can be delayed without causing a delay in the overall operation, or the period of time a tensor waits at the input of a node before it is used in a computation.

[0053] In an embodiment, the addition of a memory device, such as a GPU, is employed within a data processing system where nodes are sending and receiving data. The GPU seeks to execute a function or computation that causes the acquisition of additional memory space. To execute the function or computation, the GPU determines to move the data to the CPU to free up additional memory space within the data processing system. During memory reduction, a subgraph node applies a control dependency edge to the node to enable the GPU to send the data to the CPU to free up additional memory space. During serialization routing, the node is a dependent node and the subgraph node is a control node. The subgraph node and the node are serialized, and the subgraph node performs its execution before the node performs its execution. When a node sends data to another node, another structural change can be added to the data flow graph to serialize the execution of the node. Example embodiments can add multiple structural changes to the data flow graph, and the GPU performs the execution of sending the data to the CPU before the node sends its output data to another node.

[0054] When the GPU has finished using the additional memory space for its intended function, the GPU can reacquire the data it originally forwarded to the CPU, and memory restoration can occur. Another node can apply a control dependency edge to another subgraph node. As a result of the control dependency edge being applied, the restored data is delayed from being sent until the destination node that receives the restored data requires the restored data and until the control node that applied the control dependency edge has completed execution. The CPU can send the data to the destination node to be restored to the GPU when the node that applied the control dependency edge has completed execution.

[0055] In an embodiment, the GPU can also compress the data by a ratio to provide additional memory space to perform the desired function or calculation without sending the data to the CPU. The GPU can compress the data from 32 bits to 16 bits to create additional memory space. In other example embodiments, the GPU can compress the data by a different ratio (i.e., 32 bits to 24 bits or 32 bits to 8 bits). The subgraph node applies a control dependency edge to the node that received the data from the source node. The GPU can complete the execution of the compression of the data. The node is serialized and transmits the received data after the GPU finishes compressing the data. The control dependency edge can delay other subgraph nodes from decompressing the data until the node completes execution. The GPU cannot receive the decompressed data until the node that applied the control dependency edge completes execution.

[0056] As used herein, the term data flow graph may be defined according to one of the following exemplary non-limiting definitions:

[0057] Definition 1: A data flow graph is a pair (N,E), where N is the set of nodes and E is the set of hyperedges. The nodes implement operators on tensors. Each node is a triplet (f,I,O), where f is a function of the operator implemented by the node, I is the set of the node's inputs that correspond to the arguments of the operator, and O is the set of the node's outputs that correspond to the tensors computed by the operator. A hyperedge defines how tensors are passed as arguments from operators that compute tensors to operators that use tensors. Each hyperedge is a pair (s,H), where s is the output of the node and H is the set of the node's inputs. s and H={h1,h2,...} are the set of sources and sinks of the hyperedge, respectively. Hypergraphs differ from traditional graphs: an edge in a traditional graph always contains one sink. A hyperedge may contain multiple sinks, and the same tensor is used as an argument by multiple operators. Nodes in a hypergraph have a more complex structure than nodes in a traditional graph. The arguments and results of different operators may have different meanings, sizes, and dimensions. Thus, the inputs and outputs of a node in a hypergraph may be identified and uniquely labeled. A node in a traditional graph can only represent an operator with a single argument and a single result. In addition to defining the sources and sinks of a hyperedge as the inputs and outputs of a node, it is convenient to describe the source nodes and sink nodes of a hyperedge. These are defined as follows:

[0058] Definition 2: The nodes corresponding to the source and sink of a hyperedge are called the source node and sink node of the hyperedge, respectively.

[0059] Definition 3: A hyperedge connected to the input of a node is called the incoming hyperedge of that node, and a hyperedge connected to the output of that node is called the outgoing hyperedge of that node.

[0060] Definition 4: A successor input of a node is the sink of the node's outgoing hyperedge.

[0061] Definition 5: A successor of a node is a sink node of the node's outgoing hyperedge. Note that we distinguish between the inputs of a successor and its successors. The former are the inputs of a node, and the latter are the node itself.

[0062] Accordingly, one or more embodiments provide a method for enabling memory management. Various embodiments provide a method for enabling memory management in a deep learning system.

[0063] For clarity of explanation, and without implying any limitation, the example embodiments are described using some exemplary configurations. From this disclosure, those skilled in the art will be able to think of many changes, adaptations, and modifications of the described configurations to achieve the described objectives. The same are contemplated within the scope of the example embodiments.

[0064] Furthermore, a simplified diagram of a data processing environment is used in the figures and example embodiments: in an actual computing environment, there may be additional structures or components not shown or described herein, or structures or components for functions different from those shown but similar to those described herein, without departing from the scope of the example embodiments.

[0065] Furthermore, for purposes of example only, the example embodiments are described with reference to specific actual or hypothetical components. The steps described by the various example embodiments may be adapted using a variety of components that are intended or can be repurposed to provide the described functionality within a data processing environment, and such adaptations are contemplated within the scope of the example embodiments.

[0066] The example embodiments are described with respect to particular types of steps, applications, and data processing environments, merely as examples. Any particular manifestation of these and other similar artifacts is not intended to limit the invention. Any suitable manifestation of these and other similar artifacts may be selected within the scope of the example embodiments.

[0067] The examples in this disclosure are used merely for clarity of explanation and are not limiting to these example embodiments. The advantages shown herein are merely examples and are not intended to be limiting to these example embodiments. Additional or different advantages may be realized by certain example embodiments. Furthermore, certain example embodiments may include some, all, or none of the above advantages.

[0068]

[0023] Referring now to the figures, and in particular to Figures 1 and 2, which are exemplary diagrams of data processing environments in which example embodiments may be implemented, Figures 1 and 2 are merely examples in which various embodiments may be implemented. No limitation is intended to be asserted or implied with respect to the environments. Particular implementations may make many modifications to the depicted environments based on the following description.

[0069] 1 illustrates a block diagram of a network of data processing systems in which example embodiments may be implemented. Data processing environment 100 is a network of computers in which example embodiments may be implemented. Data processing environment 100 includes network 102. Network 102 is the medium used to provide communications links between various devices and computers connected together within data processing environment 100. Network 102 may include connections, such as wires, wireless communication links, or fiber optic cables.

[0070] Client or server are merely exemplary roles of particular data processing systems connected to network 102 and are not intended to exclude other configurations or roles of these data processing systems. Server 104 couples to network 102. Software applications may be executed on any quantum data processing system in data processing environment 100. Any software application described as executing in server 104 of FIG. 1 can be configured to execute in another data processing system in a similar manner. Any data or information stored or generated in server 104 of FIG. 1 can be stored or generated in another data processing system in a similar manner. A classical data processing system, such as server 104, may contain data and may have software applications or software tools that perform classical computing processes.

[0071] A server 106 is coupled to the network 102 along with a storage unit 108. The storage unit 108 is configured to store neural network training data as described herein with respect to various embodiments. The server 106 is a conventional data processing system. Software applications may be executed on any quantum data processing system within the data processing environment 100. Any of the software applications described may be configured to run in another data processing system in a similar manner.

[0072] Clients 110, 112, and 114 are also coupled to network 102. A conventional data processing system, such as server 106 or clients 110, 112, or 114, may contain data and may include software applications or software tools that perform conventional computing processes.

[0073] Merely by way of example, and without any implication of limitation to such architecture, FIG. 1 illustrates certain components that may be used in an exemplary implementation of the embodiments. For example, server 106 and clients 110, 112, 114 are illustrated as servers and clients, merely by way of example, and not meant to be limited to a client / server architecture. As another example, within the scope of the exemplary embodiments, an embodiment may be distributed across multiple conventional data processing systems, quantum data processing systems, and data networks, as shown, while another embodiment may be implemented on a single conventional data processing system or a single quantum data processing system. Conventional data processing systems 106, 110, 112, and 114 also represent exemplary nodes within clusters, partitions, and other configurations suitable for implementing the embodiments.

[0074] Device 132 is an example of a conventional computing device as described herein. For example, device 132 may take the form of a smartphone, a tablet computer, a laptop computer, a fixed or portable client 110, a wearable computing device, or any other suitable device. Any software applications described as executing within another conventional data processing system of FIG. 1 may be configured to execute within device 132 in a similar manner. Any data or information stored or generated within another conventional data processing system of FIG. 1 may be configured to be stored or generated within device 132 in a similar manner.

[0075] Server 106, storage unit 108, classical processing system 104, quantum processing system 140, clients 110, 112, and 114, and device 132 may be coupled to network 102 using wired connections, wireless communication protocols, or other suitable data connections. For example, clients 110, 112, and 114 may be personal computers or network computers.

[0076] In the illustrated example, server 106 may provide data, such as boot files, operating system images, and applications, to clients 110, 112, and 114. Clients 110, 112, and 114 may be clients of server 106 in this example. Clients 110, 112, 114, or any combination thereof, may include their own data, boot files, operating system images, and applications. Data processing environment 100 may include additional servers, clients, and other devices not shown.

[0077] Data processing environment 100 may include additional memory, quantum processors, and other devices not shown. In the illustrated example, data processing environment 100 may be the Internet. Network 102 may represent a collection of networks and gateways that communicate with one another using Transmission Control Protocol / Internet Protocol (TCP / IP) and other protocols. At the heart of the Internet is a backbone of data communication links between major nodes or host computers, including thousands of commercial, government, educational, and other computer systems that route data and messages. Of course, data processing environment 100 may be implemented as a number of different types of networks, such as, for example, the Internet, a local area network (LAN), or a wide area network (WAN). FIG. 1 is intended as an example, and not as an architectural limitation for various example embodiments.

[0078] Among other uses, the data processing environment 100 may be used to implement a client / server environment in which example embodiments may be implemented. A client / server environment allows software applications and data to be distributed across a network such that applications function by using interactivity between traditional client and server data processing systems. The data processing environment 100 may employ a service-oriented architecture in which interoperable software components distributed across a network may be packaged together as a coherent business application. The data processing environment 100 may take the form of a cloud and employ a cloud computing model of service delivery to enable convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, network bandwidth, servers, processing, memory, storage, applications, virtual machines, and services) in which these resources may be rapidly provisioned and released with minimal administrative effort or interaction with a service provider.

[0079] Referring to Figure 2, this figure illustrates a block diagram of a data processing system in which example embodiments may be implemented. Data processing system 200 is an example of a conventional computer, such as classical processing system 104, server 106, or clients 110, 112, and 114 of Figure 1, or another type of device, in which computer usable program code or instructions that implement the processes of example embodiments may be located.

[0080] Data processing system 200 also represents a conventional data processing system or configuration within which computer usable program code or instructions implementing the processes of the example embodiments may be located. Data processing system 200 is described as a computer by way of example only, and not by way of limitation. Implementations in the form of other devices may modify data processing system 200, such as by adding a touch interface, and certain components illustrated in the figures may be removed from data processing system 200, without departing from the general operation and functionality of data processing system 200 described herein.

[0081] In the illustrated example, data processing system 200 employs a hub architecture including a North Bridge and memory controller hub (NB / MCH) 202 and a South Bridge and input / output (I / O) controller hub (SB / ICH) 204. A processing unit 206, a main memory 208, and a graphics processor 210 are coupled to North Bridge and memory controller hub (NB / MCH) 202. Processing unit 206 may include one or more processors and may be implemented using one or more heterogeneous processor systems. Processing unit 206 may be a multi-core processor. Graphics processor 210 may be coupled to NB / MCH 202 via an accelerated graphics port (AGP) in certain implementations.

[0082] In the illustrated example, a local area network (LAN) adapter 212 is coupled to the south bridge and I / O controller hub (SB / ICH) 204. An audio adapter 216, a keyboard and mouse adapter 220, a modem 222, a read only memory (ROM) 224, a universal serial bus (USB) and other ports 232, and PCI / PCIe devices 234 are coupled to the south bridge and I / O controller hub 204 via a bus 238. A hard disk drive (HDD) or solid-state drive (SSD) 226 and a CD-ROM 230 are coupled to the south bridge and I / O controller hub 204 via a bus 240. The PCI / PCIe devices 234 may include, for example, an Ethernet adapter, an add-in card, and a PC card for a notebook computer. PCI uses a card bus controller, whereas PCIe does not. ROM 224 may be, for example, a flash binary input / output system (BIOS). Hard disk drive 226 and CD-ROM 230 may use, for example, integrated drive electronics (IDE), serial advanced technology attachment (SATA) interfaces, or variants such as external SATA (eSATA) and micro-SATA (mSATA). Super I / O (SIO) devices 236 may be coupled to south bridge and I / O controller hub (SB / ICH) 204 via bus 238.

[0083] Memory such as main memory 208, ROM 224, or flash memory (not shown) are examples of computer usable storage devices. Hard disk drives or solid state drives 226, CD-ROM 230, and other similarly usable devices are examples of computer usable storage devices that include computer usable storage media.

[0084] An operating system executes on the processing unit 206. The operating system coordinates and controls various components within the data processing system 200 of FIG. 2. The operating system may be a commercially available operating system for any type of computing platform, including, but not limited to, server systems, personal computers, and mobile devices. An object-oriented or other type of programming system may interface with the operating system to provide calls to the operating system from programs or applications executing on the data processing system 200.

[0085] Instructions for the operating system, the object oriented programming system, and applications or programs may be located in a storage device, such as in the form of code 226A on the hard disk drive 226, and loaded into at least one of one or more memories, such as main memory 208, for execution by the processing unit 206. The processes of the example embodiments may be executed by the processing unit 206 using computer-implemented instructions, which may be located in a memory, such as the main memory 208, the read-only memory 224, or in one or more peripheral devices.

[0086] Further, in one case, the code 226A may be downloaded via the network 201A from a remote system 201B where similar code 201C is stored in a storage device 201D. In another case, the code 226A may be downloaded to the remote system 201B via the network 201A, and the downloaded code 201C is stored in the storage device 201D.

[0087] The hardware in Figures 1-2 may vary depending on the implementation. Other internal hardware or peripheral devices, such as flash memory, equivalent non-volatile memory, or optical disk drives, may be used in addition to or in place of the hardware depicted in Figures 1-2. Additionally, the processes of the example embodiments may be applied to multiprocessor data processing systems.

[0088] In some examples, data processing system 200 may be a personal digital assistant (PDA), typically configured using flash memory to provide non-volatile memory for storing operating system files and / or user generated data. The bus system may include one or more buses, such as a system bus, an I / O bus, and a PCI bus. Of course, the bus system may be implemented using any type of communications fabric or architecture that provides for a transfer of data between different components or devices attached to the communications fabric or architecture.

[0089] The communications unit may include one or more devices used to transmit and receive data, such as a modem or network adapter. The memory may be, for example, main memory 208 or a cache, such as a cache found in north bridge and memory controller hub 202. The processing unit may include one or more processors or CPUs.

[0090] 1-2 and above-described examples are not meant to imply architectural limitations. For example, data processing system 200 may be a tablet computer, a laptop computer, or a telephone device in addition to taking the form of a mobile or wearable device.

[0091] When a computer or data processing system is described as a virtual machine, virtual device, or virtual component, the virtual machine, virtual device, or virtual component operates in the manner of data processing system 200 using a virtualized manifestation of some or all of the components depicted in data processing system 200. For example, in a virtual machine, virtual device, or virtual component, processing unit 206 is manifested as a virtualized instance of all or a portion of the number of hardware processing units 206 available in the host data processing system. Main memory 208 is manifested as a virtualized instance of all or a portion of main memory 208 that may be available in the host data processing system. Disk 226 is manifested as a virtualized instance of all or a portion of disk 226 that may be available in the host data processing system. In such a case, the host data processing system is represented by data processing system 200.

[0092] Referring to FIG. 3, this figure shows a data flow graph including data transfers between nodes in the data processing system 200. FIG. 3 is shown without the memory saving modifications proposed by the present invention described in the following figures. The nodes shown in FIG. 3 are a portion of the nodes that may actually occur in a neural network. In yet other embodiments, the data flow graph may consist of more than 1000 nodes. The nodes in FIG. 3 and the remaining figures described take data items (tensors) as input, operate on that data, and generate new data at output. The nodes may be executed whenever all of the input data is available. In response, the nodes that generate output data are already executed. A source node 300 may receive data and may send output data to multiple nodes in the data processing system 200. For example, the source node 300 may send output data to a second node 302. The second node 302 may also send output data to a third node 304. Furthermore, the third node 304 sends output data to a fourth node 306. The fourth node 306 can send output data received from the third node 304 to the fifth node 308. The source node 300 also sends output data to the fifth node 308 and to the destination node 310. The fifth node 308 also sends output data received from the fourth node 306 and the source node 300 to the destination node 310. The process of data transfer between nodes in the data flow graph can be repeated as necessary. A node that sends data has a completion time. Completion time refers to the time when the data is completed at the node and available to other nodes. Slack time refers to the amount of time the arrival of a particular input can be delayed without causing a delay in the overall operation, or the period of time data waits at the input of a node until it is used in the computation.

[0093] Referring to FIG. 4, this figure shows a data flow graph with a similar configuration to FIG. 3. In addition, FIG. 4 employs memory reduction and memory restoration subgraph insertion. The GPU in the data processing system 200 often does not include the memory required to perform a certain calculation or function that requires additional memory space. As a result, the GPU can, for example, move data occupying the required memory space to the CPU. The memory reduction node 301 shows that the GPU transfers data to the CPU to perform the required function or calculation that requires additional memory space. The second node 302 executes immediately after the node 300, thereby allowing the second node 302 to allocate memory space for its own output data, while at the same time, the node 301 may be busy copying data to the CPU memory. After the node 301 completes the copy and releases the memory held by the input tensor, the subgraph node 312 simply takes the stored data back from the CPU to the GPU, since there is nothing to stop it from immediately initiating its own memory restoration action.

[0094] Continuing with reference to FIG. 4, the same sequence of events occurs in a second invocation of the memory reduce / restore subgraph on the right side of FIG. 4, which includes the third node 304, subgraph nodes 311 and 322, and the fourth node 306. The third node 304 sends output data to the subgraph node 311. The subgraph node 311 moves data to the subgraph node 322. The subgraph node 322 moves data to the fourth node 306. The fourth node 306 sends output data to the fifth node 308. The fifth node 308 receives data from the subgraph node 312. The fifth node 308 sends output data to the destination node 310. In a parallel execution, while the fifth node 308 is sending output data to the destination node 310, the subgraph node 312 continues to move data to the destination node 310.

[0095] Referring to FIG. 5, it has been determined that the use of data at nodes 416 and 418 is not imminent and therefore can be delayed by the memory reduction action represented by subgraph node 401. This action requires its counterpart in the form of a memory restoration action represented by subgraph node 413. One intent of the inserted subgraph containing subgraph nodes 401 and 413 is to free GPU memory from the need to store the output tensor data of node 400 for long periods of time. The tensor is not needed until node 416 is executed after node 402 utilizes it. There are three more additional preparatory (i.e., additional control dependency edges labeled with the words “serialize” and “prefetch” represented in the data flow graph by dashed arrows) that form part of the inserted subgraph. The first edge is from subgraph node 401 to node 402.

[0096] 5, the meaning of the control dependency edge from node A to node B is to make the execution of node B dependent on node A. In an embodiment, node B must wait to start the operation of node B until node A has completed its operation. Therefore, the control dependency edge can be seen as the data output of node A to the input of the dependent node B, where no actual data is transferred but instead a completion message is signaled. The reason for inserting the control dependency edge from subgraph node 401 to the second node 402 is to ensure that the execution of node 402 is delayed until the memory reduction by subgraph node 401 is completed. Otherwise, node 402 would be executed immediately after source node 400 is executed, allocating additional GPU memory for its own output tensor. This is avoided by the "serialization" edge from subgraph node 401 to node 402. Subgraph node 401 and node 402 are guaranteed to be executed serially. Subgraph node 401 completes execution before node 402. Node 402 can send output data to node 404. Node 404 can send output data to node 406 and node 414. Subgraph nodes 411 and 408 play the same role as subgraph nodes 401 and 402.

[0097] 5 and referring to memory restore node 413, on the contrary, without further preparation, memory restore node 413 is executed immediately after subgraph node 401 completes execution. However, this does not serve the purpose of memory reduction. In an embodiment, it may be necessary to delay the execution of subgraph node 413 until the nodes that require data as input (nodes 416 and 418) are ready to execute. Therefore, a control dependency edge is required as an input to subgraph node 413 so that subgraph node 413 waits for the control node to complete. The control node cannot be node 416 or node 418 because an additional dependency edge would cause a cycle in the graph, which is not allowed. The control node should be any node upstream from node 416. Node 410 sends output data to node 412. Node 412 sends output data to node 414. Therefore, node 414 is selected to apply a "prefetch" edge to subgraph node 413. As soon as node 414 completes its operation, it outputs the tensor to node 416 and at the same time signals, via a "prefetch" edge, to subgraph node 413 that it may initiate a restore action. The initiation of the restore action should be such that by the time the restore action completes, one or more nodes waiting for the restored data are ready to be executed, i.e., data to their other inputs has already arrived.

[0098] With respect to FIG. 5, a third control dependency edge (a second edge labeled “serialize”) is shown in FIG. 5 as extending from node 412 to subgraph node 413. This edge provides subgraph node 413 with a second condition for the initiation of a restore action. Its purpose is to serialize subsequent restore actions (which in this case include the restore actions of subgraph nodes 423 and 413). Subgraph node 423 restores the tensors utilized by node 412. As soon as node 412 completes its execution (and thus memory for its input tensors is free), it allows subgraph node 413 to start executing, but only if all other inputs are also available. Node 413 must wait some more time for a “prefetch” signal to come from node 414. After the “prefetch” signal is received, subgraph node 413 restores the tensors and sends the data to nodes 416 and 418. Node 416 now has all of its inputs available and therefore executes to generate the output tensors that node 418 requires as inputs. Node 418 now also has input data available and executes.

[0099] Continuing with reference to FIG. 5, the two control dependencies targeted at node 413 play different roles. The “prefetch” dependency ensures that subgraph node 413 does not immediately restore the data that was reduced by node 401. There will be a delay until the node waiting for the restored data is ready at its other inputs. The “serialize” dependency ensures that the two restorations do not occur at the same time, which could cause too much memory usage for all restored tensors at the same time. In an example embodiment, since “prefetch” starts after “serialize”, the “prefetch” signal can be said to dominate the “serialize” signal. In yet another example embodiment, “serialize” can dominate the “prefetch” signal.

[0100] Referring to Figure 6, an embodiment is shown in which the GPU moves data to the CPU to free up memory space for executing one or more functions or calculations. As in Figure 5, serialization and prefetching are utilized.

[0101] With further reference to FIG. 6, a particular invocation of an inserted subgraph dealing with a memory reduction action and a memory restoration action is shown. Here, the memory reduction action is represented by a single node that includes an operation to copy an incoming tensor from GPU memory to CPU memory. Data swapped from GPU memory to CPU memory can be a swap-out action. After the copy action is completed, the GPU memory that originally held the data may now be freed. The node 501 representing this action is labeled "Copy to CPU". The counterpart of this action is established by a restore node 507 labeled "Copy from CPU". The purpose is to copy the tensor from CPU memory back to GPU memory. Before the copy begins, GPU memory must be allocated to hold the restored tensor. Afterwards, the CPU memory holding the tensor may be freed.

[0102] Referring to FIG. 6, a source node 500 receives data and transmits this data to a node 501 and a second node 502. Memory reduction starts and the node 501 (the control node) activates a control dependency edge (denoted by "serialize" using dotted lines and arrows) to the second node 502 or a dependent node. The execution of the second node 502 must wait until the node 501 completes its execution. Thus, the execution of the node 501 and the second node 502 is serialized. The second node 502 forwards the output data to another node. The other node (not shown) can apply a control dependency edge (denoted by "serialize") to the node 507 to ensure that the node 507 performs the transmission of the restored data after the other node performs the transmission of the output data. The third node 504 can transmit the output data to a fourth node 506. The fourth node 506 can apply a control dependency edge (denoted by "prefetch") to the node 507. Therefore, node 507 is delayed from forwarding the reconstructed data to the GPU until the fourth node 506 sends its output data to the destination node 508. After the fourth node 506 executes, node 507 sends its data to the destination node 508.

[0103] Referring to FIG. 7, another data flow graph illustrating data transfer and memory management is shown. The GPU may not only decide to move data to the CPU to free up memory space required to execute one or more large functions or calculations. The GPU may decide to compress data by a ratio (i.e., 32-bit to 16-bit, 32-bit to 8-bit, etc.) to obtain the required memory space without moving the data to the CPU. In other example embodiments, the GPU may compress data in various ways. In this example embodiment, the GPU compresses data such as large tensors from 32-bit floating point numbers to 16-bit floating point numbers (see FIG. 11). In other words, the GPU may compress data from 32-bit to 16-bit to free up memory space to execute functions and / or calculations.

[0104] Continuing with reference to FIG. 7, a source node 600 receives input data and sends the data to a node 601 and a second node 602. The node 601 is a control node that applies a control dependency edge ("serialize"), and the second node 602 is a dependent node. The second node 602 waits until the node 601 completes execution. The second node 602 sends the output data after the node 601 compresses the data to free up memory space. Another node (not shown) can enable the control dependency edge ("serialize") to the node 606. The node 606 waits to decompress the data until the other node completes execution. The third node 609 receives the data and sends the output data to a fourth node 605. The fourth node 605 can enable the control dependency edge ("prefetch") to the subgraph node 606. Node 606 waits to decompress and restore the data until the fourth node 605 completes its own execution and sends the output data to the destination node 607. After the fourth node 605 executes, node 606 can complete execution. The data can be decompressed and sent to the destination node 607.

[0105] With respect to FIG. 8, the GPU can compress data and transfer the compressed data to the CPU to free up additional memory space. Memory reduction can occur where the GPU compresses data and sends the compressed data to the CPU before another node sends the data to the next node. Memory restoration can occur where the CPU is delayed from decompressing data and sending it back to the GPU until the destination node needs the data.

[0106] 8, source node 700 receives data and sends this data to node 701 and second node 702. Node 701 applies a control dependency edge to second node 702. Execution of second node 702 must wait until node 701 compresses the data, sends the compressed data, and copies the compressed data to the CPU. Node 707 is part of the reconstruction structure. Thus, execution of subgraph node 701 and second node 702 is serialized. The GPU can use additional memory space to perform one or more functions or calculations. Second node 702 can send output data to a next node (not shown). Node (not shown) can apply a control dependency edge to node 707, which contains the compressed data on the CPU. In an embodiment, node 707 must wait to copy the compressed data back to the GPU until the control dependency is enabled by the other node. Node 707 completes execution of copying the compressed data back to the GPU after the other node completes execution.

[0107] Referring to Figure 8, a third node 704 receives the data and sends the output data to a fourth node 706, which executes a control dependency edge to node 707. Node 707 copies the data again and waits to send it to the node labeled "Decompress to FP32". As soon as both control dependency inputs are satisfied, node 707 copies the data again from the CPU memory to the GPU memory and sends the data to be decompressed. After decompression, the restored data is made available to node 708.

[0108] 9, a situation may arise where restoration actions should overlap to satisfy different destination nodes. While the memory reduction operation represented by node 801 is singular, in this case, experimental data establishes that it is beneficial to have two separate restoration actions for that data, represented by nodes 813 and 807. In an example embodiment, the GPU may take back the same data from the CPU as many times as necessary to free up additional memory space for performing computations and / or other functions.

[0109] Referring to FIG. 9, a source node 800 sends data to a node 801 and a second node 802. Serialization is implemented by the addition of a control dependency edge from node 801 to the second node 802. Node 801 copies the data to CPU memory. The execution of node 801 and the second node 802 is serialized, and after the execution of node 801, the second node 802 sends the output data to the next node (not shown). The figure further shows two instances of the memory restoration subgraph in the form of nodes 807 and 813. Both nodes 807, 813 have two receive control dependencies, respectively, that establish serialization and prefetch readiness as described in the previous figure.

[0110] 9, a third node 804 receives the data and sends output data to a fourth node 806. The fourth node 806 can apply a control dependency edge to node 807. The node 807 waits until the fourth node 806 completes execution before taking the data from the CPU and sending it to the destination node 808. The node 807 sends the recovered data to the destination node 808.

[0111] With respect to FIG. 9 , the same restoration situation includes nodes 813, 814, 812, and 810. After a node not shown executes and signals a “serialize” edge, and the execution of node 812 also signals a “prefetch” edge, the same data stored in CPU memory by the execution of node 801 is retrieved back to the GPU by node 813 as soon as the control dependency of node 813 is satisfied. The fifth node 810 can also receive data and send output data to the sixth node 812. The sixth node 812 is the source of the “prefetch” control dependency to node 813. The restoration of the CPU’s data to the GPU is delayed until the execution of the sixth node 812 is completed. In response, node 813 sends the data to the destination node 814.

[0112] 10A, a flow diagram of an example process 1100 for determining insertion points for reduce and restore operations is shown. The method 1100 may be practiced by executing programming instructions stored on a tangible storage medium (e.g., a storage medium described in connection with FIGS. 1 and 2) using a processor.

[0113] In this embodiment, any user configuration information may be assumed. First, a threshold thTTS may be defined for tensor timing slack (TTS), and only tensors with slack values ​​greater than this threshold are considered as candidates for insertion points. Second, a threshold thS may be defined for tensor size, and only tensors with a size (e.g., in bytes) greater than this threshold are considered as candidates for insertion points. Third, a maximum value N may be defined for the number of insertions to consider.

[0114] Based on these assumptions, in block 1102, a timing analysis computes tensor timing slack (TTS) for a set of input tensors (eg, all input tensors of all data flow graph nodes).

[0115] At block 1104, a candidate list SI is compiled that includes tensors that have a TTS value greater than thTTS and a size greater than thS among the input tensors of the node of the data flow graph.

[0116] At decision block 1106, a determination is made as to whether the size of the candidate list SI is greater than N.

[0117] At block 1108 (the "yes" branch of decision block 1106), the candidate list SI is sorted in descending order according to tensor size. Only the top N elements in the list are kept in the list, and other tensors are removed from the candidate list SI. Other sorting or thresholding mechanisms may be used as well.

[0118] At block 1110 (either the "No" branch of decision block 1106 or completion of block 1108), the candidate list SI is returned as a list of candidate nodes for insertion points for a memory reduction operation or a memory restoration operation according to embodiments of the invention described in connection with other figures.

[0119] 10B, a flow diagram of an example process 1200 for performing timing analysis is shown. The method 1200 may be practiced by executing programming instructions stored on a tangible storage medium (e.g., a storage medium described in connection with FIGS. 1 and 2) using a processor.

[0120] 10B, a process 1200 starts according to the illustrated embodiment. At step 1202, the process 1200 initializes the values ​​of TAT, TRT, and TTS for all data flow graph nodes to be unknown. At step 1204, the process 1200 defines a data set Q, where Q is the set of all data flow graph source nodes. The process 1200 further sets the values ​​of TAT, TRT, and TTS for the elements of Q to be zero (0).

[0121] In step 1206, process 1200 checks whether Q is empty. If yes, the process ends (step 1218). However, if no (i.e., while Q is not empty), process 1200 selects an arbitrary element q of Q (step 1208) and excludes q from Q.

[0122] At step 1210, process 1200 determines whether all sink inputs s of q have been processed. If yes, process 1200 considers the next q (a check performed at step 1206). However, if no, process 1200 processes s as provided at step 1212, whereby process 1200 sets the TAT of s to be equal to the TAT of node q. Process 1200 further defines n (at step 1212) to be the node to which node's input s belongs. Process 1200 determines whether all inputs i of node n have known TAT values ​​(step 1214). If no, process 1200 considers the next s and iterates as a while loop to process the remaining sink inputs s of q, as identified at step 1210.

[0123] However, if yes (determination at step 1214), process 1200 proceeds to step 1216, where process 1200 sets the TRT of node n as the maximum of the TATs of node n's inputs, sets the TTS of each input I as the difference between n's TRT and i's TAT, sets node n's TAT ​​as the TRT increased by the corresponding node's delay, and includes n in Q.

[0124] If Q is empty (determined in step 1206), the process 1200 ends (step 1218), whereby the values ​​of TAT, TRT, and TTS for all nodes have been determined through the previous steps.

[0125] In an embodiment, a timing analysis as described in process 1200 traverses a data flow graph from sources to sinks and calculates the TAT, TRT, and TSS according to the definition implemented by this process, which is performed in a manner that is linear in time in the size of the data flow graph.

[0126] 11, a memory profile graph of the GPU described in the example embodiment above is shown. The example embodiment GPU includes 16 gigabytes (GB) of memory. In other example embodiments, the GPU may include even larger memory space. As the GPU executes functions and calculations, more and more memory is allocated to the intended functions and calculations until a peak is reached where no memory space remains. After the peak is reached, memory is freed with the last allocated memory being freed first.

[0127] With reference to Figure 12, a memory profile graph of the GPU described in the example embodiment above is shown. When the GPU decides to compress data internally to create additional memory space as shown above in Figures 7 and 8, large data tensors in the GPU are compressed from 32-bit floating point to 16-bit floating point or from 32-bit to 16-bit. As a result, half of the memory space is freed up and the batch size of data in memory is doubled before the memory in the GPU peaks.

[0128] With reference to FIG. 13, a flow diagram of an exemplary process 1000 for performing various functions according to an embodiment is shown. At block 1002, a decision is made to apply a memory reduction action using subgraph nodes A and P by identifying memory requirements of output data generated by node P (e.g., in the context of FIG. 5, node A can refer to subgraph 401 and node P can refer to node 402). At block 1004, a source node sends data to subgraph nodes A and P. At block 1006, subgraph node A applies a control dependency edge to node P. The execution of subgraph nodes A and P is serialized. Subgraph node A executes before node P. Here, the action of subgraph node A is to copy the incoming tensor from GPU memory to CPU memory. The data swapped from GPU memory to CPU memory can be a swap-out action. After the copy action is completed, the GPU memory that originally held the data may now be freed. The GPU can use the additional memory space to execute one or more functions or calculations. At block 1008, node P sends output data to node Q. At block 1010, node Q applies a control dependency edge to subgraph node B. The control dependency edge ensures that subgraph node B delays memory restore actions until node Q completes execution. There will be a delay until the node waiting for the restored data is ready at its other inputs. At block 1012, node Q sends output data to the destination node. Further, at block 1014, subgraph node B sends the restored data to the destination node.

[0129] Some embodiments of the present invention will now be described more generally. In the following description, where appropriate, direct reference may be made to one or more figures, but it should be understood that the embodiments are not limited to the particular figures.

[0130] According to an embodiment of the invention, there is provided a method for processing a data flow graph of a neural network including a set of nodes and a set of edges (e.g., as defined above according to Definitions 1-5). The steps of the method are performed, e.g., as described in Figures 10A and 10B, to generate a data flow graph or modify a data flow graph, e.g., as described in relation to Figures 3-9. The steps of the method are stored (e.g., as a computer program product) in a tangible storage device of a computer system, such as the storage device described in relation to Figures 1-2.

[0131] The method computes tensor timing slack (TTS) for a set of input tensors, assembles a candidate list (SI) of input tensors from the set of input tensors using input tensors with corresponding TTS values ​​greater than a threshold (thTTS), filters the SI to retain input tensors whose size satisfies a threshold (thS), and based on this filtering, uses the SI to determine an insertion point for the action.

[0132] According to an embodiment of the method, the operations are a combination of reduce and restore operations, where the reduce operation includes either or both of a copy operation to a central processing unit (CPU) memory and a compression operation, and the restore operation includes either or both of a copy operation from the CPU memory and a decompression operation.

[0133] According to an embodiment of the method, computing the TTS includes performing a timing analysis using the input tensor.

[0134] According to an embodiment of the method, the timing analysis includes initializing values ​​of tensor arrival time (TAT), tensor required time (TRT), and tensor timing slack (TTS) for input tensors, and performing, for a set Q of input tensors, while Q is not empty, the steps of selecting a node q in Q for removal, removing q from Q, and for each input tensor s succeeding q, setting the TAT of s equal to the TAT of q.

[0135] According to an embodiment of the method, initializing includes initializing values ​​of TAT, TRT, and TTS to unknown values ​​or to zero.

[0136] According to an embodiment of the method, all inputs of node n have known TAT values, n is a node where s is an input tensor, and the method further includes performing, for a set Q of input tensors, the steps of setting the TRT of n to be the maximum among the TATs of n's inputs s, setting the TTS of each input i of n as the difference between the TRT of n and the TAT of s, setting the TAT of n based on the TRT of n augmented by the node's delay, and including n in Q.

[0137] According to an embodiment of the method, a data flow graph includes pairs (N,E), where N includes a set of nodes and E includes a set of hyperedges, and where a particular node in N implements one or more operators on one or more tensors.

[0138] According to an embodiment of the method, a particular node includes a triplet (f,I,O), where f is a function of the operators implemented by the particular node, I is the set of input tensors of the particular node, and O is the set of outputs of the particular node that are generated based on the operators.

[0139] According to an embodiment of this method, hyperedges define how tensors are passed from operators that produce tensors to operators that use tensors as arguments.

[0140] According to an embodiment of the method, a hyperedge comprises a pair (s,H), where s is the output of the node and H is the set of inputs of the node.

[0141] According to an embodiment of the method, the method further includes inserting a subgraph node corresponding to the operation into the data flow graph.

[0142] According to an embodiment of the method, inserting generates a new data flow graph or modifies an existing data flow graph.

[0143] According to an embodiment of the method, the inserting generates a new data flow graph, the new data flow graph comprising a complete data flow graph or a partial data flow graph.

[0144] According to this method embodiment, the method further includes processing the set of input tensors using the data flow graph based on the insertion, and generating an output based on the processing.

[0145] According to an embodiment of the method, the operation is a memory reduction operation, and the method further includes inserting a memory reduction sub-graph node corresponding to the memory reduction operation.

[0146] According to an embodiment of the method, the inserting further includes connecting a first node to the memory reduced subgraph node via a first hyperedge, where the first node corresponds to a source node, and connecting the memory reduced subgraph node to a second node via a second hyperedge, where the second hyperedge includes a serialized hyperedge and where the second node corresponds to an intermediate node or a destination node.

[0147] According to an embodiment of the method, the inserting further includes connecting the first node to the second node via a third hyperedge.

[0148] According to an embodiment of the method, the operation is a memory restore operation, and the method further includes inserting a memory restore subgraph node corresponding to the memory restore operation.

[0149] According to an embodiment of the method, the inserting further includes connecting the first node to the memory restoration subgraph node via a first hyperedge, where the first hyperedge comprises a serialization hyperedge or a prefetch hyperedge; connecting the memory restoration subgraph node to a second node via a second hyperedge, where the second node corresponds to a destination node; and connecting the memory reduction subgraph node to the memory restoration subgraph node via a third hyperedge.

[0150] According to an embodiment of the method, the method further includes connecting two nodes of the data flow graph via a hyperedge, the connecting including either a direct connection via a hyperedge between the two nodes and an indirect connection via one or more additional nodes and a hyperedge between the two nodes.

[0151] According to an embodiment of the method, the steps of the method are performed iteratively to perform at least one memory reduction operation and at least one memory restoration operation to insert a set of subgraph nodes into the flow graph.

[0152] According to an embodiment of the method, iteratively performing the method steps includes inserting a set of hyperedges into the flow graph, the set of hyperedges including at least one serialization hyperedge, or at least one prefetch hyperedge, or at least one serialization hyperedge and at least one prefetch hyperedge.

[0153] According to another embodiment of the present invention, a method is provided for selecting an insertion point in a data flow graph for an operation based on a set of tensor timing slacks (TTS) and a candidate list (SI) of input tensors.

[0154] In an embodiment, the method further includes computing a tensor timing slack (TTS) for the set of input tensors, assembling a candidate list (SI) of input tensors from the set of input tensors using input tensors having corresponding TTS values ​​greater than a threshold (thTTS), filtering the SI to retain input tensors having sizes that satisfy the threshold (thS), and based on the filtering, determining insertion points for reduction and restoration operations using the SI.

[0155] In an embodiment, computing the TTS includes performing a timing analysis using the input tensor.

[0156] In an embodiment, the method further includes inserting a subgraph node corresponding to the operation into the data flow graph.

[0157] In an embodiment, inserting generates a new data flow graph or modifies an existing data flow graph.

[0158] In an embodiment, the inserting generates a new data flow graph, where the new data flow graph comprises a complete data flow graph or a partial data flow graph.

[0159] In an embodiment, the method further includes processing the set of input tensors using the data flow graph based on the insertion, and generating an output based on the processing.

[0160] According to an embodiment of the present invention, a method is provided, the method includes: determining to apply a memory reduction action using subgraph node A and node P by identifying a memory requirement of output data generated by node P; transmitting data from a source node to subgraph node A and node P; allowing subgraph node A to perform the memory reduction action prior to execution of node P, the memory reduction action causing additional memory space to be made available by a graphics processor (GPU) for executing one or more functions; instructing subgraph node B to delay a memory restore action until node Q completes execution; transmitting data from a central processor (CPU) of subgraph node B to the GPU and restoring the data to the GPU.

[0161] In an embodiment, the method further includes applying a control dependency edge to node P to enable subgraph node A to be executed before node P.

[0162] In an embodiment, the method further includes determining an insertion location for the control dependency edge by determining a node P that generates output data having a larger memory requirement than the output data generated by node Q.

[0163] In an embodiment, the method includes applying a control dependency edge to subgraph node B to delay a memory restore action until node Q completes execution.

[0164] In an embodiment, the method includes delaying execution of node P until the memory reduction action is completed.

[0165] In an embodiment, the method includes performing, by the GPU, a series of calculations using the additional memory space.

[0166] In an embodiment, the method includes transmitting data from subgraph node B to a destination node after node Q completes execution.

[0167] In an embodiment, the method includes compressing the data to obtain additional memory space for the GPU to perform one or more functions.

[0168] In an embodiment, the method includes decompressing the data before completing the memory restore action.

[0169] In an embodiment, the method includes delaying a memory restore action until the data is needed by the destination node.

[0170] In an embodiment, the method includes decompressing the data after node Q completes execution.

[0171] In an embodiment, the method includes restoring the data to the GPU after node Q completes execution.

[0172] In an embodiment, the method includes determining an insertion location for applying control dependency edges to enable additional memory restoration actions to be performed.

[0173] In an embodiment, the method includes performing an additional memory restoration action at a different time interval than the memory restoration action between node Q and subgraph node B.

[0174] In an embodiment, the method includes compressing data to create additional memory space for the GPU to execute one or more functions, copying the compressed data to a CPU prior to execution of node P, transmitting the data received from node P after the CPU receives the compressed data, and executing the one or more functions on the GPU using the created additional memory space.

[0175] In an embodiment, the method includes determining a time interval needed to delay a memory restore action to prevent the GPU from prematurely receiving data from the CPU again.

[0176] According to another embodiment of the present invention, a computer usable program product may be provided, the computer program product comprising one or more computer readable storage devices and program instructions stored in at least one of the one or more storage devices, the program instructions in the storage including program instructions for performing steps of a method according to an embodiment provided by the present disclosure.

[0177] According to another embodiment of the present invention, a computer may be provided, the system comprising one or more processors, one or more computer-readable memories, and one or more computer-readable storage devices, where program instructions are stored in at least one of the one or more storage devices for execution by at least one of the one or more processors via at least one of the one or more memories, the program instructions in the storage including executing steps of a method according to an embodiment provided by the present disclosure.

[0178] In the data flow graph of the example embodiment, tensors calculated earlier occupy GPU memory until other tensors required for the execution of the node are ready. Tensors that are calculated too early can be moved to larger CPU memory, compressed, or even removed from GPU memory. When they are needed again, they are brought back to GPU memory, decompressed, or recomputed. The more tensors that participate in the memory savings, the greater the memory savings and the larger the data flow graph that can be processed within the same GPU memory.

[0179] In an embodiment, a method determines to apply a memory reduction action using subgraph node A and node P by identifying memory requirements for output data generated by node P. The method transmits data from a source node to subgraph node A and node P. The method enables subgraph node A to perform a memory reduction action prior to execution of node P, where the memory reduction action causes additional memory space to be made available for execution of one or more functions by a graphics processor (GPU). The method causes subgraph node B to delay a memory restore action until node Q completes execution. The method transmits data from a central processor (CPU) of subgraph node B to the GPU and restores the data to the GPU.

[0180] In an embodiment, the method applies a control dependency edge to node P, allowing subgraph node A to be executed before node P.

[0181] In an embodiment, the method determines the insertion location of the control dependency edge by determining a node P that generates output data that has a larger memory requirement than the output data generated by node Q.

[0182] In an embodiment, the method applies a control dependency edge to subgraph node B to delay memory restore actions until node Q completes execution.

[0183] In an embodiment, the method delays execution of node P until the memory reduction action is completed.

[0184] In an embodiment, the method uses additional memory space to perform a series of calculations by the GPU.

[0185] In an embodiment, the method transmits data from subgraph node B to a destination node after node Q completes execution.

[0186] In an embodiment, the method compresses data to obtain additional memory space for the GPU to perform one or more functions.

[0187] In an embodiment, the method decompresses the data before completing the memory restore action.

[0188] In an embodiment, the method delays memory restore actions until the data is needed by the destination node.

[0189] In an embodiment, the method decompresses the data after node Q completes execution.

[0190] In an embodiment, the method restores data to the GPU after node Q completes execution.

[0191] In an embodiment, the method applies control dependency edges to determine insertion locations to allow additional memory restoration actions to be performed.

[0192] In an embodiment, the method performs an additional memory restoration action at a different time interval than the memory restoration action between node Q and subgraph node B.

[0193] In an embodiment, the method compresses data to create additional memory space for the GPU to execute one or more functions. The method copies the compressed data to the CPU before execution of node P. The method transmits data received from node P after the CPU receives the compressed data. The method executes one or more functions in the GPU using the created additional memory space.

[0194] In an embodiment, the method determines a time interval needed to delay a memory restore action to prevent the GPU from prematurely receiving data from the CPU again.

[0195] In an embodiment, a computer usable program product is provided, the computer usable program product comprising one or more computer readable storage devices and program instructions stored in at least one of the one or more storage devices. The program instructions in the storage include instructions for determining to apply a memory reduction action using subgraph node A and node P by identifying a memory requirement of output data generated by node P, instructions for sending data from a source node to subgraph node A and node P, instructions for allowing subgraph node A to perform a memory reduction action prior to execution of node P, the memory reduction action causing additional memory space to be made available by a graphics processor (GPU) for executing one or more functions, instructions for subgraph node B to delay a memory restore action until node Q has completed execution, and instructions for sending data from a central processor (CPU) of subgraph node B to the GPU and restoring the data to the GPU.

[0196] In an embodiment, a computer system includes one or more processors, one or more computer-readable memories, and one or more computer-readable storage devices, and program instructions are stored in at least one of the one or more storage devices for execution by at least one of the one or more processors via at least one of the one or more memories. The program instructions in the storage include instructions for determining to apply a memory reduction action using subgraph node A and node P by identifying a memory requirement of output data generated by node P, instructions for sending data from a source node to subgraph node A and node P, instructions for allowing subgraph node A to perform a memory reduction action prior to execution of node P, where the memory reduction action causes additional memory space to be made available by a graphics processor (GPU) for executing one or more functions, instructions for subgraph node B to delay a memory restore action until node Q has completed execution, and instructions for sending data from a central processor (CPU) of subgraph node B to the GPU and restoring the data to the GPU.

[0197] The following definitions and abbreviations are used in interpreting the claims and the specification. As used herein, the terms "comprises," "comprising," "includes," "including," "has," "having," "containing," or "containing" or any other variation thereof are intended to cover a non-exclusive inclusion. For example, a composition, mixture, process, method, product, or apparatus that includes a list of elements is not necessarily limited to only those elements and can include other elements not expressly stated or inherent to such composition, mixture, process, method, product, or apparatus.

[0198] Moreover, the term "exemplary" is used herein to mean "serving as an example, instance, or illustration." Any embodiment or design described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. The terms "at least one" and "one or more" are understood to include any integer number greater than or equal to one (i.e., 1, 2, 3, 4, etc.). The term "multiple" is understood to include any integer number greater than or equal to two (i.e., 2, 3, 4, 5, etc.). The term "connected" can include indirect "connected" and direct "connected."

[0199] References herein to "one embodiment," "embodiment," "example embodiment," and the like indicate that the described embodiment may include a particular feature, structure, or characteristic, but that all embodiments may or may not include the particular feature, structure, or characteristic. Moreover, such phrases do not necessarily refer to the same embodiment. Also, if a particular feature, structure, or characteristic is described in connection with one embodiment, it is believed to be within the knowledge of one of ordinary skill in the art to affect such feature, structure, or characteristic in connection with other embodiments, whether or not explicitly described.

[0200] The terms "about," "substantially," "approximately," and variations thereof are intended to include the degree of error associated with the measurement of a particular quantity, based on the equipment available at the time of filing this application. For example, "about" can include a range of ±8%, or 5%, or 2% of a particular value.

[0201] The description of various embodiments of the present invention has been presented for purposes of illustration, but is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations that do not depart from the scope and spirit of the described embodiments will be apparent to those skilled in the art.

[0202] The terms used in this specification have been selected to best explain the principles of the embodiments, practical applications, or technical improvements over the art found in the market, or to enable others skilled in the art to understand the embodiments described herein.

[0203] Thus, in example embodiments, a computer-implemented method for managing participation in an online community, and other related features, functions, or operations, is provided. Where an embodiment or portion thereof is described in terms of a type of device, the computer-implemented method, system or apparatus, computer program product, or portions thereof, is adapted or configured for use with an appropriate equivalent designation of that type of device.

[0204] Users may access applications using a variety of client devices through thin-client interfaces such as web browsers (e.g., web-based email) or other light-client applications. Users do not manage or control the underlying cloud infrastructure, including the cloud infrastructure's network, servers, operating systems, or storage.

[0205] The present invention may be a method, an apparatus, or a computer program product, or a combination thereof, at any possible level of technical detail of integration. The computer program product may include a computer readable storage medium having computer readable program instructions for causing a processor to perform aspects of the present invention.

[0206] A computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. A non-exhaustive list of more specific examples of computer-readable storage media includes portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically encoded devices such as punch cards or ridge structures in grooves in which the instructions are recorded, and any suitable combinations of these. As used herein, computer-readable storage media should not itself be construed as being ephemeral signals such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., light pulses passing through a fiber optic cable), or electrical signals transmitted over wires.

[0207] The computer readable program instructions described herein may be downloaded from a computer readable storage medium to each computing device / processing device or to an external computer or storage device over a network (e.g., the Internet, a local area network, a wide area network, or a wireless network, or a combination thereof) that may include copper transmission cables, optical transmission fiber, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface within each computing device / processing device receives the computer readable program instructions from the network and forwards the computer readable program instructions for storage on a computer readable storage medium within each computing device / processing device.

[0208] The computer readable program instructions for carrying out the operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, configuration data for an integrated circuit, or source or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk®, C++, and procedural programming languages ​​such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partially on the user's computer as a standalone software package, partially on the user's computer and on a remote computer, or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be to an external computer (e.g., via the Internet using an Internet Service Provider). In some embodiments, to carry out aspects of the invention, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), may execute computer readable program instructions to customize the electronic circuitry by utilizing state information of the computer readable program instructions.

[0209] Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, are implemented by computer readable program instructions.

[0210] These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, where the instructions, executed by the processor of the computer or other programmable data processing apparatus, produce means for performing the functions / operations specified in the blocks of the flowcharts and / or block diagrams. These computer readable program instructions may be stored on a computer readable storage medium and capable of directing a computer, programmable data processing apparatus, or other device, or combination thereof, to function in a particular manner, such that the computer readable storage medium on which the instructions are stored comprises an article of manufacture including instructions for performing aspects of the functions / operations specified in the blocks of the flowcharts and / or block diagrams.

[0211] Computer readable program instructions may be loaded into a computer, other programmable data processing apparatus, or other device such that the instructions, which execute on the computer, other programmable apparatus, or other device, perform the functions / acts specified in the blocks of the flowcharts and / or block diagrams, thereby causing a series of operable steps to be performed on the computer, other programmable apparatus, or other device to generate a computer-implemented process.

[0212] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, segment, or portion of instructions, comprising one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions shown in the blocks may occur in a different order than that shown in the figures. For example, two blocks shown in succession may in fact be executed substantially simultaneously or in reverse order, depending on the functionality involved. It is also noted that each block in the block diagrams and / or flowchart illustrations, as well as combinations of blocks included in the block diagrams and / or flowchart illustrations, are implemented by a dedicated hardware-based system that performs the specified functions or operations or executes a combination of dedicated hardware and computer instructions.

Claims

1. 1. A method for reducing overall GPU memory usage while processing a neural network, comprising: automatically determining an insertion point for the memory-saving operation in an underlying data flow graph that includes a set of nodes and a set of edges, the automatically determining the insertion point comprising: Computing tensor timing slack (TTS) for a set of input tensors; collecting a candidate list (SI) of input tensors from the set of input tensors using input tensors having corresponding TTS values ​​greater than a threshold (thTTS); filtering the S to retain input tensors having sizes that satisfy a threshold (thS); determining an insertion point for the motion using the SI based on the filtering; and A method comprising:

2. the operations being a combination of reduce and restore operations; the reduction operation includes one or both of a copy operation to a central processing unit (CPU) memory and a compression operation; the restore operation includes one or both of a copy operation from a CPU memory and a decompression operation; The method of claim 1.

3. The method of claim 1 , wherein computing the TTS comprises performing a timing analysis using the input tensor.

4. The timing analysis includes: initializing tensor arrival time (TAT), tensor required time (TRT), and tensor timing slack (TTS) values ​​for the input tensors; For a set of input tensors Q, while Q is nonempty, selecting a node q in Q for removal; removing q from Q; and for each input tensor s subsequent to q, setting the TAT of s equal to the TAT of q. To carry out The method of claim 3 , comprising:

5. The initializing step includes:

5. The method of claim 4, comprising initializing the values ​​of TAT, TRT, and TTS to unknown values ​​for all graph nodes and to zero for all graph inputs collected in Q.

6. A node n has all inputs with known TAT values, n is a node where s is an input tensor, and the method comprises the steps of: for a set Q of input tensors: setting the TRT of n to be the maximum value among the TATs of input i of n; setting the TTS for each input i of n as the difference between the TRT of n and the TAT of i; setting the TAT of n based on the TRT of n augmented by the node's delay; including n in Q; The method of claim 4 , further comprising:

7. 2. The method of claim 1 , wherein the data flow graph comprises pairs (N, E), where N comprises a set of nodes and E comprises a set of hyperedges, and where particular nodes in N implement one or more operators on one or more tensors.

8. 8. The method of claim 7, wherein the particular node comprises a triplet (f, I, O), where f is a function of an operator implemented by the particular node, I is a set of input tensors of the particular node, and O is a set of outputs of the particular node that are generated based on the operators.

9. The method of claim 7 , wherein a hyperedge defines how tensors are passed from an operator that produces the tensor to an operator that uses the tensor as an argument.

10. 8. The method of claim 7, wherein a hyperedge comprises a pair (s,H), where s is an output of the node and H is a set of inputs of the node.

11. The method of claim 7 , further comprising inserting a subgraph node corresponding to the operation into the data flow graph.

12. The method of claim 11 , wherein the inserting generates a new data flow graph or modifies an existing data flow graph.

13. 13. The method of claim 12, wherein the inserting generates a new data flow graph, the new data flow graph comprising a complete data flow graph or a partial data flow graph.

14. processing the set of input tensors using the data flow graph based on the insertions; generating an output based on said processing; The method of claim 11 further comprising:

15. the operation is a memory reduction operation, and the method comprises: inserting a memory reduced subgraph node corresponding to said memory reduction operation; The method of claim 1 further comprising:

16. The inserting step comprises: connecting a first node to the memory reduced subgraph node via a first hyperedge, the first node corresponding to a source node; connecting the memory reduced subgraph node to the second node via a second hyperedge, the second hyperedge including a serialized hyperedge, the second node corresponding to an intermediate node or a destination node; The method of claim 15 further comprising:

17. The inserting step comprises: connecting the first node to a second node via a third hyperedge.

20. The method of claim 16, further comprising:

18. the operation is a memory restore operation, and the method comprises: inserting a memory restore subgraph node corresponding to said memory restore operation; The method of claim 1 further comprising:

19. The inserting step comprises: connecting a first node to the memory restoration subgraph node via a first hyperedge, the first hyperedge comprising a serialization hyperedge or a prefetch hyperedge; connecting the memory restoration subgraph node to a second node via a second hyperedge, the second node corresponding to a destination node; connecting the memory reduction subgraph node to the memory restoration subgraph node via a third hyperedge; 20. The method of claim 18, further comprising:

20. and further comprising connecting two nodes of the data flow graph via a hyperedge, the connecting comprising: a direct connection between the two nodes via the hyperedge; one or more additional nodes and an indirect connection between the two nodes via a hyperedge; The method of claim 1 , comprising any one of:

21. 2. The method of claim 1, wherein the method steps are performed iteratively to perform at least one memory reduction operation and at least one memory restoration operation to insert a set of subgraph nodes into the flow graph.

22. 22. The method of claim 21, wherein iteratively performing the method steps includes inserting a set of hyperedges into the flow graph, the set of hyperedges including at least one serialized hyperedge, or at least one prefetch hyperedge, or at least one serialized hyperedge and at least one prefetch hyperedge.

23. The actions are memory reduction actions, and the method comprises: determining to apply said memory reduction action using subgraph node A and node P by identifying memory requirements of output data generated by node P; transmitting data from a source node to said subgraph node A and to said node P; enabling the subgraph node A to execute the memory reduction action prior to execution of the node P, the memory reduction action causing additional memory space to be made available for execution of one or more functions by a graphics processor (GPU); causing subgraph node B to delay memory restore actions until node Q has completed execution; Sending the data from a central processor (CPU) of subgraph node B to the GPU and restoring the data to the GPU; The method of claim 1 , comprising:

24. selecting an insertion point for an operation in a data flow graph based on a set of tensor timing slacks (TTS) and a candidate list (SI) of input tensors; Computing the tensor timing slack (TTS) for a set of input tensors; collecting said candidate list (SI) of input tensors from a set of input tensors using input tensors having corresponding TTS values ​​greater than a threshold (thTTS); filtering the S to retain input tensors having sizes that satisfy a threshold (thS); determining insertion points for reduction and restoration operations using the SI based on the filtering; A method comprising:

25. determining to apply a memory reduction action using subgraph node A and node P by identifying a memory requirement of output data generated by said node P; transmitting data from a source node to said subgraph node A and to said node P; enabling the subgraph node A to execute the memory reduction action prior to execution of the node P, the memory reduction action causing additional memory space to be made available for execution of one or more functions by a graphics processor (GPU); causing subgraph node B to delay memory restore actions until node Q has completed execution; Sending the data from a central processor (CPU) of subgraph node B to the GPU and restoring the data to the GPU; A method comprising:

26. 26. A computer program comprising program code means adapted to perform the method of any of claims 1 to 25, when the computer program is run on a computer.

27. 1. A system for reducing overall GPU memory usage while processing a neural network, comprising: automatically determining an insertion point for the memory-saving operation in an underlying data flow graph that includes a set of nodes and a set of edges, the automatically determining the insertion point comprising: selecting an insertion point for an operation in a data flow graph based on a set of tensor timing slacks (TTS) and a candidate list (SI) of input tensors; Computing the tensor timing slack (TTS) for a set of input tensors; collecting said candidate list (SI) of input tensors from a set of input tensors using input tensors having corresponding TTS values ​​greater than a threshold (thTTS); filtering the S to retain input tensors having sizes that satisfy a threshold (thS); determining insertion points for reduction and restoration operations using the SI based on the filtering; A system operable to execute the

28. determining to apply a memory reduction action using subgraph node A and node P by identifying a memory requirement of output data generated by said node P; transmitting data from a source node to said subgraph node A and to said node P; enabling the subgraph node A to execute the memory reduction action prior to execution of the node P, the memory reduction action causing additional memory space to be made available for execution of one or more functions by a graphics processor (GPU); causing subgraph node B to delay memory restore actions until node Q has completed execution; Sending the data from a central processor (CPU) of subgraph node B to the GPU and restoring the data to the GPU; A system operable to execute the

Citation Information

Patent Citations

  • Information processing device, information processing system, information processing program, and information processing method

    JP2018194974A

  • Memory management method and system for machine learning training on graphic processing unit

    JP2019133666A

  • Determining the execution order of neural networks

    JP2019501451A

  • Information processor, information processing program, and information processing method

    JP2020102108A