Repository navigation
Activation Checkpoint improvment - #1645
Conversation
tianyu-l
left a comment
There was a problem hiding this comment.
- shall we update all the
parallelize.pyfiles to depend on this file? - @xmfan mentioned that there could be silent numerical incorrectness when we compile MoE, which sounds concerning if we always recommend compiling to work with FlexAttention in this PR.
| from torchtitan.tools.logging import logger | ||
|
|
||
| # for selective op activation checkpointing | ||
| _save_list = { |
There was a problem hiding this comment.
I think it's preferable if we can create customized list for each individual model if necessary, in addition to some default save_list.
E.g. MoE and dense models may need different save_list, and it sounds bad if we just mix everything.
This refactor can happen in a separate PR.
I did, but somehow the change was not uploaded. It should be good now.
ye, I also don't want to force users to always torch.compile. But even a hack to enable SAC + FlexAttention requires some discussion. As for now, I would keep this suggestion since we mainly focus on performance at this moment. We should make the hack work soon. cc., @drisspg @soulitzer @bdhirsh |
|
uh, there are some conflicts, let me fix it |
This PR refactors the activation checkpoint by moving `apply_ac()` out of the llama3 `parallelize.py` module. Additionally, it introduces a warning about the configuration combinations involving SAC, `torch.compile`, and `flex_attention` to inform users of potential issues.
9cc3dcf to
42a7cae
Compare
@tianyu-l Right now, I think this applies only to when you set |
|
@xmfan so just to confirm:
|
|
Yes on 1 and 2. For 3, there's other things broken with |
This PR refactors the activation checkpoint by moving `apply_ac()` out of the llama3 `parallelize.py` module. Additionally, it introduces a warning about the configuration combinations involving SAC, `torch.compile`, and `flex_attention` to inform users of potential issues. This PR depends on pytorch/pytorch#161541 cc., @drisspg @bdhirsh @soulitzer
This PR refactors the activation checkpoint by moving `apply_ac()` out of the llama3 `parallelize.py` module. Additionally, it introduces a warning about the configuration combinations involving SAC, `torch.compile`, and `flex_attention` to inform users of potential issues. This PR depends on pytorch/pytorch#161541 cc., @drisspg @bdhirsh @soulitzer
This PR refactors the activation checkpoint by moving `apply_ac()` out of the llama3 `parallelize.py` module. Additionally, it introduces a warning about the configuration combinations involving SAC, `torch.compile`, and `flex_attention` to inform users of potential issues. This PR depends on pytorch/pytorch#161541 cc., @drisspg @bdhirsh @soulitzer
This PR refactors the activation checkpoint by moving
apply_ac()out of the llama3parallelize.pymodule. Additionally, it introduces a warning about the configuration combinations involving SAC,torch.compile, andflex_attentionto inform users of potential issues.This PR depends on pytorch/pytorch#161541
cc., @drisspg @bdhirsh @soulitzer