Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36a4b88

Browse files
basilwongsvekars
andauthored
Mosaic memory profiling tutorial (#3744)
## Description This PR adds a comprehensive tutorial on using [Mosaic](https://github.com/facebookresearch/mosaic) for GPU memory profiling in PyTorch. Mosaic is a post-analysis tool for memory usage that was instrumental in debugging OOM issues during the 405B LLaMA training. ## What users will learn 1. **Categorical Memory Profiling** - Breaking down memory by category (activation, gradient, optimizer, parameters) 2. **Debugging Unexpected Memory** - Using stack trace analysis to find abandoned debug code causing memory bloat 3. **Pipeline Integration** - Using Mosaic's Python API for automated memory monitoring and CI/CD regression testing ## Tutorial structure - Introduction to Mosaic and installation - Simple usage examples (CLI commands) - Real-World Case 1: Activation Checkpointing Analysis - Real-World Case 2: Debugging Unexpected Memory Usage - Real-World Case 3: Pipeline Integration with Python API ## Requirements - PyTorch with CUDA support - `pip install git+https://github.com/facebookresearch/mosaic.git` - GPU required to run the examples ## Related Links - Mosaic Repository: https://github.com/facebookresearch/mosaic --------- Co-authored-by: Svetlana Karslioglu <[email protected]>
1 parent ce954c6 commit 36a4b88

7 files changed

Lines changed: 1196 additions & 0 deletions

.ci/docker/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ onnxscript>=0.2.2
4949
onnxruntime
5050
evaluate
5151
accelerate>=0.20.1
52+
git+https://github.com/facebookresearch/mosaic.git
5253

5354
importlib-metadata==6.8.0
5455

345 KB
Loading
140 KB
Loading
188 KB
Loading

0 commit comments

Comments
 (0)