Reducing deep neural network training times through efficient hybrid parallelization

By sorting and calculating parallelization sub-strategies for the deep neural network's computation graph, and combining data parallelism and model parallelism, the problems of long DNN training time and low hardware utilization are solved, achieving more efficient training time and hardware resource utilization.

CN112836787BActive Publication Date: 2024-10-01BAIDU USA LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011209924.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-08-04
Filing Date
2020-11-03
Publication Date
2024-10-01
Estimated Expiration
2040-11-03

AI Technical Summary

Technical Problem

Existing technologies suffer from inefficiencies in reducing deep neural network (DNN) training time, especially low hardware utilization and high memory requirements due to data parallelism strategies, and methods to automatically find optimal parallelization strategies are complex and unwieldy. Be realistic.

Method used

By sorting the vertices in the computational graph of deep neural networks, using recursive computation parallelization sub-strategies to reduce configuration costs, combining data parallelism and model parallelism strategies, ignoring inter-layer pipeline parallelism, and adopting dynamic programming and cost function-based methods to find Least-cost parallelization strategy.

Benefits of technology

It significantly reduces the training time of DNN, improves hardware utilization, and achieves acceleration compared to the data parallel strategy on multi-GPU systems without affecting the convergence speed and accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112836787B_ABST
    Figure CN112836787B_ABST
Patent Text Reader

Abstract

A system and method for automatically finding effective parallelization strategies for deep neural networks (DNNs) are proposed. A computational graph including an effectively ordered sequence of vertices facilitates computing the optimal parallelization strategy in a relatively short time. The effectiveness of the parallelization strategies is evaluated on various DNNs, and the performance of the strategies proposed by various embodiments is compared with data parallelism, expert-designed strategies, and other prior art methods. Experimental results show that the proposed strategies outperform baseline data parallel strategies and achieve better performance than expert-designed strategies and prior art methods.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This patent application is related to and claims the benefit of priority under 35 U.S.C. §119(e) to co-pending and commonly owned U.S. patent application Ser. No. 62 / 930,518, filed on Nov. 4, 2019, entitled “REDUCING TRAINING TIMES OF DEEP NEURAL NETWORKS THROUGH EFFICIENT HYBRID PARALLELISM,” and lists Venmugil Elango as inventor (Case No. 28888-2363P), the entire contents of which are incorporated herein by reference for all purposes. Background Art

[0003] The present disclosure generally relates to systems and methods for computer learning that can provide improved computer performance, features, and usage. More specifically, the present disclosure relates to systems and methods for reducing the training time of deep neural networks (DNNs) by effectively mixing parallel techniques.

[0004] DNNs have achieved great success in several fields such as computer vision, natural language processing, recommender systems, etc. Training DNNs requires large computational and memory requirements. It has become standard practice to parallelize training on multiple devices to reduce training time. There are several feasible ways to parallelize different layers in a DNN. Exhaustively searching this list to find the optimal parallelization strategy is too time-consuming and impractical. The standard practice is to use data parallelism because of its simplicity. However, data parallelism is often suboptimal and suffers from poor performance and high memory requirements. Expert-designed strategies have been proposed on a case-by-case basis using specific domain knowledge. These expert-designed strategies do not generalize well to other DNNs except for the DNN for which the strategy was designed.

[0005] Therefore, it is desirable to provide more efficient systems and methods that can increase hardware utilization and reduce training time for deep neural networks. Summary of the invention

[0006] Embodiments of the present disclosure provide a non-transitory computer-readable medium including one or more instruction sequences and a system for finding an effective strategy for parallelizing vertices of a deep neural network (DNN) to increase hardware utilization of the DNN and reduce training time of the DNN.

[0007] In one aspect of the present disclosure, a non-transitory computer-readable medium comprising one or more instruction sequences is provided, which, when executed by at least one processor, implements steps for finding an effective strategy for parallelizing layers of a deep neural network (DNN) to increase hardware utilization of the DNN and reduce training time of the DNN, the steps comprising: obtaining a vertex sequence, wherein vertices in the vertex sequence represent layers of the DNN, and the vertex sequence has been sorted according to a vertex sorting strategy so that the size of a restricted neighbor set in a computational graph representing the DNN is reduced; for each vertex, using recursion to calculate a sub-strategy for parallelizing the vertices of the DNN, each vertex being associated with one or more effective configurations that reduce configuration cost according to a cost function; and outputting a strategy with the lowest cost for the computational graph.

[0008] In another aspect of the present disclosure, a non-transitory computer-readable medium comprising one or more instruction sequences is provided, which, when executed by at least one processor, implements the following steps, the steps of sorting vertices of a computational graph of a deep neural network (DNN) to generate a valid vertex sequence, wherein the vertices in the vertex sequence represent layers of the DNN, thereby effectively calculating the optimal strategy for improving the hardware utilization of the DNN and reducing the training time of the DNN, the steps comprising: for one or more vertices in a vertex set, initializing a right-dependent vertex set, a terminal vertex set, and an unsorted vertex set; for each vertex, performing the following steps: iteratively selecting a vertex with a minimum right-dependent set cardinality from the unsorted vertex set, and assigning the selected vertex to a vertex sequence; updating the terminal vertex set and the right-dependent vertex set so that the size of the right-dependent vertex set in the computational graph is correctly maintained; and outputting the vertex sequence as an ordered vertex sequence.

[0009] In another aspect of the present disclosure, a system is provided for finding an effective strategy for parallelizing vertices of a deep neural network (DNN) to increase hardware utilization of the DNN and reduce training time of the DNN, the system comprising: one or more processors; and a non-transitory computer-readable medium comprising one or more sets of instructions, which, when executed by at least one of the one or more processors, causes the following steps to be performed, the steps comprising: obtaining a vertex sequence, wherein the vertices in the vertex sequence represent layers of the DNN, the vertex sequence having been sorted according to a vertex sorting strategy so that the size of a restricted neighbor set in a computational graph representing the DNN is reduced; for each vertex, using recursion to calculate a sub-strategy for parallelizing the vertices of the DNN, each vertex being associated with one or more effective configurations that reduce configuration cost according to a cost function; and outputting a strategy with the lowest cost for the computational graph. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The present disclosure will be described with reference to the embodiments and examples of the present disclosure shown in the accompanying drawings. These drawings are illustrative and not restrictive. Although the present disclosure is generally described in the context of these embodiments, it should be understood that it is not intended to limit the scope of the present disclosure to these specific embodiments. The items in the drawings may not be drawn to scale.

[0011] Figure 1 An exemplary iteration space of a general matrix multiplication (GEMM) computation parallelized by using the parallelization configuration (1,4,2) is shown.

[0012] Figure 2A A simplified exemplary computational diagram according to an embodiment of the present disclosure is shown.

[0013] Figure 2B The embodiment of the present invention is shown Figure 2A An exemplary ordering of the vertices of the computation graph in .

[0014] Figure 3A An exemplary process for sorting vertices into a valid sequence according to an embodiment of the present invention is shown.

[0015] Figure 3B A flowchart of a process for sorting vertices of a computation graph of a DNN to generate an effective vertex sequence to increase hardware utilization of the DNN and reduce training time of the DNN according to an embodiment of the present invention is shown.

[0016] Figure 4A A dynamic programming (DP) based process for computing an efficient strategy for a computation graph according to an embodiment of the present invention is shown.

[0017] Figure 4B A flowchart of a process for finding an effective strategy for parallelizing vertices of a DNN to increase hardware utilization and reduce training time according to an embodiment of the present invention is shown.

[0018] Figure 5 A computation subgraph according to an embodiment of the present invention is shown.

[0019] Figure 6 The speedup achieved by using the strategy proposed in the embodiment in the experiment on a 1080Ti system compared to the data parallel strategy according to the embodiment of the present disclosure is shown.

[0020] Figure 7 The speedup achieved by using the strategy proposed in the embodiment in the experiment on a 2080Ti system compared to the data parallel strategy according to the embodiment of the present disclosure is shown.

[0021] Figure 8 A simplified block diagram of a computing system in accordance with an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0022] In the following description, for the purpose of explanation, specific details are set forth to provide an understanding of the present invention. However, it will be apparent to those skilled in the art that the present disclosure may be practiced without these details. In addition, those skilled in the art will recognize that the embodiments of the present disclosure described below may be implemented in a variety of ways, such as a process, device, system, apparatus, or method on a tangible computer-readable medium.

