NVIDIA / NVIDIA/Megatron-LM

[QUESTION] Is there a way for Megatron to recompute the whole transformer layer except for the flash-attn part?

Open
#1,732 3 comments 0 reactions 0 assignees View on GitHub
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

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.