Machine learning combines techniques from statistics and artificial intelligence to create algorithms that can learn from empirical data and generalize to solve problems in various domains such as natural language processing, financial fraud detection, terrorism threat level detection, human health diagnosis and the like. In recent years, more and more raw data that can potentially be utilized for machine learning models is being collected from a large variety of sources, such as sensors of various kinds, web server logs, social media services, financial transaction records, security cameras, and the like.
At least for some types of problems, the process of developing a predictive machine learning model often includes a training phase, during which a set of collected observation records called a training data set is analyzed to identify relationships between some set of input variables and one or more output variables for which predictions are to be made using the model. The training data set may comprise millions or even billions of records, and may take up terabytes or even petabytes of storage in some cases, e.g., for “deep learning” problems. In some training techniques such as those involving the use of stochastic gradient descent (SGD) or similar optimization algorithms, the training phase may often involve several passes through the training data set, e.g., until the algorithm converges on an optimization goal such as an acceptably low value of a cost function or an error function.
Analyzing extremely large training data sets on a single machine may lead to unacceptably long training phase durations. For some training techniques, it may be possible to partition the training data set among several machines. Such parallelization approaches may require model parameter updates to be synchronized among the participating machines, however. Depending on how much data has to be transferred among the set of machines, in some scenarios the benefits of analyzing the training data in parallel may be offset by the introduction of bottlenecks in the network used for the synchronization-related data transfers. Determining the optimum number of machines to use in parallel for training various types of models for various sizes of training data sets may thus present non-trivial challenges even for experienced machine learning experts.
While embodiments are described herein by way of example for several embodiments and illustrative drawings, those skilled in the art will recognize that embodiments are not limited to the embodiments or drawings described. It should be understood, that the drawings and detailed description thereto are not intended to limit embodiments to the particular form disclosed, but on the contrary, the intention is to cover all modifications, equivalents and alternatives falling within the spirit and scope as defined by the appended claims. The headings used herein are for organizational purposes only and are not meant to be used to limit the scope of the description or the claims. As used throughout this application, the word “may” is used in a permissive sense (i.e., meaning having the potential to), rather than the mandatory sense (i.e., meaning must). Similarly, the words “include,” “including,” and “includes” mean including, but not limited to.
Various embodiments of methods and apparatus for dynamically scaling the set of execution platforms (e.g., physical or virtual machines) used for a training phase of a machine learning model are described. Numerous types of machine learning models are trained or generated by analyzing a set of collected observation records, which may be termed a training data set (or simply a training set). A given observation record may, for example, include values of one or more input variables, and corresponding values of one or more output or “prediction target” variables. The training process or “training phase” for a model typically involves determining statistical relationships (e.g., correlations) between the input and output variables, and deriving values of one or more model parameters (e.g., coefficients to be assigned to respective input variables) such that the model parameters can be used to predict the values of the output variables from the values of the input variables. In some iterative training techniques, as more and more observation records of the training data set are analyzed, the values of the model parameters are adjusted in view of an overall optimization goal (such as a goal of minimizing a prediction error metric or cost function). The training phase may be continued, sometimes re-analyzing the training data set multiple times, until a training termination condition is reached—e.g., either the optimization goal has been achieved to within a desired level of proximity, or the resources available for training the model have been exhausted.
In some training techniques, the observations of the training data set may be partitioned or distributed across multiple servers or execution platforms so that the parameter determination analysis can be parallelized. As each participating execution platform makes adjustments to the model parameters based on a different subset of observations, information about the adjustments made at the different platforms may have to be synchronized, e.g., via messages exchanged over a network among the participants, or via messages sent to a central parameter coordinator. The synchronization of the parameters may sometimes result in a network bottleneck, which could offset the hoped-for benefits of the parallelization. For example, during the early stages of a training phase of a model, substantial changes to the model parameters may result from the analysis of small groups of observation records, or even individual observation records, and as a result the amount of synchronization-related data that has to be transmitted over the network may be quite large. In contrast, later in the training phase, many of the parameter values may have largely converged to their optimal values, so relatively small amounts of synchronization data may have to be transmitted over the network. Thus, at least for some training algorithms, the relative amounts of network bandwidth resources required, versus the computation resources required at the execution platforms, may change over the course of a given training phase of a given model. Instead of using the same number of execution platforms throughout the training phase, in at least some scenarios it may be useful to change the number of execution platforms (and/or the types of execution platforms) deployed at various stages of the training phase. Using such a dynamic scaling technique, the total amount of time (and/or the total resource usage) for training the model may be reduced or minimized in various embodiments.
According to at least some embodiments, an indication of a request to train a machine learning model using a specified training data set may be received at one or more computing devices responsible for coordinating model training and/or for making parallelism-related resource deployment decisions. Such computing devices may be referred to herein as training coordinators or parallelism decision nodes. In one embodiment the request may initially be transmitted to a component of a distributed multi-tenant machine learning service by a client of the service, for example. A pool of execution platforms which can be used for training various models (as well as for other machine learning tasks as discussed below) may be available to the training coordinators in various embodiments. Based on one or more factors such as the type of model which is to be generated, the problem domain of the model, the size of the training data set, and/or on a parameter specified in the request, a parallelizable training technique to be used for the model may be identified. The term “parallelizable technique”, as used herein, refers generally to techniques which may be run either on a single execution platform, or on multiple execution platforms concurrently. In some embodiments, the training technique selected may not be designed to run in a single-threaded mode: that is, the technique may require multiple execution platforms. The term “parallelizable technique”, as used herein, is also intended to cover such techniques which cannot be implemented in a non-parallel mode.
In some embodiments, the parallelizable training technique may comprise the use of an optimization algorithm (such as stochastic gradient descent or similar algorithms) which has the property that as the optimization goal of the algorithm is neared, the amount of data that has to be transferred among the participating execution platforms typically falls. For an initial stage or sub-phase of the training phase of the model, a training coordinator may assign a first subset of the execution platforms available. In various embodiments, the training coordinator may also identify one or more conditions which are to trigger, prior to the completion of the training phase, a deployment of a different subset of the plurality of execution platforms. For example, if the cumulative amount of synchronization data that is transferred from the execution platforms falls below a threshold, a larger set of execution platforms may be suitable. Various other examples of the kinds of conditions which may lead to a change in the deployed execution platforms are discussed below in further detail.
The first subset of the execution platforms may then be activated to initiate the training phase in various embodiments. If the first subset includes multiple platforms, the training data set may be partitioned among the members of the first subset in at least some embodiments. The training coordinator may collect various metrics as the first stage or first set of operations of the training phase progresses—e.g., metrics regarding the amount of parameter synchronization data being transferred, the fraction of the training data set that is yet to be examined during the current iteration or pass through the training data set, the extent of convergence that has been achieved towards the optimization goal being pursued, resource utilization levels at the execution platform pool members and/or the interconnect(s) being used for the synchronization data, and so on. In some embodiments the training coordinator may detect, e.g., using some of the metrics collected, that one or more of the triggering conditions for a deployment change has been met. In such a scenario, a second subset of the plurality of execution platforms may be identified, to be used for at least a second stage or a second set of operations of the training phase. The second subset may include, for example, a different number of execution platforms, or at least some platforms which differ in performance or functional capabilities from one or more platforms of the first subset. In some embodiments, at least a portion of the training data set may be repartitioned, e.g., so that respective portions of the training data are assigned to each of the execution platforms of the second subset.
The second subset of the execution platforms may then be activated (and, depending on the overlap between the first subset and the second subset, one or more execution platforms of the first subset may be de-activated or released for other uses). The training coordinator may resume monitoring metrics pertaining to the progress of the training phase. As needed, if the triggering conditions for deployment changes are met, additional changes to the set of execution platforms deployed for the training phase may be made over time. Eventually, the goals of the training phase may be reached, and the training phase may be terminated. The training of the model may be ended based on any of various factors in different embodiments: e.g., if the cost function being optimized has met the optimization goal, if the entire training data set has been analyzed as many times as intended, if the maximum time set aside for training has elapsed, if the cumulative resource consumption of the training process has reached a threshold, or if a client's budget for training the model has been exhausted. After the training phase is complete, in some embodiments a test phase and/or an evaluation phase may be implemented in which the quality of the model's predictions on new data (e.g., observations that were not included in the training data set) that is determined. If the model's quality is deemed adequate, the model may then be employed for predictions in a production mode in some embodiments.
As described above, the number and/or types of execution platforms being used to train a given model may be changed based on one or more triggering conditions in various embodiments. As a result, in at least some embodiments, the training phase as a whole may be completed sooner, and/or at a lower total cost, than if a fixed set of execution platforms were used for the whole of the training. The techniques described herein may be applied for machine learning problems in a number of different domains, including, for example, deep learning problems, language translation or other natural language processing problems, financial fraud detection, terrorism threat level detection, health diagnosis, and the like, many of which may require the analysis of extremely large training data sets. While dynamic scaling approaches of the kinds discussed herein may be especially well suited to parallelizable training techniques such as stochastic gradient descent in which the amount of data that is exchanged among the participating training nodes or servers typically changes (e.g., diminishes) during the course of training a given model, similar approaches may be taken with respect to other parallelizable training algorithms in various embodiments.
Example System Environment
The training coordinator 140, which may be implemented at one or more computing devices in the depicted embodiment, may be responsible for determining the set of EPs 150 that are to be deployed during various stages of the training phase of a given model. The role of training coordinator may be fulfilled by a variety of different entities of system 100 in different embodiments. In some cases, for example, one or more dedicated components of a workload distribution strategy layer of a machine learning service may be designated as a training coordinator for at least one model, as described below in the context of
In the embodiment shown in
A model training request 102 may indicate the particular PTT 130 to be employed in some embodiments. In other embodiments, the training coordinator 140 may select a particular PTT 130 (such as 130B) for training a given model such as Ml, e.g., based on factors such as the type of model being trained, the size of the training data set, constraints on the resources or time which can be used for training Ml, and so on. The training coordinator 140 may identify and deploy an initial EP set 152A, comprising for example EPs 150E and 150K, for a first stage 105-1 of Ml's training phase 105, as indicated by initial deployment arrow 133. In addition, depending on various factors such as the particular PTT selected, the training coordinator 140 may also determine one or more triggering conditions which are to lead to a change to the EP set used for Ml as the training phase progresses. In some embodiments, a reduction in the bandwidth required for transmitting parameter updates (or synchronizing the parameters) among the EPs may trigger a deployment change (DC), for example, and the training coordinator may decide the extent of the reduction that is to trigger the DC as well as the particular changes which would be implemented if the reduction condition is met. In other embodiments, when the fraction of the training data that has been examined reaches a threshold (e.g., a complete pass of several planned passes through the training data, or 50% of the training data), a deployment change may be triggered. A variety of factors may trigger deployment changes in different embodiments, as discussed below in further detail.
The training coordinator 140 may collect data from a variety of sources to help make deployment change decisions in the depicted embodiment. For example, a set of resource monitors 143 may provide usage metrics regarding various resources (e.g., CPUs/cores, network bandwidth, memory, storage devices and the like) from various members of the EP pool 120 to coordinator 140, and training progress monitor(s) 142 may indicate the rate at which the PTT is converging, or the fraction of the training data that has been analyzed in the current pass. The EPs 150E and 150K of the deployed EP set 152A may themselves provide progress indications to the coordinator 140 in some embodiments, in which case separate progress monitors 142 may not be required. Based on the collected data and/or on other factors (e.g., based on the time that has elapsed since the initial deployment 133, or the accumulated billing charges associated with stage 105-1), the training coordinator may determine that deployment change 134A is to be implemented. An additional pair of EPs, EP 150A and EP 150G, may be added to EP set 152A to form a second EP set 152B for the next stage 105-2 of the training phase 105. The boundaries between stages 105-1 and 105-2 (and between stages 105-2 and 105-3) may be defined by the deployment change decisions made at the coordinator 140 in various embodiments—that is, there may not be any intrinsic difference in the types of operations performed in the different stages, other than the set of EPs implementing the operations. Generally speaking, each stage of the training phase may comprise a respective set of operations or computations. The training coordinator may continue collecting metrics from sources such as resource monitors 143 and training progress monitors 142.
In the example scenario depicted in
Overview of Data Parallelism Approaches
In one specific non-limiting example, the model to be trained may be a neural network for automatic speech recognition (“ASR”), such as an acoustic model. The neural network may be configured to accept input vectors that include some number of feature vectors computed from audio data of user utterances. The neural network may operate on the input vectors, applying weights at any number of internal layers of the neural network, eventually producing an output vector. The output vector may include a likelihood, for each phoneme or other subword unit of a given language, that the input vector corresponds to the particular phoneme or other subword unit. Training data for such a neural network may include feature vectors computed from audio of user utterances, known correct transcriptions of the user utterances, or known correct phonemes for each feature vector, etc.
As shown in
In a baseline version of a training technique, each EP 250 may apply all the updates it has computed based on the analysis of its partition of the TDS (as indicated by elements 215A and 215B). Because each EP determines its parameter updates based on output from different training data input, the models at the different EPs may diverge. In order to ensure that each copy of the model being trained is using the same parameters, the EPs may exchange model synchronization data. As indicated by arrows 217, each EP may transmit respective sets of parameter adjustment data (e.g., the complete partial gradient, or some condensed version thereof) to other EPs. The received parameter adjustments may then be applied (as indicated by elements 216A and 216B) in addition to the local parameter updates at each EP. For example, such data transfers may be performed as soon as a given mini-batch is processed in some embodiments. Over time, as more and more of TDS 212 is analyzed, the number of changes that have to be applied to the model's parameters may decrease, and the volume of data that has to be transferred may therefore decrease as well. Eventually, the model parameters may converge to values which do not require further changes (i.e., additional changes may not make any appreciable difference to the prediction errors), at which point the training may be considered complete. (Of course, as indicated earlier, in some cases such convergence may not be a prerequisite for ending the training phase—instead, the training phase may be terminated when the entire TDS 212 has been examined a predetermined number of times, or if resources or time allocated for training the model have been exhausted.)
In a refinement of the baseline training technique, in some embodiments, an EP 250 may determine which individual update values will make a substantial difference in the model. This subset of update values may be referred to as the “salient gradient.” In some embodiments, only those update values that meet or exceed some predetermined or dynamically determined threshold may be included in the salient gradient. In such embodiments, each EP 250 may apply its own salient gradient to its own local copy of the model in order to modify the parameters of the model. The model synchronization data may include the salient gradient that each respective EP applied to its own copy of the model. Using the salient gradient instead of the complete partial gradient may help to reduce the volume of data transfers among the EPs in at least some embodiments, with little or no impact to the overall quality of the trained model's predictions. It is noted that with respect to gradient-based training algorithms, the dynamic scaling techniques described herein may be applied independently of the particular variants or refinements of the algorithm.
Deployment Changes Triggered by Reduction in Bandwidth Requirements
Any desired number of EPs may be used to implement training techniques of the kind discussed in the context of
In the depicted example scenario, K execution platforms are deployed to begin the training phase of a particular model using a parallelizable training technique, and the maximum volume of data transfer (Dmax) occurs near the beginning of the training. Curve 302 represents changes in the amount of data to be transferred as the training phase proceeds. A training coordinator may monitor the amount of data transferred (e.g., by collecting data transfer or bandwidth usage metrics from each of the EPs, or by sampling metrics from some subset of the EPs). As the data transfer volume decreases relative to Dmax, three deployment changes may be initiated by the training coordinator in the depicted example. When curve 302 crosses the (0.75*Dmax level), L additional EPs may be deployed in a first deployment change DC1. Similarly, when curve 302 crosses the (0.5*Dmax) level, deployment change DC2 may involve the addition of M EPs, and when curve 302 crosses (0.25*Dmax), an additional N EPs may be deployed as part of deployment change DC3. DC1, DC2 and DC3 may be categorized as bandwidth demand-based or bandwidth demand-triggered deployment changes. The specific triggering conditions or thresholds for bandwidth-demand based deployment changes may vary in different implementations. For example, instead of using relative values with respect to a maximum data transfer volume (such as 0.75*Dmax for DC1, 0.5*Dmax for DC2 etc.), absolute reductions in demands may be used to trigger deployment changes in some embodiments. Any desired levels of bandwidth demand reduction may be used for triggering deployment changes in various embodiments. In one embodiment, if the data transfer volume increases beyond a threshold during some stage of the training phase, the number of EPs deployed may be reduced. In other embodiments, if the data transfer volume increases, the number of EPs deployed may be kept constant at least for some period, e.g., in the expectation that the rate of increase is unlikely to be sustained.
Deployment Changes at Epoch Boundaries
In some embodiments, factors other than (or in addition to) bandwidth demand changes may be taken into account when making deployment changes with respect to parallelism. In at least some training techniques, the training data set may be examined several times before the training is considered complete. For example, a single pass through the entire training data set may often be insufficient to reach the optimization goals of the training technique, so one or more additional passes through the data set may be scheduled. Each complete pass through the training data set may be termed an “epoch” herein.
In the example scenario illustrated in
Eventually, at approximately time T2, each of the four EPs 150A-150D may complete their pass through their respective partition, thereby completing a first epoch, and the completion of the epoch may trigger deployment change 455 in the depicted embodiment. The number of EPs deployed for the next epoch may be doubled from four to eight in deployment change 455. Thus, at time (T2+delta), eight EPs 150A-150H may be deployed in total, and the data set may be partitioned into eight smaller partitions A2-H2 for the respective EPs for the second epoch. Such a deployment change may be made under the assumption that the amount of model parameter synchronization data that will need to be transferred during the second epoch or pass through the training data is likely to be less than the amount that was transferred during the first epoch, for example. In some embodiments in which deployment changes are made at epoch boundaries, the training coordinator may attempt to verify that there is in fact a downward trend in the data transfer volume as the first epoch nears its end, before making a deployment change of the kind shown in
Intra-Epoch Deployment Changes
Instead of waiting until an epoch is completed to make a deployment change, in some embodiments a training coordinator may alter the EP set of a training phase during the course of an epoch under certain conditions.
The training coordinator may monitor the progress of the different EPs in the depicted embodiment (represented by shaded portions 515), and detect at approximately time T1 that EPs 150A and 150C have made much less progress through their partitions than EPs 150B and 150D. If the difference between the relative amounts of progress made by different EPs exceeds a threshold, this may trigger a deployment change 555 in the depicted embodiment. For example, an addition EP 150E may be assigned to share the processing of the as-yet-unexamined portion of original partition A with EP 150A, and an additional EP 150F may be assigned to share the processing of the as-yet-unexamined original partition C with EP 150C. The unexamined portion of partition A may thus in effect be divided into two new partitions A2.1 and A2.2 assigned to EPs 150A and 150E respectively, and similarly the unexamined portion of partition C may be divided into two new partitions C2.1 and C2.2 assigned to EPs 150C and 150F respectively. In at least some embodiments, the training coordinator may not necessarily implement a deployment change such as DC 555 on the basis of the lagging progress of one or more EPs—instead, additional factors such as a reduction in bandwidth demand may also be taken into account. Thus, in some embodiments, new EPs may not be assigned in the middle of a given epoch unless at least some threshold reduction in data transfer bandwidth demand has occurred, even if the current set of EPs differ greatly from one another in their relative progress through their partitions.
Resource Utilization Based Deployment Changes
In some embodiments, aggregated or average resource utilization levels within the EP pool may be taken into account when making at least some types of deployment changes. Considerations of resource utilization (or possible exhaustion of resource capacity) may be especially important when a model is being trained using multi-tenant or shared resources, as may occur at a machine learning service such as that illustrated in
Graph 601 indicates the utilization level of a particular resource within an EP pool, with elapsed time increasing from left to right. Running averages of the utilization level (e.g., averaged over some recent interval of X minutes or seconds) may be used for deployment decisions in the depicted embodiment, instead of using instantaneous utilization values which may fluctuate more rapidly. The utilization of any of a number of different resources may impact deployment changes in the depicted embodiment. For example, one such resource may be the average fraction of consumed network bandwidth capacity between a given EP and the rest of the EP pool. The ratio of EPs that are currently assigned to other machine learning tasks, to the total size of the EP pool, may constitute another resource utilization level which could impact deployment changes. In general, the utilization level of any such resource associated with the EP pool may change over time, as indicated by curve 602.
In the example scenario depicted in
A minimum interval 610 between successive resource availability-based deployment decisions may be enforced in some embodiments. Thus, even though a training coordinator may be configured to make a deployment change when the resource utilization decreases from 2*Util-init to 1.5*Util-init in the depicted embodiment, and such a change occurs at time T3, the minimum interval constraint may prevent a deployment change at T3. At T4, however, when a second such change occurs, a corresponding deployment change DC2 may be implemented in the depicted embodiment, as the interval elapsed since the previous deployment change is longer than minimum interval 610. For example, in some embodiments additional EPs may be assigned to the training phase at T4 if more EPs have once again become available relative to T2, or if more bandwidth has become available relative to T2.
It is noted that in various embodiments, a training coordinator may make deployment change decisions based on any desired combination of factors of the kinds discussed with respect to
Heterogeneous Execution Platforms
As mentioned earlier, in some embodiments a variety of execution platforms may be usable for training machine learning model.
When making deployment change decisions in such an environment, the training coordinator may therefore have to select the number of EPs of each class to be deployed, e.g., taking various factors into account such as the specific training technique being employed and the progress that has already been made with respect to parameter convergence. In the example shown in
Execution Platforms as Participants in Deployment Decisions
As mentioned earlier, the role of the training coordinator or deployment change decision maker may be played by a variety of different entities, modules or devices in various embodiments. In some embodiments, the execution platforms being used during a given phase may themselves play an active role in making the decisions.
In the embodiment depicted in
In the embodiment shown in
Machine Learning Service
Client-submitted requests to train models using specified training data sets may each be translated into one or more units of work called “jobs” in the depicted embodiment, with corresponding job objects being generated and stored in the job queue 942. In some embodiments, training requests submitted via interfaces 961 may include client-specified parameters indicating whether dynamic scaling of the execution platform sets to be used for the training is to be attempted, or whether the client prefers a static set of execution platforms for the entire training phase. Thus, a client may programmatically pre-approve deployment changes which may be made at the MLS during the training phase in some embodiments, without necessarily being aware of what those changes might involve. In one embodiment, a model training request may indicate one or more constraints or preferences which may be taken into account when the MLS decides whether dynamic deployment changes of the kind discussed above are to be made, and/or the kinds of deployment changes to make. For example, a client may indicate a budget limit, a resource limit, and/or a time limit, and the MLS may use such constraints to decide the initial deployment set for the training job, as well as whether and when deployment changes are to be made. The triggering conditions for deployment changes may be indicated by clients in some embodiments, and/or desired or targeted properties of the execution platform sets to be used during different stages of training may be indicated by the clients. For example, a client may indicate that the training phase for a particular model is to start with up to N execution platforms of a particular category, and that no more than 4N such platforms are to be used during the training phase.
Jobs may be removed from job queue 942 by a component of a workload distribution strategy layer 975, as indicated by arrow 913, and a processing plan may be identified for each such job. The workload distribution strategy layer 975 may determine the manner in which the lower level operations of the job are to be distributed among one or more computation engines selected from pool 985, and/or the manner in which the data analyzed or manipulated for the job is to be distributed among one or more storage devices or servers. In the depicted embodiment, the workload distribution strategy layer 975 may include one or more training coordinators 906 responsible for making the kinds of deployment change decisions discussed earlier. After the processing plan has been generated and the appropriate set of resources to be utilized for the job has been identified, the job's operations may be scheduled on the resources. Results of some jobs (e.g., trained models) may be stored as MLS artifacts within repository 920 in some embodiments, as indicated by arrow 943.
A client request 911 may indicate various parameters that may be used by the MLS to perform the operations, such as a data source definition (which may indicate a source for a training data set), a feature processing transformation recipe, or parameters to be used for a particular machine learning algorithm. Some machine learning workflows, which may correspond to a sequence of API requests from a client 964, may include the extraction and cleansing of input data records from raw data repositories 930 (e.g., repositories indicated in data source definitions 950) by input record handlers 960 of the MLS, as indicated by arrow 914. In at least some embodiments, the input data reaching the MLS may be encrypted or compressed, and the MLS input data handling machinery may have to perform decryption or decompression before the input data records can be used for training or other machine learning tasks. For some types of machine learning requests, the output produced by the input record handlers may be fed to feature processors 962 (as indicated by arrow 915), where a set of transformation operations may be performed in accordance with various transformation recipes, e.g., using another set of resources from pool 985. The output 916 of the feature processing transformations may in turn be used as input for a selected machine learning algorithm 966, which may be executed using yet another set of resources from pool 985. A wide variety of machine learning algorithms may be supported natively by the MLS, including for example regression algorithms, classification algorithms (such as random forest algorithms), neural network algorithms, and the like. In at least one embodiment, the MLS may be designed to be extensible—e.g., clients may provide or register their own modules (which may be specified as user-defined functions) for input record handling, feature processing, or for implementing additional machine learning algorithms than are supported natively by the MLS.
In the embodiment depicted in
Methods for Supporting Dynamically Scalable Training Fleets
As shown in element 1004, a parallelizable or parallel training technique may be selected for the model based on various factors. In some cases the request may indicate the particular technique to be used, for example. In some embodiments the technique may be selected from a library of available techniques, e.g., based on the kind of model to be generated, one or more knowledge base entries, the size of the training data set, and/or the number of execution platforms that are currently available for use. In some embodiments, a selected training technique may have the property that the amount of synchronization data (e.g., gradient data used to coordinate model parameter updates) that has to be transferred among the participating parallel platforms generally tends to decrease as an optimization goal of the technique is approached—e.g., as the optimization converges on a solution such as a minimization of an error function, fewer adjustments typically have to be made to the model parameters. Examples of such techniques may include variants of stochastic gradient descent, and/or variants of the Broyden-Fletcher-Goldfarb-Shanno (BFGS) algorithm in some embodiments.
An initial set of execution platforms may be selected from a pool of platforms to start the training phase (element 1007). The number and type of platforms chosen for the initial state may be selected based on factors such as the particular technique being used, the amount of training data to be examined, a preference indicated by the client on whose behalf the model is to be trained, and the like.
One or more triggering conditions for deployment changes (e.g., changes to the number and/or type of platforms to be used for at least some of the remaining operations of the training phase at the time the change decision is made) may be identified (element 1010), along with the particular changes to be made if and when the conditions are met (e.g., whether the number of platforms is to be decreased or increased, whether different classes of platforms are to be deployed after the change, and so on). Sources of the data that are to be used to make the deployment change decisions may also be identified, such as training progress or epoch completion monitors, resource utilization monitors, network monitors and the like. In some embodiments, respective triggering conditions for different deployment changes may be identified, and some of the conditions may have other conditions as prerequisites. For example, a first condition C1 which is to lead to a deployment change DC1 may be identified, and a second condition which is to lead to a different deployment change DC2 only if DC1 has already been implemented may be identified. In some embodiments, only the triggering conditions may be identified, and the specific changes to be made to the execution platform set of the conditions are met may be determined after the conditions are met.
The training phase may be started using the initial set of execution platforms (element 1013). The training data set may be partitioned among the platforms in some embodiments for at least some training techniques. For other training techniques, the training data set may not have to be partitioned—e.g., each participant platform may examine the same set of observation records. In some implementations, the entire training data set may be stored in a plurality of files and may be accessible from each of the execution platforms. In such cases, the training data set may be partitioned by indicating to each execution platform the particular files it is to examine (or the particular offset ranges within the particular files for the observation records to be analyzed by the individual platforms).
Various types of metrics that may influence deployment changes may be collected (e.g., once every T seconds), and the progress of the training towards one or more training goals may be tracked (element 1016). If the collected data indicates that one or more of the triggering conditions has been met (as detected in element 1019), and sufficient resources are available to make a corresponding deployment change, a different set of execution platforms may be selected from the pool of platforms (element 1022) and the training data set may be repartitioned for the next stage of training if necessary. The process of collecting data may be resumed (element 1016), and more deployment changes may be implemented as needed. If one or more of the training goals have been met (e.g., if the parameter values have met the optimization criterion being targeted, the time allocated for training has expired, or a target number of epochs or passes through the training data set has been completed) (as also detected in element 1019), the training phase may be terminated. The trained model may be stored (e.g., in a repository of MLS artifacts similar to that shown in
It is noted that in various embodiments, some of the operations shown in
Use Cases
The techniques described above, of using dynamically scaling the set of execution platforms used to train a given machine learning model, may be useful in a variety of environments. Many problem domains being addressed using machine learning, including, for example, statistical machine translation, other natural language processing tasks, so-called deep learning applications and the like may require analysis of terabytes or even petabytes of data. In some cases, multiple passes through the training data may be required to achieve results with desired levels of accuracy, further extending the training time and cost. The algorithms used to train models for such domains may in some cases be parallelizable: e.g., the training data sets may be partitioned and individual partitions may be analyzed on separate execution platforms. However, the speedup made possible in principle by parallelization may not necessarily be achieved if the amount of parameter synchronization data that is transferred among the parallel trainers results in a networking bottleneck. Furthermore, the amount of data that has to be transferred may vary dramatically during the course of training a given model: for example, much more data may have to be transferred in the early stages of training than in the later stages when the parameters are closer to their optimum or final values. By keeping track of the varying requirements (e.g., bandwidth required for synchronization) and constraints (e.g., the number of available execution platforms) of the training process as it proceeds, and adjusting the deployed resources accordingly, training times and costs may be minimized for various machine learning problems.
Illustrative Computer System
In at least some embodiments, a server that implements one or more of the techniques described above for dynamically scaling the collection of execution platforms used for training a machine learning model (including for example training coordinators, the training execution platforms themselves, and/or various components of a machine learning service) may include a general-purpose computer system that includes or is configured to access one or more computer-accessible media.
In various embodiments, computing device 9000 may be a uniprocessor system including one processor 9010, or a multiprocessor system including several processors 9010 (e.g., two, four, eight, or another suitable number). Processors 9010 may be any suitable processors capable of executing instructions. For example, in various embodiments, processors 9010 may be general-purpose or embedded processors implementing any of a variety of instruction set architectures (ISAs), such as the ×86, PowerPC, SPARC, or MIPS ISAs, or any other suitable ISA. In multiprocessor systems, each of processors 9010 may commonly, but not necessarily, implement the same ISA. In some implementations, graphics processing units (GPUs) may be used instead of, or in addition to, conventional processors.
System memory 9020 may be configured to store instructions and data accessible by processor(s) 9010. In at least some embodiments, the system memory 9020 may comprise both volatile and non-volatile portions; in other embodiments, only volatile memory may be used. In various embodiments, the volatile portion of system memory 9020 may be implemented using any suitable memory technology, such as static random access memory (SRAM), synchronous dynamic RAM or any other type of memory. For the non-volatile portion of system memory (which may comprise one or more NVDIMMs, for example), in some embodiments flash-based memory devices, including NAND-flash devices, may be used. In at least some embodiments, the non-volatile portion of the system memory may include a power source, such as a supercapacitor or other power storage device (e.g., a battery). In various embodiments, memristor based resistive random access memory (ReRAM), three-dimensional NAND technologies, Ferroelectric RAM, magnetoresistive RAM (MRAM), or any of various types of phase change memory (PCM) may be used at least for the non-volatile portion of system memory. In the illustrated embodiment, program instructions and data implementing one or more desired functions, such as those methods, techniques, and data described above, are shown stored within system memory 9020 as code 9025 and data 9026.
In one embodiment, I/O interface 9030 may be configured to coordinate I/O traffic between processor 9010, system memory 9020, network interface 9040 or other peripheral interfaces such as various types of persistent and/or volatile storage devices. In some embodiments, I/O interface 9030 may perform any necessary protocol, timing or other data transformations to convert data signals from one component (e.g., system memory 9020) into a format suitable for use by another component (e.g., processor 9010). In some embodiments, I/O interface 9030 may include support for devices attached through various types of peripheral buses, such as a Low Pin Count (LPC) bus, a variant of the Peripheral Component Interconnect (PCI) bus standard or the Universal Serial Bus (USB) standard, for example. In some embodiments, the function of I/O interface 9030 may be split into two or more separate components, such as a north bridge and a south bridge, for example. Also, in some embodiments some or all of the functionality of I/O interface 9030, such as an interface to system memory 9020, may be incorporated directly into processor 9010.
Network interface 9040 may be configured to allow data to be exchanged between computing device 9000 and other devices 9060 attached to a network or networks 9050, such as other computer systems or devices as illustrated in
In some embodiments, system memory 9020 may be one embodiment of a computer-accessible medium configured to store program instructions and data as described above for
Various embodiments may further include receiving, sending or storing instructions and/or data implemented in accordance with the foregoing description upon a computer-accessible medium. Generally speaking, a computer-accessible medium may include storage media or memory media such as magnetic or optical media, e.g., disk or DVD/CD-ROM, volatile or non-volatile media such as RAM (e.g. SDRAM, DDR, RDRAM, SRAM, etc.), ROM, etc., as well as transmission media or signals such as electrical, electromagnetic, or digital signals, conveyed via a communication medium such as network and/or a wireless link.
The various methods as illustrated in the Figures and described herein represent exemplary embodiments of methods. The methods may be implemented in software, hardware, or a combination thereof. The order of method may be changed, and various elements may be added, reordered, combined, omitted, modified, etc.
Various modifications and changes may be made as would be obvious to a person skilled in the art having the benefit of this disclosure. It is intended to embrace all such modifications and changes and, accordingly, the above description to be regarded in an illustrative rather than a restrictive sense.
Number | Name | Date | Kind |
---|---|---|---|
4821333 | Gillies | Apr 1989 | A |
7743003 | Tong et al. | Jun 2010 | B1 |
8078556 | Adi et al. | Dec 2011 | B2 |
8429103 | Aradhye et al. | Apr 2013 | B1 |
8606730 | Tong et al. | Dec 2013 | B1 |
8612368 | Burdick et al. | Dec 2013 | B2 |
8682814 | DiCorpo et al. | Mar 2014 | B2 |
8744981 | Servedio et al. | Jun 2014 | B1 |
20050105712 | Williams et al. | May 2005 | A1 |
20060179016 | Forman et al. | Aug 2006 | A1 |
20100268519 | Henning | Oct 2010 | A1 |
20120154373 | Finocchio et al. | Jun 2012 | A1 |
20120253927 | Qin et al. | Oct 2012 | A1 |
20130290223 | Chapelle et al. | Oct 2013 | A1 |
20140046879 | MacLennan et al. | Feb 2014 | A1 |
Entry |
---|
Dean, et al., Large Scale Distributed Deep Networks, NIPS'12 Proceedings of the 25th International Conference on Neural Information Processing Systems—vol. 1, 2012, pp. 1223-1231 (Year: 2012). |
U.S. Appl. No. 14/087,852, filed Nov. 22, 2013, Nikko Strom. |
U.S. Appl. No. 14/569,458, filed Dec. 12, 2014, Leo Parker Dirac, et al. |
U.S. Appl. No. 14/319,902, filed Jun. 30, 2014, Leo Parker Dirac. |
U.S. Appl. No. 14/460,314, filed Aug. 14, 2014, Leo Parker Dirac. |
U.S. Appl. No. 14/460,312, filed Aug. 14, 2014, Leo Parker Dirac. |
U.S. Appl. No. 14/463,434, filed Aug. 19, 2014, Robert Mattihias Steele. |
U.S. Appl. No. 14/489,448, filed Sep. 17, 2014, Leo Parker Dirac. |
U.S. Appl. No. 14/489,449, filed Sep. 17, 2014, Leo Parker Dirac. |
U.S. Appl. No. 14/538,723, filed Nov. 11, 2014, Polly Po Yee Lee, et al. |
http://en.wikipedia.org/wiki/Broyden%E2%80%93Fletcher%E2%80%93Goldfarb%E2%80%93Shanno_algorithm, “Broyden-Fletcher-Goldfarb-Shanno Algorithm”, Downloaded Apr. 1, 2015, pp. 1-5. |
http://en.wikipedia.org/wiki/Limitedmemory_BFGS, “Limited-memory BFGS”, Downloaded Apr. 1, 2015, pp. 1-5. |
“API Reference”, Google Prediction API, Jun. 12, 2013, 1 page. |
“Google Prediction API”, Google developers, Jun. 9, 2014, 1 page. |