[0023] The components or modules shown in the accompanying drawings are examples of exemplary embodiments of the present disclosure and are intended to avoid obscuring the present disclosure. It should also be understood that throughout the discussion, components may be described as separate functional units, which may include subunits, but those skilled in the art will recognize that various components or parts thereof may be divided into separate components, or may be integrated together, including within a single system or component. It should be noted that the functions or operations discussed herein may be implemented as components. Components may be implemented in software, hardware, or a combination thereof.

[0024] In addition, the connections between the components or systems in the drawings are not limited to direct connections. Instead, the data between these components can be modified, reformatted or otherwise changed by intermediate components. In addition, additional or fewer connections can be used. It should also be noted that the terms "connection", "connection" or "communication connection" should be understood to include direct connections, indirect connections through one or more intermediate devices, and wireless connections.

[0025] References in the specification to "one embodiment," "preferred embodiment," "embodiment," or "embodiments" mean that a particular feature, structure, characteristic, or function described in conjunction with the embodiment is included in at least one embodiment of the present disclosure, and may be in more than one embodiment. In addition, the above phrases appearing in various places in the specification do not necessarily all refer to the same embodiment or embodiments.

[0026] Certain terms are used in various places in this specification for the purpose of explanation and should not be construed as limiting. Services, functions, or resources are not limited to a single service, function, or resource; the use of these terms may refer to a group of related services, functions, or resources, which may be distributed or aggregated.

[0027] The terms "including" and "comprising" are to be understood as open-ended terms, and any items listed thereafter are exemplary and are not meant to be limited to the listed items. A "layer" may include one or more operations. The words "optimal," "best," "optimal," and the like refer to improvements in results or processes, and do not require that a specified result or process has reached an "optimal" or peak state.

[0028] Any headings used herein are for organizational purposes only and should not be used to limit the scope of the specification or claims. Each reference / document mentioned in this patent document is incorporated herein by reference in its entirety.

[0029] In addition, those skilled in the art will recognize that: (1) certain steps may be performed optionally; (2) the steps may not be limited to the specific order described herein; (3) certain steps may be performed in a different order; and (4) certain steps may be performed simultaneously.

[0030] It should be noted that any experiments and results provided herein are provided by way of illustration and were performed under specific conditions using one or more specific embodiments; therefore, these experiments and their results should not be used to limit the scope of the disclosure of this patent document.

[0031] A. Overview

[0032] Deep neural networks are becoming more complex and using growing datasets to improve accuracy. This leads to an increase in the computational and memory requirements for training DNNs. Typically, it takes several hours to several days and requires multiple GPUs to train a DNN. For example, Google's Neural Machine Translation (GNMT) model was trained on dataset 3 English-French (EN→FR) for about 6 days using 96 NVIDIA K80 GPUs.

[0033] Training a DNN typically consists of three phases: forward propagation, backward propagation (or backpropagation), and an update phase. First, the input dataset is divided into multiple mini-batches. In one step, during the forward propagation, a mini-batch is passed through the layers of the network. At the end of the forward phase, the output is compared to the ground truth, and the loss is calculated using an appropriate loss function. To minimize the loss, the gradients of the model parameters are calculated during the backward propagation. Finally, the gradients are used to update the model parameters. This process is repeated over several time steps, called epochs, until the desired accuracy is achieved.

[0034] DNN parallelization strategies can be broadly divided into three categories, namely data parallelism, model parallelism, and pipeline parallelism. A strategy that combines these three approaches to parallelize each layer differently is often called hybrid parallelism. As described below, each parallelization strategy has its own advantages and disadvantages.

[0035] In data parallelism, each of the p devices keeps a copy of the entire DNN, and each mini-batch is divided into p fragments and distributed to different devices. Each device performs forward propagation and backward propagation independently on its data fragments. During the update phase, gradients from all devices are usually accumulated through a full reduction operation before updating the local copy of the model parameters. This becomes a major bottleneck on models with a large number of model parameters. In addition, since the model parameters are copied (rather than split and separated), it is impossible to train large models by using only data parallelism due to memory constraints. In addition, data parallelism is inefficient when the size of the mini-batch is small. Unfortunately, it may not always be feasible to use mini-batches of larger size due to poor convergence and accuracy. Despite these shortcomings, data parallelism remains popular due to its simplicity and the ability to automatically apply data parallelism across the entire network. Data parallelism can also be viewed as dividing work along the mini-batch dimension.

[0036] An alternative strategy divides the work along the model dimension (e.g., channel dimension, filter dimension, etc.). This is the approach taken in model parallelism, where the model parameters are distributed across different devices and each device computes only a portion of the activations (and gradients) of a layer during the forward (and backward) pass. This saves memory, but it incurs additional communication (usually all-to-all communication) during the forward (and backward) pass to accumulate activations (and gradients). Depending on the size of the mini-batch and the model parameters, one parallelization strategy may be more efficient than another.

[0037] The third approach, pipeline parallelism, involves placing different layers of the network on different devices without splitting the input data and model parameters along any dimension. This allows overlap in computation for layers that are not data-dependent. Each device computes the activations (and gradients) of the layers it owns and sends the results to the device that owns the successive layers. This strategy has the advantage of not requiring centralized communication of model parameters; however, it requires sufficient inter-layer parallelism, and data needs to arrive at a specific rate through the pipeline in order for this strategy to be effective.

[0038] Hybrid parallelism combines some or all of the three strategies by using a combination of strategies (e.g., data + model parallelism) to parallelize different layers differently. As detailed in Section B below, there are several possibilities to choose how different layers should be parallelized. Therefore, it is impractical to exhaustively search for the optimal strategy for hybrid parallelism. Based on specific domain knowledge, a case-by-case expert-designed strategy for different DNNs is proposed. Efforts are also made to find good strategies automatically. These methods (i) apply different heuristics to find a greedy solution, or (ii) find an optimal solution restricted to a certain class of DNNs (e.g., convolutional networks), or (iii) reduce the search space by restricting some choices in order to find the optimal strategy within the reduced search space.

[0039] In this patent document, a hybrid parallel strategy is used. In one or more embodiments, inter-layer pipeline parallelism can be ignored, and a combination of model parallelism and data parallelism can be used to find the best strategy for parallelizing different layers of a DNN. Various embodiments include formulas and node (or vertex) sorting techniques for efficiently calculating a parallelization strategy corresponding to a minimum training cost of a DNN. An efficient method can use the formula to calculate the best strategy for various DNNs.

[0040] The experimental results show that, in one or more embodiments, ignoring inter-layer pipeline parallelism does not extensively prune the best strategies from the search space. The strategies proposed by the new method are evaluated relative to the baseline data parallel strategy, the expert-designed strategy, and the strategy proposed by the prior art method (Framework 1), as discussed in the following Experimental Results Section D. The results show that in most cases, the method of this paper finds effective strategies for various DNNs in a few seconds. The presented strategy outperforms data parallelism by up to 1.85 times on a multi-node / multi-GPU system consisting of 1080Ti GPUs, and outperforms data parallelism by up to 4 times on a system consisting of 2080Ti GPUs for various benchmarks. The proposed strategy also performs better than the expert-designed strategy and the strategy proposed by Framework 1.

[0041] B. Problem Representation

[0042] A DNN can be represented as a computational graph G = (V, E), which is a weakly connected directed graph, where each node v∈V corresponds to a layer in the DNN (e.g., a fully connected layer, a convolutional layer, etc.), and each edge (u, v)∈E represents the flow of tensors, which are output u and input v. Each node v∈V has an associated iteration space that captures the computation of v. For example, consider the matrix A M×K With matrix B K×N The fully connected layer is multiplied. Its iteration space is composed of the set specified.

