NVIDIA / NVIDIA/Megatron-LM

[QUESTION] checkpointing/loading memory overhead

Open
#1,380 7 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
17.9k
Forks
4.5k
Avg merge
4d 6h
Merged PRs (30d)
271

Description

It seems that in current implementation the torch_dist checkpointing and loading will introduce around 2GB GPU memory overhead for rank 0 (for a 400m model), which will cause OOM if the original GPU untilization is high.

Is there a way to free this GPU memory allocation after successfully checkpointing/loading? so that such overhead will not impact the later training process, otherwise it's quite annoying as it requires an additional test (and optimization if OOM) for checkpointing and loading.

(tried with adding torch.cuda.empty_cache() in the checkpointing function but not working. And the load_checkpoint function alr has a "torch.cuda.empty_cache()" in the end)

Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.