Lightning Talk: In-Cluster Distributed Checkpointing: Optimizing Training... - G. Kroiz & S. Mishra

PyTorch · Beginner ·🔍 RAG & Vector Search ·8mo ago

Key Takeaways

The video discusses in-cluster distributed checkpointing for optimizing training goodput through GPU node locality, using tools like PyTorch, Meta, and Google Cloud. It highlights the importance of resiliency in AI model training and introduces techniques like asynchronous checkpointing and rank local checkpointing.

Full Transcript

Welcome everyone. Um I'm Sor. I work on PyTorch at Meta and I'm joined here by Gersonen um who comes from Google. And together we're going to talk about some of the scaling bottlenecks for fall tolerance and various solutions um that we developed to resolve those. So in a training job even though we take checkpoints periodically and we restore the training progress uh in the event of a failure uh there's still a non-trivial amount of GPU wasted GPU hours. Um one reason is the checkpointing overhead itself. Um so it we may not want to take a lot of checkpoints. Um the second is the unsafe training progress which is the red block here that you see and it can be as bad as the checkpointing interval itself and it has to be multiplied by the uh number of GPUs in the job. So for large scale jobs we want to minimize this checkpointing interval as much as possible which means that we may want to take as many checkpoints as possible. So you can already see the trade-off here. So more visually if we uh plot the wasted GPU hours or wasted training time against the checkpointing frequency the curve looks something like this. So if we are checkpointing too frequently um then the wasted training time goes up because of the checkpointing overhead and if we are checkpointing too infrequently then again wasted training time goes up because of the larger window of unsafe training progress. So for large jobs we want to take checkpoints very frequently but at the same time we want to reduce the checkpointing overhead to near zero. So what are the different um overheads during checkpointing. So I am taking the example of the asynchronous checkpointing here uh because I'm assuming anybody who cares about training efficiency uh they must already be using asynchronous checkpointing uh in there uh except staging all other steps in the checkpointing like the metadata preparation planning IO upload all those things happen asynchronously now during staging we offload the data from GPU to the host memory and that's why uh there's memory overhead uh overhead we allocate and deallocate the memory for every checkoint point save and also it's pageable memory so page falls also happen leading to inefficiency and again this is a blocking operation for GPUs the next step is the planning step uh where we figure out how different data types need to be serialized and saved in storage uh and we also prepare the metadata so there's metadata preparation cost here uh but the main bottleneck here is the collective um so rank zero coordinates across all these different ranks uh in the job and it gets uh their local metadata. Then it does validations, dduplications, uh creates the global metadata which describes the entire checkpoint. Um and this collective u what we have observed is become uh it becomes quadratically more expensive um with respect to the job size. And in the IO step uh we observe uh that the GPU utilization uh gets impacted because of the uh global interpreter lock uh contention between the trainer threads and checkpointing threads. So on the right you can see the plot of GPU utilization and the red line in the middle uh demarcates the time when staging has completed and after that the GPU utilization should come back to the previous baseline but you can see that it's sub-optimal uh it's less than expected and finally uh the checkpointing can only happen as fast as the storage bandwidth allows right so there are storage bandwidth constraints as well so we developed various optimizations for staging uh we uh now do pin memory memory based staging. So the memory is page locked. So we don't run into uh page falls. Uh also another interesting idea here is that during the forward step of the training weights do not change. So we overlap the uh staging step with the forward step. So effectively the staging uh becomes partially or completely asynchronous. For the planning step uh we introduce the rank local checkpointing where every rank uh saves and restores its own data and metadata. Another interesting idea is that across different versions of the checkpoint the metadata that describes the checkpoint that does not change. So we can cache the metadata in all these runtime objects and we can amortize the metadata preparation cost across different checkpoint saves. Finally, for IO optimizations, uh we built the process-based checkpointing which completely eliminated the gill contention issues uh that I described earlier. And for storage bandwidth constraints, we built in-cluster uh checkpointing where we stage and replicate the checkpoint within the cluster itself. To provide more technical details, I'll invite my friend Garrison here u who will talk more about it. Thank you. One of the reasons we were excited to collaborate with the torch GCP team was so that we could bring some of the latest and greatest checkpointing optimizations to our customers on Google Cloud. I want to provide some more color in what it's like to train on cloud and how to measure efficiency. Cloud customers want to maximize the return on investment, right? And care a lot about raw performance metrics such as MFU, tokens per second, and step time. These are great metrics for understanding the overall model's efficiency within a short period of time. As you have larger training jobs, due to the sheer distributed scale of these workloads, customers will run into unexpected failures and uh fault tolerant issues. Due to the highly coupled nature of AI workloads, when one node goes down, the entire training job stops making any progress. And this really emphasizes the overall importance or the importance of overall performance. Right? We don't only care about performance at a single step time, but the performance over the course of the entire training job. We define a metric goodput for this. And to understand goodput, there's a visual on the right. The bar represents the total time spent training where 80% of the time is spent training at peak performance. The remaining 20% of the time is time wasted due to unexpected interruptions, failures and stragglers and things of this nature. We could define goodput as the percent of time spent on productive training or 80%. The remaining time is considered badput 1 minus 20 or 1 - 80% which is 20%. Goodput is important to customers as it has go to market implications and could save millions of dollars. Now tying back in checkpoint, why is checkpointing so important to goodput? There are a few reasons here. During stable training, every checkpoint you save has some degree of saving overhead and this results in slower step times and ultimately longer time to converge. Furthermore, during these unexpected interruptions, you have to reload your state back into HBM. This is loading overhead, which is ultimately time not spent training. And furthermore, you have to revert state to an old checkpoint. Any progress not saved is considered lost and the time spent trained on these lost steps is considered waste in progress. The async checkpointing optimizations that Sarab went over are great for minimizing the checkpoint badput but alone are not good enough due to existing storage IO bottlenecks especially within a cloud environment where your storage is in a persistent location. So we collaborate together to develop an in-cluster checkpointing solution for our customers in Google cloud and aims to minimize checkpointing badput. We define incluster checkpointing as local checkpoints being able to save and save and uh load checkpoints locally without a persistent storage. Here we see just the cluster itself in which you could manage all of your checkpoints. The obvious uh benefit of this is the read and write speeds are much faster since you could take advantage of RAM disk. Now you could also tie this in with a more traditional persistent checkpointing uh based solution to have a multi-tered checkpointing solution. Right? You save your checkpoints frequently, frequently locally, and infrequently to persistent storage in case of any catastrophic clusterwide failures. When you add on the torch DCP async optimizations that Sar went over, you're able to push saving overhead to near zero, which allows you to fully utilize and take advantage of the ability to save checkpoints frequently locally. Now, I want to provide a bit of an illustrative example on how incluster checkpointing works. Here we have an oversimplified workload uh of a customer's training job where we have four nodes, two data replicas and we have one hot spare. You can notice the hotspare does not have checkpointing state because checkpointing state is or the the training state is updated frequently. But now let's say one node goes down, right? To resume training as quickly as possible, customers will reserve a portion of their capacity such that when this node goes down, you could swap it back into place. However, you can see node E just swapped in place doesn't have the checkpoint state. Furthermore, in place reset is not guaranteed. And what is meant by this is that as you swap in and out nodes, your overall network topology changes. And this dictates how you define your distributive collectives and groups. And so because of this, in this example, node A and node C swap positions in our network topology and thus need to transfer state. So with incluster checkpointing in our solution, we're able to replicate state during loading time, right? We see node A and C both already in the cluster swapping state and we also see node A giving its state to node E such that node E has the need to checkpoints and could resume training after all this swapping which takes advantage of the uh nickel collectives. We're able to then resume training. Now I want to like I hope that built some intuition on how incluster checkpointing works. But we also have some imperial core results. Here's a plot showing the checkpointing impact on badput. Right? On the y-axis we plot the overall badput percentage incurred from checkpointing and on the x-axis we show the number of interruptions a day. We can see that as you introduce each of these async checkpointing optimizations that s went over, we're able to reduce our badput percentage. Furthermore, with the addition of in-cluster checkpointing, we're able to even further push our the bad push percentage closer to zero. I think one of the highle takeaways here is that incluster checkpointing as well as these uh async optimizations are important and that with your depending on how frequently you run into these interruptions, you may need a various uh degree of sophistication. And in the most extreme of cases with all these optimizations, you're able to reduce badput incurred from checkpointing by over 50%. That concludes our talk. Uh we're happy to take any questions afterwards and if you're interested in learning more, we have several links attached to the slide blog post we worked on together and also like Google Cloud's approach to resiliency and checkpointing. Thank you.