[0043] Parallel configuration C of node v v is a d-tuple of positive integers that defines how the iteration space of v is split and parallelized across different devices, where d is the dimensionality of the iteration space of v. Figure 1 An exemplary iteration space of a GEMM computation parallelized using the parallelization configuration (1,4,2) is shown. Figure 1 In the fully connected layer example in , the configuration (1,4,2) specifies that the jth dimension of the iteration space should be divided into 4 equal parts along the second dimension of its iteration space, and the kth dimension should be divided into 2 parts along the third dimension of its iteration space, while the i-th dimension is not split. Computationally, the configuration specifies to split the columns of matrix A 102 and the rows of matrix B 104 into two halves; split the columns of matrix B 104 into four quarters; perform 8 GEMM computations corresponding to each part on 8 separate devices; and finally perform partial reductions on the intermediate results. Given a node v with d-dimensional iteration space and p devices, give a set of valid configurations for v

[0044] For simplicity of naming, when p is cleared from context, Can be specified as Or, by using configuration C v The layer v being parallelized can be viewed as an iterative spatial tiling of the computations on v.

[0045] The parallelization strategy φ is a set of valid configurations that specifies for each node v∈V The configuration of node v in policy φ is determined by C v =φ(v). Substrategy φ |U is a strategy φ restricted to the subset U, that is, φ |U ={(u,C u )∈φ|u∈U}. The optimal strategy is a given cost function Under this condition, there is a parallelization strategy with minimum cost among all possible strategies of V, that is, where Φ is the set of all valid strategies for V, where each strategy φ∈Φ is a unique combination of valid configurations of V.

[0046] In one or more embodiments, given a processing environment with p devices, where the average peak floating point performance of each device is F FLOPS, and the average communication bandwidth of each link is B bytes / second, the cost function can be expressed as:

[0047]

[0048] where r = F / B is the ratio of FLOPs to bytes; the layer cost t1 is the cost (in FLOPs) of computing the layer (e.g., a fully connected layer), and may include computation and communication that may occur internally within the layer, such as full-reduce operations normalized to FLOPs (e.g., by multiplying it by r); and the data transfer cost t x is the communication cost in bytes required to transmit a tensor flowing along an edge (u,v) or (v,u) during forward and / or backward propagation. Note that t x is edge direction agnostic, that is, for an edge (u,v)∈E,t x (u,v,φ(u),φ(v))=t x (v,u,φ(v),φ(u)).

[0049] In one or more embodiments, the cost function can be an approximation of the actual cost and can be obtained by dividing the cost t of any two layers by l (v x ,·,·) and t l (v y ,·,·) to ignore overlaps (or pipelines) of different layers, for example, rather than taking the maximum value when possible. As mentioned above, this method accurately captures data and model parallelism and ignores pipeline parallelism. In one or more embodiments, although pipeline parallelism between layers can be ignored, it can be (for example) by considering the layer cost t l The intra-layer pipeline parallelism in is used to accurately capture the intra-layer pipeline parallelism opportunities. As discussed in more detail in Reference Section C, this approximation allows the design of a technique that efficiently and quickly finds the optimal strategy for a DNN. As shown in experimental results, this approach is simple but very effective because most DNNs do not contain significant inherent pipeline parallelism opportunities. In contrast, some existing methods use pipeline parallelism to improve parallel training throughput by making semantic modifications to the model, including using older weights. However, such semantic modifications result in changes in model accuracy compared to the original model. In addition, they may also require more rounds to converge, which therefore eliminates any advantage gained from pipeline parallelism. For comparison, the various embodiments herein do not require any semantic modifications to the model. As a result, the convergence speed and final accuracy can be exactly the same as the original model, advantageously increasing hardware utilization through better parallelism. Note that even though the various embodiments find a strategy for The optimal solution Since the cost function It itself represents an approximation rather than a solution to the optimal policy, so the solution can be referred to as an effective policy or an optimal policy here to avoid confusion.

[0050] In an embodiment, t can be calculated analytically by using a simple closed-form expression in the experiment: l and t x For edge (u,v), t x It can be represented by the following difference: max d |A(v,d)|+|A(u,d)|-|A(v,d)∩A(u,d)|, where A(v,d) and A(u,d) are the number of input tensors of v required by device d. For a few different types of DNN layers, the layer cost t can be calculated using an analytically derived expression l . In one or more embodiments, many low-level details, such as cache effects, etc., may be ignored. In addition, the cost is normalized using r=F / B, implicitly assuming that the computation achieves close to the peak performance of the machine and that the communication bandwidth is fully utilized. Note that such assumptions are not necessary for proper operation of the proposed system and method, but they can keep the cost calculation simple. In addition, some embodiments focus on the relative ranking of the costs of various strategies rather than determining the absolute cost of the best strategy. These simplifying assumptions affect the costs of all examined strategies to a greater or lesser extent, thereby retaining most of the relevant rankings. In addition, since most DNN computations include dense matrix operations, experiments have shown that these assumptions are not seriously violated when standard libraries (such as cuBLAS, cuDNN, NCCL, etc.) are used for computation.

[0051] C. Calculate effective strategies

[0052] As described in Section B, each network layer may have a set of effective parallelization configurations. In one or more embodiments, finding an effective strategy for the DNN includes selecting an optimal configuration for each layer.

