LitGPT benchmarking: Use native PyTorch checkpointing in the dynamo+thunder path #1370
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use the native PyTorch checkpoint option in litgpt benchmark for the Thunder Dynamo path
Ref #1298.
H100*8 ZeRO3 with checkpointing
torchrun --nproc_per_node=8 --nnodes=1 thunder/benchmarks/benchmark_litgpt.py --model_name CodeLlama-34b-hf --micro_batch_size 1 --compile thunder-dynamo --checkpoint_activations=True --distributed_mode=fsdp --shard_mode zero3 --max_iters=4 --warmup_iters=1
Note:
This PR enable the ThunderFX + native PyTorch checkpointing
Single GPU:
the splitter creates the module as follows:
The checkpoint operator is not supported by Thunder and fallback to running with inductor(the converter PR #1261 can fix this)
ZeRO3:
Dynamo only passes parts of the original model to the backend (the
gm
inThunderCompiler.__call__
) that do not contain a checkpoint operator when--bucketing_mode=none
is used.