Original Description

Lightning Talk: In-Cluster Distributed Checkpointing: Optimizing Training Goodput Through GPU Node Locality - Gerson Kroiz, Google & Saurabh Mishra, Meta As AI model training scales to thousands of GPUs, resiliency becomes essential. Failures—due to preemption, crashes, or infrastructure issues—can cause major training inefficiency and delay time-to-market. Checkpointing enables recovery, but traditional methods relying on remote storage often introduce latency and scalability challenges. This talk presents In-Cluster Checkpointing, a new feature built on PyTorch’s Distributed Checkpointing (DCP) APIs that leverages node-local storage for faster, more scalable checkpointing. Each GPU node saves and restores its local training state, enabling frequent, low-overhead checkpoints that reduce training progress lost and restart latency. To support node replacement (e.g., due to failure or preemption), local checkpoints are automatically replicated and transferred to new nodes during recovery. Co-developed by Google Cloud’s GPU Resiliency team and Meta’s Distributed Checkpointing team, this solution has improved training goodput by up to 5% in large-scale deployments—saving many thousands of GPU hours over multi-week run. Attendees will gain practical insights on integrating this technique to improve goodput in their own training jobs.
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from PyTorch · PyTorch · 0 of 60

← Previous Next →
1 What is PyTorch?
What is PyTorch?
PyTorch
2 PyTorch Tutorial: A Quick Preview
PyTorch Tutorial: A Quick Preview
PyTorch
3 PyTorch Summer Hackathon 2019
PyTorch Summer Hackathon 2019
PyTorch
4 Tips and Tricks on Hacking with PyTorch: A Quick Tutorial by Brad Heintz
Tips and Tricks on Hacking with PyTorch: A Quick Tutorial by Brad Heintz
PyTorch
5 PyTorch 1.2 and PyTorch Hub: A Quick Introduction by Soumith Chintala and Ailing Zhang
PyTorch 1.2 and PyTorch Hub: A Quick Introduction by Soumith Chintala and Ailing Zhang
PyTorch
6 Torchtext 0.4 with Supervised Learning Datasets: A Quick Introduction by George Zhang
Torchtext 0.4 with Supervised Learning Datasets: A Quick Introduction by George Zhang
PyTorch
7 Torchaudio 0.3 with Kaldi Compatibility, New Transforms: A Quick Introduction by Jason Lian
Torchaudio 0.3 with Kaldi Compatibility, New Transforms: A Quick Introduction by Jason Lian
PyTorch
8 Torchvision 0.4 with Support for Video: A Quick Introduction by Francisco Massa
Torchvision 0.4 with Support for Video: A Quick Introduction by Francisco Massa
PyTorch
9 Introduction to Machine Learning for Developers at F8 2019
Introduction to Machine Learning for Developers at F8 2019
PyTorch
10 Powered by PyTorch at F8 2019
Powered by PyTorch at F8 2019
PyTorch
11 Developing and Scaling AI Experiences at Facebook with PyTorch at F8 2019
Developing and Scaling AI Experiences at Facebook with PyTorch at F8 2019
PyTorch
12 New Approaches to Image and Video Reconstruction Using Deep Learning at Facebook at F8 2019
New Approaches to Image and Video Reconstruction Using Deep Learning at Facebook at F8 2019
PyTorch
13 PyTorch Developer Conference 2018: Recap
PyTorch Developer Conference 2018: Recap
PyTorch
14 PyTorch Developer Conference 2018: Keynote & Deep Dive
PyTorch Developer Conference 2018: Keynote & Deep Dive
PyTorch
15 PyTorch Developer Conference 2018: Production & Research Sessions
PyTorch Developer Conference 2018: Production & Research Sessions
PyTorch
16 PyTorch Developer Conference 2018: Cloud & Academia Sessions
PyTorch Developer Conference 2018: Cloud & Academia Sessions
PyTorch
17 PyTorch Developer Conference 2018: Enterprise, Education, & Future of AI Panel
PyTorch Developer Conference 2018: Enterprise, Education, & Future of AI Panel
PyTorch
18 PyTorch Developer Conference 2019 | Full Livestream
PyTorch Developer Conference 2019 | Full Livestream
PyTorch
19 PyTorch Developer Conference 2019: Recap
PyTorch Developer Conference 2019: Recap
PyTorch
20 PyTorch Developer Conference Keynote - Mike Schroepfer
PyTorch Developer Conference Keynote - Mike Schroepfer
PyTorch
21 What’s new in PyTorch 1.3 - Lin Qiao
What’s new in PyTorch 1.3 - Lin Qiao
PyTorch
22 PyTorch Front-End Features: Named Tensors and Type Promotion - Gregory Chanan
PyTorch Front-End Features: Named Tensors and Type Promotion - Gregory Chanan
PyTorch
23 Research to Production: PyTorch JIT/TorchScript Updates - Michael Suo
Research to Production: PyTorch JIT/TorchScript Updates - Michael Suo
PyTorch
24 Quantization - Dmytro Dzhulgakov
Quantization - Dmytro Dzhulgakov
PyTorch
25 PyTorch ONNX Export Support - Lara Haidar, Microsoft
PyTorch ONNX Export Support - Lara Haidar, Microsoft
PyTorch
26 Apex -  Michael Carilli, NVIDIA
Apex - Michael Carilli, NVIDIA
PyTorch
27 Dataloader Design for PyTorch - Tongzhou Wang, MIT
Dataloader Design for PyTorch - Tongzhou Wang, MIT
PyTorch
28 Linear Algebra in PyTorch - Vishwak Srinivasan, CMU
Linear Algebra in PyTorch - Vishwak Srinivasan, CMU
PyTorch
29 PyTorch Mobile - David Reiss
PyTorch Mobile - David Reiss
PyTorch
30 Model Interpretability with Captum - Narine Kokhilkyan
Model Interpretability with Captum - Narine Kokhilkyan
PyTorch
31 Detectron2 - Next Gen Object Detection Library - Yuxin Wu
Detectron2 - Next Gen Object Detection Library - Yuxin Wu
PyTorch
32 Speech Extensions to Fairseq - Dmytro Okhonko
Speech Extensions to Fairseq - Dmytro Okhonko
PyTorch
33 PyTorch on Google Cloud TPUs - Google, Salesforce, Facebook
PyTorch on Google Cloud TPUs - Google, Salesforce, Facebook
PyTorch
34 PyTorch Summer Hackathon Winners - Joe Spisak, Sebastien Arnold, Tristan Deleu
PyTorch Summer Hackathon Winners - Joe Spisak, Sebastien Arnold, Tristan Deleu
PyTorch
35 PyTorch in Robotics - Yisong Yue, Caltech
PyTorch in Robotics - Yisong Yue, Caltech
PyTorch
36 StanfordNLP - Yuhao Zhang, Stanford
StanfordNLP - Yuhao Zhang, Stanford
PyTorch
37 Sotabench for Reproducible Research - Robert Stojnic, Papers with Code
Sotabench for Reproducible Research - Robert Stojnic, Papers with Code
PyTorch
38 Collaborative Natural Language Inference - Sasha Rush, Cornell
Collaborative Natural Language Inference - Sasha Rush, Cornell
PyTorch
39 Privacy Preserving AI - Andrew Trask, OpenMined
Privacy Preserving AI - Andrew Trask, OpenMined
PyTorch
40 CrypTen - Laurens van der Maaten
CrypTen - Laurens van der Maaten
PyTorch
41 PyTorch at Uber - Sidney Zhang, Uber
PyTorch at Uber - Sidney Zhang, Uber
PyTorch
42 PyTorch at Tesla - Andrej Karpathy, Tesla
PyTorch at Tesla - Andrej Karpathy, Tesla
PyTorch
43 PyTorch at Microsoft - Saurabh Tiwary, Microsoft
PyTorch at Microsoft - Saurabh Tiwary, Microsoft
PyTorch
44 PyTorch at Dolby Labs - Vivek Kumar, Dolby Labs
PyTorch at Dolby Labs - Vivek Kumar, Dolby Labs
PyTorch
45 PyTorch Developer Conference 2019 - Panel Discussion
PyTorch Developer Conference 2019 - Panel Discussion
PyTorch
46 Using deep learning and PyTorch to power next gen aircraft at Caltech
Using deep learning and PyTorch to power next gen aircraft at Caltech
PyTorch
47 Named Tensors, Model Quantization, and the Latest PyTorch Features - Part 1
Named Tensors, Model Quantization, and the Latest PyTorch Features - Part 1
PyTorch
48 TorchScript and PyTorch JIT | Deep Dive
TorchScript and PyTorch JIT | Deep Dive
PyTorch
49 Announcing the PyTorch Global Summer Hackathon 2020
Announcing the PyTorch Global Summer Hackathon 2020
PyTorch
50 Opening Up the Black Box: Model Understanding with Captum and PyTorch
Opening Up the Black Box: Model Understanding with Captum and PyTorch
PyTorch
51 PyTorch Mobile Runtime for Android
PyTorch Mobile Runtime for Android
PyTorch
52 Torchvision in 5 minutes
Torchvision in 5 minutes
PyTorch
53 3D Deep Learning with PyTorch3D
3D Deep Learning with PyTorch3D
PyTorch
54 What is Torchtext?
What is Torchtext?
PyTorch
55 TorchAudio: A Quick Intro
TorchAudio: A Quick Intro
PyTorch
56 PyTorch Mobile Runtime for iOS
PyTorch Mobile Runtime for iOS
PyTorch
57 PySlowFast: Deep learning with Video
PySlowFast: Deep learning with Video
PyTorch
58 PyTorch Pruning | How it's Made by Michela Paganini
PyTorch Pruning | How it's Made by Michela Paganini
PyTorch
59 Measuring Fairness in Machine Learning Systems
Measuring Fairness in Machine Learning Systems
PyTorch
60 PyTorch for Hackathons
PyTorch for Hackathons
PyTorch