[0053] Note: Let G = (V, E) be the computational graph of the DNN. For a vertex v∈V, N(G, v) represents its neighbors, i.e., N(G, v) = {u∈V|(u, v)∈E∨(v, u)∈E}. The symbol N(v) refers to the neighbors of v when G is cleared from the context, and N(U) = ∪ u∈U N(u). For any vertex set X, its restricted neighbor set R(X,Y)=N(X)∩Y can be defined as the set of neighbors of vertices in X that are restricted to the set Y. For any vertex set U and vertex u∈U, its restricted reachable set P(U,u) can be defined as the set of neighbors of vertices in X that are restricted to the set Y. The undirected path (v1,...,v p ) is the set of vertices v that are reachable from u, that is, v∈P(U,u) means that there is a restricted path between u and v that only passes through vertices in U. Let ν = (v (1) ,…,v (|V|)) is an arbitrarily ordered sequence of vertices in V, ν <i and ν <i Respectively represent the set {v (1) ,…,v (i) and {v (1) ,…,v (|V|)}. <i and ν >i Respectively represent the set {v (1) ,…,v (i-1)} and {v (i+1) ,…,v (|V|)}. For reference, Table I summarizes these and other symbols defined below.

[0054] Table I

[0055] Overview of the notation used in the computation graph G = (V, E)

[0056]

[0057] 1. Observation I and Naif Method

[0058] A brute force approach to computing an effective policy for G = (V, E) is to enumerate all possible combinations of configurations of vertices and select the one with the minimum cost. The combinatorial nature of this approach makes it impractical to use it even on small graphs such as DNN1, as discussed in the Experimental Results section D below. However, the complexity of the problem can be significantly reduced by the following observation in Eq. (1): Substituting the configuration of vertex v from C i Change to C j The layer cost t that only affects the vertex itself l (v,·,·) and its data transmission cost t with its neighbors x (u,v,·,·), where u∈N(v). This allows the vertices V to be sorted into the sequence = (v (1) ,…,v (|V|) ), and use the following recursion (2) to calculate the optimal strategy for G. Let φ i is used for R(ν ≤i ,ν >i ), where the restricted neighbor set R(ν ≤i ,v >i ) is v >i The set of vertices in ≤i The intersection of neighbors in , then, for i∈[1,|V|]

[0059]

[0060] in,

[0061]

[0062] The cost of an effective parallelization strategy for G is given by As shown in Table III in Section D, computing an effective policy using this recursion is still quite expensive, and takes a lot of time to find the optimal policy for graphs other than simple path graphs such as DNN1. More efficient methods for finding the optimal policy according to various embodiments are discussed below.

[0063] 2. Observation II and effective methods

[0064] From recursion (2), we can see that is the inclusion of R(v ≤i ,v >i )'s configured sub-strategy φ i function, so the process of calculating the effective strategy using (2) should be aimed at φ i ∈Φ' all possible combinations Where Φ' is R(v ≤i ,v >i ). Therefore, the computational complexity of finding an effective strategy using (2) is at least R(v ≤i ,v >i ),in is the maximum number of configurations of any vertex in G, and M = |R(v ≤i ,v >i )|.

[0065] Various embodiments order the nodes into a sequence v such that for any v in v (i) , restricted neighbor set R(v ≤i ,v >i ) are as small as possible. In one or more embodiments, this can be achieved by using a process that sorts the vertices V in such a way that the size of the restricted neighbor set is kept to a minimum.

[0066] Definition: Given a graph G = (V, E) and a sequence v = (v (1) ,…,v (|V|) ), in one or more embodiments, the left reachable set L(v,i)=P(v ≤i ,v (i) )–{v (i)} can be defined as v <i In, for example, the length p>1s.t. The undirected path (v (a) ,…,v (p) )From v (i)Set of reachable nodes. In one or more embodiments, the set of (i) endpoints of v is the set of vertices that are left-reachable from v (i) and not left-reachable from any other vertex v (k) (k < i). Alternatively, the set of endpoints can be defined as T(v,i) = L(v,i) - ∪ j<i L(v,j). In one or more embodiments, the right-related set D(v,i) = R(L(v,i) ∪ {v (i)},v >i ) = {v ∈ v >i | v ∈ P(v ≤i ∪ {v},v (i) )} can be defined as the subset of v >i that includes its own restricted neighbors and its left-reachable set. In one or more embodiments, for the recursion (4) defined below, the right-related set D(v,i) can be the equivalent of R(v ≤i ,v >i ) in the recursion (2).

[0067] In one or more embodiments, to compute the sequence v, the recursion in (2) can be re-expressed as follows: for any i ∈ [1,|V|],

[0068]

[0069] where, is defined in (3) and is φ i is a sub-strategy for the set of nodes in D(v,i).

[0070] Figure 2A FIG. 200 shows a simplified exemplary computational graph according to an embodiment of the present disclosure. Figure 2B FIG. 250 shows an exemplary ordering of the vertices of the computational graph in Figure 2A according to an embodiment of the present invention. Figure 2B The vertices in Figure 2B are numbered in the order in which they appear in the sequence. (5) The left-reachable set, the set of endpoints, and the right-related set of v in (1) ,v (2) ,v (3)} are given by {v (2) ,v (3)}, {v (8)}, and {v Figure 2B FIG. also shows the advantage of defining the recursion (4) according to the set of endpoints T(v,i) rather than according to the previous node in the sequence v as in the recursion (2). In (i-1) In Figure 2BIn the example, |R(v ≤5 ,v >5 )|=|{v (7) ,v (8) ,v (9)}|=3, and |D(v,5)|=1. Therefore, directly recurse to R(v,i-1,φ i ) of a simple recursive R(v,i,φ i ) has more than twice the size of |D(v,5)| even on the simplified graph. i |. Because This increases the computational complexity of computing the recursion exponentially. Experiments have shown that this has a significant impact on the running time of the process of computing an effective parallelization strategy (described in detail later in this section). Planning the recursion with the terminal set allows finding an efficient ordering of the vertices that can find the optimal strategy significantly faster. As shown in Theorem 1 below, the cost computed by the recursion (4) is valid and corresponds to the strategy that minimizes the cost function in equation (1).

[0071] Lemma 1: Given a computation graph G = (V, E) and for any vertex sequence v

[0072] v (i) ∈V and a substrategy φ containing configurations for vertices in D(v,i) i ,

[0073]

[0074] Among them, Φ'′ is used for {v (i) The set of all valid sub-strategies of}∪L(v,i).

[0075] Proof: It will be shown that Recursively calling (i) at most once, (ii) at least once, and (iii) only if v (j) ∈L(v,i).

[0076] According to the definition of the terminal set, for any x,y st1≤x <y≤|V|, Since as a contradiction, if v (j) ∈T(v,x)∩T(v,y), then This assumption is violated. This proves (i).

[0077] To prove (ii), suppose, as a contradiction, that we never Call where v (j) ∈L(v,i). Without loss of generality, let v(j) is closest to v (i) vertices, that is, for any other k∈[j+1,i-1], from Recursively calling or Let U = {v (x) |v (j) ∈L(V,x)} is a set of vertices such that v (j) From this vertex set, it is left reachable. Let v (k) ∈U is the closest to v in U (j) The vertex of Then, according to the definition of the terminal set, v (j) ∈T(v,k), and since according to the assumptions made Recursively calling Therefore, from Call This contradicts the assumption.

[0078] It can be seen that (iii) is always true, because if Then for any v (k) ∈L(v,i), Therefore, for any v (k) ∈{v (i)}∪L(v,i),

[0079] The following theorem follows from Lemma 1.

[0080] Theorem 1: Let G = (V, E) be the computation graph of a DNN executed in a processing environment with p devices with an average FLOP-to-byte ratio r. Let v be the sequence for V and Φ be all possible strategies for G, then

[0081]

[0082] Proof: Since the computation graph is a weakly connected graph, L(v,|V|)∪{v |V|}=V, as follows Lemma 1

[0083]

[0084] Equation (5) is due to the following fact: And for any where E' = {{u,v}|(u,v)∈E} is the undirected equivalent of E.

[0085] Figure 3AAn exemplary process for sorting vertices into a valid sequence according to an embodiment of the present invention is shown. In one or more embodiments, process 300 (in Figure 3A GENERATESEQ) can generate a right-correlation-preserving set D(v,i) (in Figure 3A The process 300 can also simultaneously establish the terminal set of vertices of G used in FIG. 4 below (in Figure 3A is called vt).

[0086] In row 1, Figure 3A The process 300 in can initialize the right-related set vd to its neighbors for each node v∈V. In line 7, the node u with the smallest cardinality |ud| can be selected from the set of nodes U to be sorted. This node becomes v in V (i) Once u is added to V, for v (i) For all nodes in .d, vd can be updated, for example, to ensure that |vd| in line 7 is correctly maintained. In line 11, the terminal set for the node can be updated. Theorem 2 below shows that the relevant set and terminal set calculated by process 300 are correct. The computational complexity of process 300 is O(|V| 2 ).

[0087] Figure 3B A flowchart of a process for sorting vertices of a computation graph of a DNN to generate an effective vertex sequence to increase hardware utilization of the DNN and reduce training time of the DNN according to an embodiment of the present invention is shown. In one or more embodiments, the process 301 for sorting vertices for a computation graph begins by initializing (305) a right-dependent vertex set, a terminal vertex set, and an unsorted vertex set for one or more vertices in a vertex set. In one or more embodiments, for each vertex in the vertex set, a vertex with a minimum right-dependent set cardinality can be iteratively selected (310) from the unsorted vertex set, and the selected vertex can be assigned to a sequence. In one or more embodiments, the terminal vertex set and the right-dependent vertex set can be updated (315) in a manner that maintains the size of the right-dependent vertex set in the computation graph of the DNN. Finally, the vertex sequence can be output as an ordered vertex sequence (320).

[0088] Figure 4A A dynamic programming (DP) based process for computing an effective strategy for computing a computation graph according to an embodiment of the present invention is shown. In one or more embodiments, the DP process 400 (labeled GETBESTRATEGY) can be used Figure 3A The sorting process and recursion in (4).

[0089] In one or more embodiments, as shown in line 1 of DP process 400, the nodes in the computation graph G can be first sorted using the GENERATESEQ process. In line 6, all possible valid sub-strategies Φ' of the set D(v,i) can be calculated. Then, for each φ'∈Φ', the cost of Minimal configuration Line 13 calculates Lines 14-16 use the data stored in v (t) .tbl to calculate the cost And, at line 19, the configuration that results in the minimum cost may be stored in φ. In one or more embodiments, as shown in line 22, for v (i) The DP table can be updated with φ and its cost min_cost. From the definition of the terminal node, we can see that Therefore, in row 15, table v (j) .tbl includes for sub-strategies and its corresponding costs Similarly, in Figure 4A In line 26, v (|V|) .tbl contains an entry containing the effective policies for G and their costs. Figure 4A The total computational complexity is O(|V| 2 K M+1 ),in is the maximum number of configurations for the layer, and is the maximum size of a right-associated set. The following proof by induction shows that by using Figure 3A The right-dependent set and terminal set constructed by the GENERATESEQ procedure in are indeed correct, as follows:

[0090] Theorem 2: Given a computation graph G = (V, E), and for any node v (i) ∈V,(i)v (i) d = D(v,i), and (ii) v (i) .t=T(v,i), by using Figure 3A The sequence V calculated by the GENERATESEQ procedure in .

[0091] Proof: At the end of any iteration i, there exists a partial sequence v ≤i and the remaining nodes that will still be sorted U = Vv ≤i As shown in the figure, the following invariant holds at the end of any iteration i: for any u∈U, and for any v (j) ∈v ≤i ,v (j) .d=D(v,j) and v(j) .t=T(v,j)

[0092] u·d={v∈U-{u}|v∈P(v ≤i U{u,v},u)} (6)

[0093]

[0094] Inductive basis: When vd is initialized to N(v) and vt is initialized to When , the invariant usually holds at the beginning of the first iteration (i=0).

[0095] Inductive step: Assume that the invariant is true at the end of iteration i. Let v (i+1) is the node selected by GENERATESEQ at line 7 during iteration i+1, and let U be the set of unprocessed nodes at the beginning of iteration i+1 (where v (i+1) ∈U). For any vertex Since u and v (i+1) There is no restrictive path between them, so P(v ≤i ∪{u},u)=P(v ≤i+1 ∪{u},u). Therefore, invariants (6) and (7) are generally satisfied. For any u∈v( i+1) .d,

[0096]

[0097] Therefore, since ud is assigned at line 10 in GENERATESEQ, invariant (6) is satisfied. Furthermore, In addition, due to (for any u∈U), so v (i+1) .d is never modified after iteration i+1. Now,

[0098]

[0099] Therefore, since ut is assigned to ut at line 11 in GENERATESEQ, invariant (7) is satisfied. In addition, v (i+1) .t=P(v ≤i ∪{v (i+1)},v (i+1) )-{v (i+1)}-∪ j≤i L(v,j)=T(v,i+1). In addition, due to (for any u∈U), so v (i+1) .t is never modified after iteration i+1.

[0100] Figure 4B A flowchart of a process for finding an effective strategy for parallelizing the vertices of a DNN to increase hardware utilization and reduce training time according to an embodiment of the present invention is shown. In one or more embodiments, the process 401 for finding an effective parallelization strategy may begin by obtaining (405) a vertex sequence of the DNN. The vertex sequence may be sorted according to a node (or vertex) sorting strategy so that the size of the restricted neighbor set in the computational graph representing the DNN is reduced. In one or more embodiments, for each vertex in the vertex sequence, recursion may be used to calculate (410) a sub-strategy for parallelizing the layers of the DNN. Each layer may be associated with one or more effective configurations that reduce the configuration cost according to a cost function. Finally, a strategy with a minimum configuration cost for the computational graph may be output (415).

[0101] 3. Example: DNN2

[0102] Figure 5 5 shows a computational subgraph according to an embodiment of the present invention. Computational subgraph 500 corresponds to the starting module of the DNN2 network. Similar structures are repeated throughout the diagram. Figure 5 Nodes 171 and 193 in are high-level, while the rest of the nodes in the subgraph are sparse.

[0103] Since the computation graph of a DNN is typically sparse and has few high-level nodes, in one or more embodiments, the sequence generated by GENERATESEQ is very efficient for the computation graph of the DNN, as shown in the actual running time (shown in Table III below). For example, of the 218 nodes in the computation graph of the DNN2 module, 206 nodes have a level <5 and the remaining 12 nodes have a level ≥5. When the nodes are sorted in the original order (where the computation graph is built) or using a breadth-first traversal, the process of finding the best strategy runs for several hours before running out of memory (because the DP table grows significantly accordingly) before completion.

[0104] In contrast, in one or more embodiments, when GENERATESEQ is used to sort nodes, an effective strategy can be found in 20 seconds or less (for p=8 GPUs). This is mainly because GENERATESEQ ensures that high-level nodes ( Figure 5 Nodes 171 and 193 in are placed in the sequence after their (lower-level) neighbors and their ancestors / descendants are placed in the sequence, ensuring that the size of the right-dependent sets of these higher-level nodes remains small.

[0105] Experimental data show that for p = 8 GPUs, the number of configurations per vertex of DNN2 varies between 10 and 30, and for p = 64 GPUs, the maximum number of configurations reaches 100 (i.e., K = 100). In one or more embodiments, by using GENERATESEQ to sort the vertices, for any i, the size |D(v,i)∪{v (i)}| can be maintained at ≤3, and the maximum number of combinations of each vertex can be analyzed by this process, |Φ'|≤25200 (for p=8). For comparison, when using breadth-first sorting, the size of the right-dependent set reaches 11, making |Φ'|≥11 10 , resulting in a real cost in both time and memory that is too high.

[0106] D. Experimental results

[0107] The hybrid parallel strategy found by DP process 400 is evaluated on four different benchmarks. The benchmarks are chosen to be representative of the entire DNN space. a) DNN1 is an image classification convolutional network (CNN) whose computational graph is a simple path graph where each layer is only connected to the next layer; b) DNN2 is a deep CNN that uses inception modules to increase the number of layers while maintaining a reasonable computational budget. Nodes are split and cascaded at the beginning and end of each inception module, respectively, resulting in a small number of high-level nodes in its computational graph; c) DNN3 is a two-layer recursive neural network composed of LSTM units for language modeling tasks; and finally, d) DNN4 is a non-recursive neural machine translation model whose computational graph is very different from recursive networks such as DNN3. The datasets used in the experiments are summarized in Table II. Batch size 128 is used for CNN and batch size 64 is used for the rest of the benchmarks. The results using embodiments of the present disclosure are compared with data parallelism, expert-designed strategies, and the strategies proposed by Framework 1.

