Spotnik: Designing Distributed Machine Learning for Transient Cloud Resources

Spotnik: Designing Distributed Machine Learning for Transient Cloud Resources

Spotnik: Designing Distributed Machine Learning for Transient Cloud Resources Marcel Wagenländer, Luo Mai, Guo Li, Peter Pietzuch Imperial College London Abstract In a distributed ML job, workers in a cluster train indepen- To achieve higher utilisation, cloud providers offer VMs dent model replicas in parallel and synchronise at the end of with GPUs as lower-cost transient cloud resources. Transient each training step. For synchronisation, workers either use VMs can be revoked at short notice and vary in their avail- a central parameter server [26] or decentralised collective ability. This poses challenges to distributed machine learn- communication, e.g., following an all-reduce pattern [43]. ing (ML) jobs, which perform long-running stateful computa- In many cloud settings, large-scale ML jobs thus have be- tion in which many workers maintain and synchronise model come a dominant workload [11]. Large models and datasets replicas. With transient VMs, existing systems either require a yield higher accuracies at the cost of using more cloud re- fixed number of reserved VMs or degrade performance when sources (e.g., GPUs or TPUs) and having longer training times. recovering from revoked transient VMs. Therefore, there is an economic incentive for distributed train- We believe that future distributed ML systems must be de- ing on transient VMs, which can yield cost reductions of up signed from the ground up for transient cloud resources. This to 90% compared to regular reserved VMs [1]. paper describes SPOTNIK, a system for training ML models We argue that it should be possible for distributed ML jobs that features a more adaptive design to accommodate transient to run exclusively on transient VMs. Systems, such as Py- VMs: (i) SPOTNIK uses an adaptive implementation of the all- Torch [38] and TensorFlow [49], however, face challenges reduce collective communication operation. As workers on when running on a transient cloud cluster: (i) workers may transient VMs are revoked, SPOTNIK updates its membership be added and removed from the cluster when transient VMs and uses the all-reduce ring to recover; and (ii) SPOTNIK sup- become available and are revoked, respectively. The system ports the adaptation of the synchronisation strategy between must be designed to support such dynamic changes, and these workers. This allows a training job to switch between differ- changes must not prolong the training process; and (ii) as a ent strategies in response to the revocation of transient VMs. cluster changes based on the available transient VMs, con- Our experiments show that, after VM revocation, SPOTNIK figuration parameters of the ML job are affected. For ex- recovers training within 300 ms for ResNet/ImageNet. ample, a synchronisation strategy that is effective with few workers, such as synchronous stochastic gradient descent (S- 1 Introduction SGD) [23], may suffer from network bottlenecks with many Cloud providers offer transient cloud resources, e.g., transient workers. Therefore, it is hard to deploy a distributed ML job virtual machines (VMs) with GPUs, which are periodically in current systems with one configuration that achieves the auctioned off to the highest bidder and therefore can be re- best performance irrespective of the available transient VMs. voked at short notice. Amazon AWS supports EC2 Spot In- Existing work that attempts to address the above problems stances since 2009 [3], which are revoked with a two-minutes through a hybrid approach, in which a system utilises both notice; Microsoft announced Azure Spot VMs in 2019 [5], transient and reserved VMs [17, 36]. Since reserved VMs which have a 30-second revocation warning. From an eco- cannot be revoked, systems use them e.g., to run parame- nomic point-of-view, the pricing of transient VMs follows the ter servers. This, however, increases the number of reserved law of free markets. A free market is supposed to find the VMs proportionally with more transient VMs, reducing cost optimal price between the cloud providers and its customers benefits. Alternative approaches rely on expensive recovery through supply and demand. Transient VMs therefore allow mechanisms when transient VMs are revoked. For example, providers to increase the utilisation of expensive hardware. workers may periodically checkpoint their state to external The distributed training of machine learning (ML) mod- storage, pausing the training during checkpointing [25, 33]. els, in particular through deep learning, is resource-hungry. When transient VMs are revoked, the state of the lost worker is recovered from the checkpoint, which increases job runtime. be implemented in different ways, and there are two major In contrast, we want to design a distributed ML system that approaches used today: all-reduce organises the workers in runs exclusively and efficiently on dynamic transient VMs. a ring topology, which is used to compute aggregated gradi- We want the design to be future-proof: even when revocation ents [43] or a parameter server allows workers to send their times are reduced from minutes to seconds, a distributed ML local gradients and responds with aggregated gradients [26]. job should achieve fast convergence. In general, the less time When users deploy a ML job in the cloud, they can scale it is spent on handling revocations, the more time can be used by using a cluster of VMs, which typically includes accelerators training tasks. This becomes especially important in serverless such as GPUs for tensor computation. In practice, users face cloud environments [2,4, 19] in which functions are short- a high monetary costs when using dedicated VMs for training. running and there is no concept of revocation notifications. For example, training a BERT-like model with Megatron- The paper introduces SPOTNIK, a distributed ML system LM [45] on 512 NVIDIA V100 GPUs on Azure costs $0.56 for transient VMs that explores two ideas: per second. (1) Adaptive collective communication. SPOTNIK uses a 2.2 Exploiting transient cloud resources novel adaptive collective communication layer that handles dynamic changes to membership of the cluster. The layer Transient cloud resources, such as Google Preemptible (i) detects worker failure due to revoked transient VMs, (ii) ne- VMs [15], Azure low-priority/spot VMs [6], AWS Spot In- gotiates a new membership among all running workers; and stances [1] and IBM Transient VMs [20] have emerged as (iii) notifies the workers to continue training with the new a means to reduce the cost of cloud computing. Transient membership. To handle revocation, this layer embeds control VMs offer weak service level agreements (SLAs) and can be messages as part of an all-reduce operation so that workers revoked when the provider needs the capacity back. For ex- can mutually detect revocation and recover the system by ample, AWS and Azure set a dynamic market price for VMs exchanging local states. To reduce performance overheads, and revoke VMs if the spot price goes above the price de- the control messages reuse the scalable all-reduce graph, and clared by users; Google and Azure also provide preemptible their number sent by each worker is bounded. VMs, which are purchased at fixed discount prices but can be reclaimed after a 30-second notification. (2) Adaptive worker synchronisation. To synchronise work- Cloud providers offer transient VMs because they have ben- ers efficiently irrespective of the cluster size, SPOTNIK adapts its synchronisation strategy at runtime with low overhead. efits for both cloud providers and users. In data centres, cloud It can shift synchronisation among synchronous stochastic providers must maintain redundant resources for planned gradient descent (S-SGD) [23], synchronous model averag- growth, which can be sold as transient VMs before they are ing (S-MA) [22] and asynchronous decentralised parallel reserved by future customers. Furthermore, data centres show a diurnal pattern [14]. In off-peak times, they may have sub- SGD (AD-PSGD) [28]. For this, SPOTNIK relies on high- level synchronisation operators that cover both collective op- stantial idle resources, which can be monetised as transient erations, such as computing global averaged gradients, and resources to improve utilisation. point-to-point operations, such as pair-wise model averag- Cloud users can significantly reduce their costs of using ing. Changing strategies has low overhead because it does cloud GPUs by saving up to 90% compared to reserved in- not require the allocation of new system resources. SPOTNIK stances [1]. Training with transient VMs offers users substan- makes a decision to change the synchronisation strategy by tially lower GPU costs: with the same budget, a user can use monitoring workers. 10 times more GPUs, reducing training times by 80% [27]. In the future, transient cloud resources are likely to grow in 2 ML training with transient cloud resources popularity and thus become the dominant resource type for distributed ML systems. 2.1 Distributed ML training in cloud 2.3 Challenges in using transient resources Distributed ML systems [38, 49] use parallel workers to split the training workload for large ML models. Each worker In practice, performing distributed ML training with transient samples a mini-batch of data from the training dataset and cloud resources is challenging: trains its model replica using the mini-batch stochastic gra- (1) Workers may lose resources at any time. The revoca- dient descent (SGD) algorithm [42]. As replicas are trained tion of transient VMs adversely affects distributed training. with different mini-batches, their parameters (i.e., weights) Workers maintain large intermediate training state, and revok- diverge after each training iteration. The system therefore ing a worker requires this state to be either discarded, com- must use a synchronisation strategy to control the divergence promising consistency and accuracy of the trained model [7], of model replicas. A number of such strategies exist, e.g., syn- or migrated to another worker, adding I/O load and affecting chronous SGD (S-SGD) [23] updates model replicas using training performance [26].

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us