This video teaches how to optimize training goodput through in-cluster distributed checkpointing, using techniques like asynchronous checkpointing and rank local checkpointing. It highlights the importance of resiliency in AI model training and provides solutions for minimizing checkpoint badput.

Key Takeaways
  1. Offload data from GPU to host memory
  2. Allocate and deallocate memory for each checkpoint save
  3. Prepare metadata for each checkpoint
  4. Coordinate across ranks for collective operations
  5. Validate and duplicate metadata for each checkpoint
  6. Implement in-cluster checkpointing
  7. Use rank local checkpointing
💡 In-cluster checkpointing can eliminate storage IO bottlenecks and minimize checkpoint badput, leading to optimized training goodput.

Related Reads

📰
Reciprocal Rerank Fusion (RRF): The Simple, Powerful Way to Combine Keyword + Semantic Search in RAG
Learn how to combine keyword and semantic search in RAG using Reciprocal Rerank Fusion (RRF) for improved search results
Dev.to · Christopher S. Aondona
📰
RAG Evaluation with RAGAs: Faithfulness, Context Recall, and Answer Relevance
Learn to evaluate RAG models using RAGAs, focusing on faithfulness, context recall, and answer relevance, to improve AI assistant performance
Dev.to · Michael Pham
📰
Stop Serving Raw Cosine Scores: Explainable RAG Confidence Scoring at Query Time
Learn to move beyond raw cosine scores for RAG confidence scoring and create more explainable and trustworthy results
Dev.to AI
📰
The RAG Complexity Trap: Do More Components Actually Improve Retrieval Performance?
Learn to evaluate the effectiveness of additional components in RAG systems and avoid unnecessary complexity
Medium · LLM
Up next
Does RAG relevant now? #aiwithakash #genai #llm #rag
AI with Akash
Watch →