[0108] Table II

[0109] Datasets for experiments with different DNNs

[0110] Network data collection

[0111]

[0112] Framework 1: Framework 1 is a deep learning framework that automatically finds fast parallelizable policies. The algorithm utilizes a general Markov Chain Monte Carlo (MCMC) search process to explore the search space and iteratively proposes candidate policies based on the simulation performance of previous candidates. When the search process ends, the framework returns the best policy it has found. Since this approach is based on metaheuristics, the framework may get stuck in local minima and thus return suboptimal policies. Initial candidates from the search space need to be provided to MCMC to start the search process, and the efficiency of the policies found by Framework 1 may also vary depending on the initial candidates. The evaluation of Framework 1 in this paper uses expert-designed policies as initial candidates so that Framework 1 can improve them.

[0113] Expert strategies: Expert-designed parallelization strategies are developed by domain experts to improve the parallel performance of models on a case-by-case basis. Since not all DNNs have clear expert-designed strategies, the following strategies that are most relevant to various benchmarks are selected: For convolutional networks, data parallelism is used for convolutional layers, and model parallelism is used for fully connected layers. This technique is called "one weird trick" (OWT). Even though this technique is specifically proposed for DNN1, it can be generally applied to any convolutional network. Therefore, we use this technique to evaluate DNN1 and DNN2, which is discussed in the experimental results section D below. For RNNs, a data+pipeline parallel strategy has been proposed, in which different layers of the RNN are placed on different devices to achieve pipeline parallelism, and to achieve data parallelism, each layer is replicated on the remaining devices. This strategy is compared with the DNN3 experiments. For the DNN4 model, the proposed model parallel strategy is used as the expert-designed strategy in the experiments, which is also discussed in the experimental results section D below. This strategy is mainly to overcome the memory bottleneck to train large DNN4 models under the memory constraints of the current architecture while achieving good parallel execution efficiency.

[0114] 1. The cost of different methods for finding effective strategies

[0115] In this subsection, the time taken by different methods is measured to find the best strategy for four different benchmarks. The running time of the embodiment using GENERATESEQ to sort the vertices is compared with the framework work 1 that traverses the vertex sorting with breadth first (BF) and uses meta-heuristics to find an effective strategy. The embodiments here are implemented in a prototype tool written in Python. The measurements are performed on a machine with an Intel Xeon E5 (SandyBridge) processor and a 1080Ti GPU. Since the t l and t xThe analysis cost of the proposed method is 100%, so the embodiment does not use the GPU to perform the analysis; however, Framework 1 performs the actual simulation by executing operators on the GPU and uses these measurements in its analysis to find the best policy. Table III below shows the time taken by different methods to find the best policy. To measure the running time, the search process of Framework 1 is paused when Framework 1 cannot improve the best found policy within half the search time or when Framework 1 reaches 250,000 iterations.

