[QUESTION] Is there a way for Megatron to recompute the whole transformer layer except for the flash-attn part?
Open
module: transformer engine
question
- Dominant language
- Python
- Stars
- 17.9k
- Forks
- 4.5k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 271
Description
Hi, as stated in the title, I'm wondering whether megatron provides native functionality like `context_fn` in `torch.utils.checkpoint.checkpoint`, such that flash-attn computation can be excluded from the recomputation of a transformer layer.
For now, I manully modified `tensor_parallel.checkpoint` to accept such an argument. However, issues remain when I want to capture the saved activations in flash-attn and offload them to cpu.
Contributor guide
Assessment
This issue has not been assessed yet.