Make gradient checkpointing configurable in the predict #1156
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.
Description
In order to save memory and improve computational efficiency, and since gradient checkpointing is used in several parts of the code, having the ability to enable or disable gradient checkpointing in specific sections can provide flexibility to maximize performance while also conserving memory.
Issue Number
Refs #1141
Checklist before asking for review
./scripts/actions.sh lint./scripts/actions.sh unit-test./scripts/actions.sh integration-testlaunch-slurm.py --time 60Comparing the baseline and current PR performance
When
pred_gradient_checkpoint_modeis set to false, the performance and GPU memory peak are as follows:default_config.yml:
../WeatherGenerator-private/hpc/launch-slurm.py --time 60mixed.yml:
../WeatherGenerator-private/hpc/launch-slurm.py --time 60 --config ./config/mixed.ymlFor those GPUs with memory more than
18 GiB, it is recommended to setpred_gradient_checkpoint_modeto False