[0116] Since the computational graph of DNN1 is a simple path graph, for different vertices, R(v ≤i ,v >i ) and D(v,i) are both of size 1. Therefore, both BF and GENERATESEQ sorting are able to efficiently compute the optimal policy for DNN1 in similar time. However, for DNN2, BF sorting is unable to find the optimal policy without running out of memory due to the high node levels of some vertices, as detailed in Section 3 below.

[0117] For the DNN3 benchmark, since the RNN operator (with LSTM cells) can be efficiently represented in a single iteration space, the complete RNN operator including the recursive step is represented as a single vertex in the computational graph. The iteration space of the RNN operator is a five-dimensional space consisting of the batch dimension, the sentence sequence dimension (the recursive step size is captured by this dimension), the layer dimension, the hidden dimension, and the output dimension. Note that this is different from the way the RNN operator is handled by Framework 1. In Framework 1, the loop dimension is expanded (the experiments in this paper use an expansion factor of 40) and each iteration is represented as a vertex in the graph. In one or more embodiments, by representing the entire RNN operator as a single vertex, in addition to significantly reducing the graph size, it also allows the analysis of configurations that exploit the inherent pipeline parallelism present within the RNN operator. The configuration of splitting the layer dimension and the sentence sequence dimension can capture pipeline parallel opportunities in the RNN. As detailed in Section B, embodiments that do not capture inter-layer pipeline parallelism are still able to capture intra-layer pipeline parallelism by splitting the layer dimension of the iteration space of DNN3. With this representation, the computational graph of DNN3 is simplified to a simple path graph. Therefore, both BF and GENERATESEQ sorting are able to efficiently find the best policy in, e.g., one second. Since Framework 1 dynamically unrolls the loop dimensions, its processing takes longer to analyze the resulting larger graph.

[0118] Similar to DNN2, the computational graph of the DNN4 model has a large number of sparse vertices with very few dense vertices. One major difference is that these high-level vertices (e.g., the final output of the encoder) have longer dependencies (i.e., longer effective ranges in actual computations) because the results of these vertices are used later in the computation. The presence of such long dependencies can eliminate possible vertex sorting that can effectively reduce the size of the right-dependent set as in the DNN2 model. In one or more embodiments, this may result in longer running times to find the optimal strategy. As with DNN2, BF sorting cannot find the optimal strategy for DNN4 due to memory limitations. Since the DNN4 model was not implemented and analyzed using Framework 1, no comparison of the running time of Framework 1 for DNN4 is given here.

[0119] 2. Performance comparison of different strategies

[0120] Below we compare the performance of different strategies. Experiments are performed on different numbers of GPUs, from 4 (on a single node) to 64 (scaled on 8 nodes), increasing in powers of 2. The nodes are connected to each other using an InfiniBand interconnect network. The results are evaluated in the following two processing environments:

[0121] a) Multi-node / multi-GPU system where each node includes 8 GeForce GTX1080 Ti GPUs (with sm_61 compute capability) fully connected using PCIe links; b) Multi-node / multi-GPU system where each node includes 8 GeForce RTX 2080Ti GPUs (with sm_75 compute capability) fully connected using PCIe links. The benchmark and strategy are implemented in the Grid-TensorFlow framework for evaluation. Since the DNN4 model is not implemented and evaluated on Framework 1, the Framework 1 results of the DNN4 model are not included in the experiments. Figure 6 and Figure 7 The speedup achieved by the strategy proposed by the embodiment in the experiment on the 1080Ti and 2080Ti systems compared with the data parallel strategy is shown respectively. On the 1080Ti machine, the strategy proposed by this embodiment can achieve a data parallel speedup of more than 1.85×. Figure 6As shown, the strategy proposed by the embodiment always performs better than the strategy designed by the expert and the strategy proposed by the framework 1. In addition, on the 2080Ti machine, the strategy proposed by the embodiment achieves a 4-fold acceleration relative to data parallelism, and is superior to the strategy designed by the expert and the strategy from the framework 1. When connected by a PCIe link, the 2080Ti GPU does not support peer-to-peer data access, resulting in poor hardware communication efficiency, while having a higher computing peak compared to the 1080Ti GPU. This results in a very low machine balance (ratio between peak communication bandwidth and peak GFLOPS) on the 2080Ti node. Therefore, the inefficiency of the parallelization strategy on the 2080Ti node is even worse than on the 1080Ti node, which is obvious from the experiment. This allows the embodiment to achieve a performance 4 times higher than the data parallel strategy on the 2080Ti node.

[0122] Table III

[0123] The time required for different processes to find effective parallelization strategies (unit: minutes, seconds, milliseconds)

[0124]

[0125] p: number of GPUs; BF: breadth-first sort; OOM: out of memory; NA: not available.

[0126] 3. Computational strategy analysis

[0127] DNN1: DNN1 has five convolutional layers followed by three fully connected layers. For p = 8 GPUs, refer to Figure 4A The discussed DP process GETBESTRATEGY suggests using a data parallel strategy for convolutional layers. For the first and third fully connected layers, the process suggests splitting the out-channel dimension into 2 and the intra-channel dimension into 4; for the second fully connected layer, it suggests splitting the out-channel dimension into 4 and the intra-channel dimension into 2. Advantageously, this alternating pattern eliminates inter-layer communication between fully connected layers. This is different from the expert-designed OWT ("One Wonky Trick") strategy, in which a simple model parallelism is used for all fully connected layers, so that the intra-channel dimension is not split and the out-channel dimension is split into 8-ways, which leads to unfavorable all-to-all communication between each fully connected layer.

[0128] DNN2: The initial network has a sequence of initial modules (AE) consisting of convolutional layers, followed by a single final fully connected layer. In one or more embodiments, the effective strategy obtained from GETBESTRATEGY suggests using data parallelism for the initial modules A to D, and a mix of data + model parallelism for module E. This is because, as modules get deeper, their output channel dimensions become larger. Therefore, the cost function of the DP process finds that the communication cost of full data parallelism is higher. For the final fully connected layer, when p=8, the process suggests splitting the out-of-channel dimension into 2 and the in-channel dimension into 4.

[0129] DNN3:RNNLM network consists of an embedding layer, followed by two layers of LSTM units, and a final projection layer, whose computations are dominated by matrix-matrix multiplications. The embedding layer has a relatively large vocabulary dimension V and a much smaller embedding dimension H. In one or more embodiments, for the embedding layer, GETBESTRATEGY may prefer to separate the vocabulary dimension from other dimensions.

[0130] For LSTM cells, the DP process suggests fully splitting the LSTM layer dimension, and partially splitting the other three dimensions - batch, hidden, and output dimensions - to varying levels depending on the number of GPUs executing the DP process. The output dimension of the final projection layer can be the same as V, while the hidden dimension can be the same as H. In one or more embodiments, the process suggests fully splitting the output dimension.

[0131] DNN4: The DNN4 model is a non-recurrent attention based NMT model. A known hybrid parallel strategy splits the batch dimension of all layers into m-way, splits the model dimension of different layers into vocabulary dimension, and splits the feed-forward hidden layer dimension and attention head into n-way. In one or more embodiments, the process suggests using full model parallelism on several layers, especially the embedding layer, while using a mixture of different degrees of data parallelism and model parallelism for the remaining layers.

[0132] E. Related Work

[0133] Data parallelism has been widely used as a standard technique for parallelizing training DNNs. However, when the model parameters are large, data parallelism performs poorly due to high communication requirements. OWT has been proposed for parallelizing CNNs, and some have noticed that modern CNNs consist of two types of layers with different characteristics: (i) convolutional layers containing a small number of parameters, and (ii) fully connected layers with a large number of parameters. Therefore, embodiments consider parallelization strategies that parallelize these two types of layers differently. Since data parallelism is typically best suited for convolutional layers containing a small number of model parameters, and model parallelism is best for fully connected layers seen in CNNs, it is proposed to use data parallelism to parallelize the convolutional layers, and switch to model parallelism for the fully connected layers that appear at the end of the network. As Figure 6 and Figure 7 As shown, more complex hybrid parallel strategies according to the embodiments proposed herein may be used to improve performance.

[0134] A method for automatically finding the optimal schedule for CNNs based on dynamic programming exploits the following graph properties commonly seen in the computation graphs of CNNs: multiple nodes in the computation graphs of CNNs have a single incoming edge and a single outgoing edge. Based on this observation, two graph reduction operations are proposed: node elimination and edge elimination to simplify the graph. This method takes into account maintaining optimality through these simplification operations and uses an efficient dynamic programming-based process to calculate the optimal policy for various CNNs. However, the computation graphs of other networks such as RNNs do not have this special property, so the technique cannot effectively reduce the graph to find the optimal policy in a reasonable time. In contrast, the embodiments disclosed herein are not limited to the computation graphs of CNNs, so effective policies for various types of networks (such as RNN and DNN4 models) can be found in a few minutes. In addition, the embodiments herein define parallelization configurations for any dimension in the split iteration space. This is significantly different from only splitting the output tensor dimension, which severely limits the search space because some dimensions (e.g., the reduced k dimension of GEMM) are not considered possible choices for parallelization.

[0135] One method for automatically finding effective parallelization strategies for various DNNs using Framework 1 uses an execution simulator that uses a general Markov chain Monte Carlo (MCMC) search process to explore the search space to find the best strategy. The strategy returned by the framework does not have to be optimal. Although the method considers the entire search space, the embodiments of the present invention can ignore inter-layer pipeline parallelism to advantageously find effective strategies for various DNNs much faster than Framework 1 without being limited by being stuck at a local minimum solution.

[0136] The reinforcement method (REINFORCE) uses machine learning to find effective device arrangements for various layers to achieve effective pipeline parallelization. However, this technique ignores data and model parallel strategies in the search process. In addition, it requires multiple GPUs and takes several hours to find an effective strategy, while the embodiments of this article are completed in a few minutes. Some methods use polyhedral compilation techniques to optimize the kernels of each DNN operator to execute efficiently on the GPU. However, these methods do not consider the parallelization of these kernels on multiple devices. Embodiments can use such techniques orthogonally to further improve performance within each GPU.

[0137] Some previous efforts have made semantic modifications to the model to expose better pipeline parallelism, thereby improving parallel training. However, these semantic modifications result in changes in model accuracy compared to the original model, and they may also take more time to converge, thus eliminating any advantage gained from the modifications. In contrast, the embodiments herein do not require semantic modifications to be performed on the model. As a result, the convergence speed and final accuracy can be exactly the same as the original model, providing better hardware utilization through enhanced parallelization.

[0138] Based on domain-specific knowledge, several expert-designed strategies have been proposed for different networks. One suggests a technique for convolutional networks, while another suggests a method for achieving good pipeline parallelism for RNNs. However, each network must be manually analyzed individually to obtain effective strategies. Furthermore, these strategies are not necessarily optimal. In contrast, the embodiments proposed in this article automate this process and can point expert users in the right direction for parallelization.

[0139] F. Some conclusions

[0140] The proposed system and method help to automatically find effective parallel strategies for DNN applications. The embodiment uses a recursive formula to calculate the minimum cost of the computational graph. A technique for sorting vertices in an effective order is proposed, which allows the best strategy to be calculated in a few minutes to parallelize the graph. The results are evaluated compared to data parallelism, expert-designed strategies, and strategies proposed by a deep learning framework (framework 1). The results show that the strategies proposed in each embodiment are 4 times higher than standard data parallelism. In addition, the proposed strategy performs better than the expert-designed strategy and the strategy proposed in framework 1.

[0141] G. Computing System Embodiments

[0142] In one or more embodiments, aspects of the present patent document may be directed to one or more information processing systems (or computing systems), may include one or more information processing systems (or computing systems), or may be implemented on one or more information processing systems (or computing systems). An information processing system / computing system may include any tool or collection of tools operable to calculate, determine, classify, process, send, receive, retrieve, originate, route, switch, store, display, communicate, prove, detect, record, reproduce, process or utilize any form of information, intelligence or data. For example, a computing system may be or may include a personal computer (e.g., a laptop computer), a tablet computer, a mobile device (e.g., a personal digital assistant (PDA), a smart phone, etc.), a smart watch, a server (e.g., a blade server or a rack server), a network storage device, a camera or any other suitable device, and may vary in size, shape, performance, functionality and price. A computing system may include a random access memory (RAM), one or more processing resources, such as a central processing unit (CPU) or hardware or software control logic, ROM, and / or other types of memory. Additional components of a computing system may include one or more disk drives, one or more network ports for communicating with external devices, and various input and output (I / O) devices (e.g., keyboard, mouse, touch screen, and / or video display). A computing system may also include one or more buses for transmitting communications between various hardware components.

[0143] Figure 8 800 is a simplified block diagram of a computing system according to an embodiment of the present invention. It should be understood that the functionality shown in system 800 can be operated to support various embodiments of the computing system, although it should be understood that the computing system can be configured differently and include different components, including having Figure 8 Fewer or more components than shown.

[0144] like Figure 8 As shown, the computing system 800 includes one or more central processing units (CPUs) 801 that provide computing resources and control the computer. The CPU 801 can be implemented with a microprocessor, etc., and can also include one or more graphics processing units (GPUs) 819 and / or floating-point coprocessors for mathematical calculations. The system 800 can also include a system memory 802, which can be in the form of a random access memory (RAM), a read-only memory (ROM), or both.

[0145] Multiple controllers and peripherals can also be provided, such as Figure 8As shown. Input controller 803 represents an interface to various input devices 804 such as a keyboard, mouse, touch screen and / or stylus. The computing system 800 may also include a storage controller 807 for interfacing with one or more storage devices 808, each of which includes a storage medium such as a tape or disk, or an optical medium that can be used to record program instructions for operating systems, utilities and applications, which may include embodiments of programs that implement various aspects of the present disclosure. One or more storage devices 808 may also be used to store data processed or data to be processed according to the present disclosure. The system 800 may also include a display controller 809 for providing an interface to a display device 811, which may be a cathode ray tube (CRT), a thin film transistor (TFT) display, an organic light emitting diode, an electroluminescent panel, a plasma panel, or other types of displays. The computing system 800 may also include one or more peripheral device controllers or interfaces 805 for one or more peripheral devices 806. Examples of peripheral devices may include one or more printers, scanners, input devices, output devices, sensors, etc. The communication controller 814 can be connected to one or more communication devices 815 interfaces, which enables the system 800 to connect to remote devices via any of a variety of networks including the Internet, cloud resources (e.g., Ethernet cloud, Fibre Channel over Ethernet (FCoE) / Data Center Bridging (DCB) cloud, etc.), a local area network (LAN), a wide area network (WAN), a storage area network (SAN), or via any suitable electromagnetic carrier signal including infrared signals.

[0146] In the illustrated system, all major system components may be connected to bus 816, which may represent more than one physical bus. However, various system components may or may not be physically close to each other. For example, input data and / or output data may be remotely transmitted from one physical location to another physical location. In addition, programs that implement various aspects of the present disclosure may be accessed from a remote location (e.g., a server) over a network. Such data and / or programs may be transmitted via any of a variety of machine-readable media, including, but not limited to: magnetic media, such as hard disks, floppy disks, and tapes; optical media, such as CD-ROMs and holographic devices; magneto-optical media; and hardware devices specifically configured to store or execute program code, such as application specific integrated circuits (ASICs), programmable logic devices (PLDs), flash memory devices, and ROM and RAM devices.

[0147] Aspects of the present disclosure may be encoded on one or more non-transitory computer-readable media having instructions for one or more processors or processing units so that the steps are performed. It should be noted that one or more non-transitory computer-readable media should include volatile and non-volatile memory. It should be noted that alternative embodiments are possible, including hardware embodiments or software / hardware embodiments. Hardware-implemented functions can be implemented using ASICs, programmable arrays, digital signal processing circuits, etc. Therefore, the term "device" in any claim is intended to cover software and hardware implementations. Similarly, the term "computer-readable medium" used herein includes software and / or hardware having an instruction program contained thereon, or a combination thereof. In view of these implementation substitutions, it should be understood that the drawings and the accompanying descriptions provide functional information that those skilled in the art will require to write program code (i.e., software) and / or manufacture circuits (i.e., hardware) to perform the desired processing.

[0148] It should be noted that embodiments of the present disclosure may also relate to computer products with non-transitory, tangible computer-readable media having computer code thereon for performing various computer-implemented operations. The media and computer code may be specially designed and constructed for the purposes of the present disclosure, or they may be of a type known or available to those skilled in the relevant art. Examples of tangible computer-readable media include, but are not limited to: magnetic media, such as hard disks, floppy disks, and tapes; optical media, such as CD-ROMs and holographic devices; magneto-optical media; and hardware devices specially configured to store or execute program code, such as application specific integrated circuits (ASICs), programmable logic devices (PLDs), flash memory devices, and ROM and RAM devices. Examples of computer code include machine code such as produced by a compiler, and files containing higher-level code executed by a computer using an interpreter. Embodiments of the present disclosure may be implemented in whole or in part as machine executable instructions, which may be located in program modules executed by a processing device. Examples of program modules include libraries, programs, routines, objects, components, and data structures. In a distributed computing environment, program modules may be physically located in a local, remote, or both setting.

[0149] Those skilled in the art will recognize that the computing system or programming language is not critical to the practice of the present disclosure. Those skilled in the art will also recognize that the multiple elements described above can be physically and / or functionally separated into sub-modules or combinations.

[0150] It will be appreciated by those skilled in the art that the foregoing examples and embodiments are exemplary and do not limit the scope of the present disclosure. All permutations, enhancements, equivalents, combinations, and improvements thereof that are apparent to those skilled in the art upon reading this specification and studying the accompanying drawings are included within the true spirit and scope of the present disclosure. It should also be noted that any claim may be arranged differently, including with multiple dependencies, configurations, and combinations.

Claims

1. A non-transitory computer-readable medium comprising one or more instruction sequences, which when executed by at least one processor implement the steps of training a deep neural network (DNN), the steps comprising: Obtaining an effective strategy for training the DNN by parallelizing the layers of the DNN; as well as Using the obtained effective strategy, training the DNN in a predetermined processing environment to increase hardware utilization of the DNN and reduce training time of the DNN, Wherein, obtaining an effective strategy for training the DNN by parallelizing the layers of the DNN includes: Obtaining a vertex sequence, wherein vertices in the vertex sequence represent layers of the DNN, the vertex sequence having been sorted according to a vertex sorting strategy such that a size of a restricted neighbor set in a computational graph representing the DNN is reduced; For each vertex, using recursion to compute a substrategy for parallelizing the vertices of the DNN, each vertex being associated with one or more efficient configurations that reduce a configuration cost according to a cost function related to a computational performance of the predetermined processing environment used for training; and A policy with the lowest cost for the computation graph is output as an effective policy for training the DNN.

2. The non-transitory computer-readable medium of claim 1, wherein: The restricted neighbor set is a right-associated vertex set.

3. The non-transitory computer readable medium of claim 2, wherein: Obtaining the vertex sequence comprises the following steps: For one or more vertices in the vertex set, initialize the right-dependent vertex set, the terminal vertex set, and the unsorted vertex set; For each vertex, perform the following steps: iteratively selecting a vertex with a minimum right-dependent set cardinality from the unsorted vertex set, and assigning the selected vertex to the vertex sequence; Updating the terminal vertex set and the right-dependent vertex set to correctly maintain the size of the right-dependent vertex set in the computation graph for the DNN; and Output the vertex sequence as an ordered vertex sequence.

4. The non-transitory computer-readable medium of claim 1, wherein: The recursion includes a set of terminal sets.

5. The non-transitory computer readable medium of claim 1, wherein: The cost function ignores inter-layer pipeline parallelism in different vertices of the DNN to reduce the search space, and considers pipeline parallelism within a layer of the DNN.

6. The non-transitory computer-readable medium of claim 1, the step further comprising using the strategy with the lowest cost to execute the DNN in parallel on a plurality of devices according to the strategy to train the DNN.

7. The non-transitory computer-readable medium of claim 1, the step further comprising retrieving the one or more valid configurations and their costs from a dynamic programming table to increase computation speed.

8. The non-transitory computer readable medium or medium of claim 1, wherein: The computation graph includes a set of left-reachable vertices defined as being reachable from the vertex via an undirected path.

9. A non-transitory computer readable medium comprising one or more instruction sequences, which when executed by at least one processor implement the following steps of training a deep neural network DNN, the steps comprising: Sorting vertices of a computational graph of the DNN to produce an ordered sequence of vertices, wherein the vertices in the ordered sequence of vertices represent layers of the DNN, and the vertices are associated with configurations having minimum configuration costs, wherein the configuration costs are related to computational performance of a predetermined processing environment for training; Using the ordered vertices, calculating an optimal strategy for training the DNN; Using the calculated optimal strategy, training the DNN in the predetermined processing environment to increase hardware utilization of the DNN and reduce training time of the DNN, The step of sorting the vertices of the computation graph of the DNN to generate the ordered vertex sequence comprises: For one or more vertices in the vertex set, initialize the right-related vertex set, the terminal vertex set and the unsorted vertex set; For each vertex, perform the following steps: iteratively selecting a vertex with a minimum right-dependent set cardinality from the unsorted vertex set, and assigning the selected vertex to the vertex sequence; Updating the terminal vertex set and the right-dependent vertex set so that the size of the right-dependent vertex set in the computation graph is correctly maintained; and The vertex sequence is output as the ordered vertex sequence.

10. The non-transitory computer readable medium of claim 9, wherein: The computation graph represents a DNN.

11. The non-transitory computer readable medium of claim 9, wherein: The computation graph includes a set of left-reachable vertices defined as being reachable from the vertex via an undirected path.

12. The non-transitory computer readable medium of claim 11, wherein: The vertices are associated with one or more valid configurations.

13. A system for training a deep neural network (DNN), the system comprising: one or more processors; as well as A non-transitory computer readable medium comprising one or more sets of instructions which, when executed by at least one of the one or more processors, cause the following steps to be performed, the steps comprising: Obtaining an efficient strategy for training the DNN by parallelizing the layers of the DNN; and Using the obtained effective strategy, training the DNN in a predetermined processing environment to increase hardware utilization of the DNN and reduce training time of the DNN, The method of obtaining an effective strategy for training the DNN by parallelizing the layers of the DNN includes: obtaining a vertex sequence, wherein vertices in the vertex sequence represent the layers of the DNN, and the vertex sequence has been sorted according to a vertex sorting strategy so that the size of a restricted neighbor set in a computational graph representing the DNN is reduced; For each vertex, using recursion to compute a substrategy for parallelizing the vertices of the DNN, each vertex being associated with one or more efficient configurations that reduce a configuration cost according to a cost function related to a computational performance of the predetermined processing environment used for training; and A policy with the lowest cost for the computation graph is output as the policy for training the DNN.

14. The system of claim 13, wherein: The restricted neighbor set is a right-associated vertex set.

15. The system of claim 14, wherein: Obtaining the vertex sequence comprises the following steps: For one or more vertices in the vertex set, initialize the right-dependent vertex set, the terminal vertex set, and the unsorted vertex set; For each vertex in the vertex set, perform the following steps: iteratively selecting a vertex with a minimum right-dependent set cardinality from the unsorted vertex set, and assigning the selected vertex to the vertex sequence; Updating the terminal vertex set and the right-dependent vertex set so that the size of the right-dependent vertex set in the computation graph of the DNN is correctly maintained; and Output the vertex sequence as an ordered vertex sequence.

16. The system of claim 13, wherein: The recursion includes a set of terminal sets.

17. The system of claim 13, wherein: The cost function ignores inter-layer pipeline parallelism in different vertices of the DNN to reduce the search space, and considers pipeline parallelism within a vertex of the DNN.

18. The system of claim 13, wherein: The steps also include using the strategy with the lowest cost to execute the DNN in parallel on multiple devices according to the strategy to train the DNN.

19. The system of claim 13, wherein: The steps also include retrieving the one or more valid configurations and their costs from a dynamic programming table to increase computation speed.

20. The system of claim 13, wherein: The computation graph includes a set of left-reachable vertices defined as being reachable from the vertex via an undirected path.