You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Loss metrics dramatically change after resuming from checkpoint #809
It case it helps to narrow down the issue, it does appear that the shape of the curve of the resumed run is influenced by the config training.steps. It's not exactly the case, but the convergence point seems to be close to the total number of steps.
If I force the resumed run to step beyond training.steps the loss curve goes up very steeply.
Can you be more specific on what were the configs before and after, if you ever changed them? E.g. in the post I only see one set of config, without checkpointing enabled. Please include a full config change.
Also I didn't understand
It's not exactly the case, but the convergence point seems to be close to the total number of steps.
In current setup, we expect resuming from exact same training.steps and warmup_steps, because the behavior of LR scheduler would depend on it. The behavior is undefined if you modify the steps config.
The config used with the default llama3_8b.toml file with those override flags added to the CLI.
In current setup, we expect resuming from exact same training.steps and warmup_steps, because the behavior of LR scheduler would depend on it. The behavior is undefined if you modify the steps config.
This is good to know because it seems a bit unintuitive as it would be common to want to train a checkpoint from a previous job further. What would be the suggested workflow for that? Creating a new checkpoint and reseting the LR scheduler config manually?
That said, the first two 16 GPU runs above were restarted from the checkpoints with the same steps and warmup_steps settings. I just meant that for cases where we do change the steps parameter because we want to train the model further, the shape of the mismatch curve seems to be influenced by this change.
Overall it sounds like something to do with the LR scheduler is the issue here.
This is good to know because it seems a bit unintuitive as it would be common to want to train a checkpoint from a previous job further.
I believe the current setup is more from a fault tolerant perspective -- we know how many steps to train from the very beginning; in case job failed, we can resume from some checkpoints we have saved.
What would be the suggested workflow for that? Creating a new checkpoint and reseting the LR scheduler config manually?
Yeah this is a valid use case we don't support right now but we should add. In fact this relates to your other ask #811
We should make things like data loader, LR scheduler optional in checkpointing. @fegin can you help make a PR on this?
Recovering from a failure. For such a use case, we need to load everything, e.g., model, optimizer, lr_scheduler, dataloader, with the same settings, e.g., --training.steps.
Load from a pre-trained model weights. For such a use case, we need to load model only.
Partially load from a previous-trained checkpoint (including model, optimizer and lr_scheduler) and change the settings (e.g., step, the number of GPUs).
TorchTitan currently supports 1 and 2 very well, but there may be a bug according to this issue. @mori360 and I are working on this.
TorchTitan doesn't support 3 well. @darkmirage your request and #811 belong to 3.
To have good support of 3, TorchTitan needs to support partially checkpoint loading, which @mori360 is doing. We also need a good document to specify what components need to be excluded from loading when doing 3. For example, loading dataloader checkpointing with changes of the number of GPUs won't work.
Reacted by tianyu-l, Yifan Mao, Raven Jiang and Will Constable
Activity
darkmirage commentedon Jan 28, 2025
It case it helps to narrow down the issue, it does appear that the shape of the curve of the resumed run is influenced by the config
training.steps. It's not exactly the case, but the convergence point seems to be close to the total number of steps.If I force the resumed run to step beyond
training.stepsthe loss curve goes up very steeply.tianyu-l commentedon Jan 31, 2025
@darkmirage
Thanks for reporting the issue.
Can you be more specific on what were the configs before and after, if you ever changed them? E.g. in the post I only see one set of config, without checkpointing enabled. Please include a full config change.
Also I didn't understand
In current setup, we expect resuming from exact same
training.stepsandwarmup_steps, because the behavior of LR scheduler would depend on it. The behavior is undefined if you modify the steps config.darkmirage commentedon Jan 31, 2025
The config used with the default
llama3_8b.tomlfile with those override flags added to the CLI.This is good to know because it seems a bit unintuitive as it would be common to want to train a checkpoint from a previous job further. What would be the suggested workflow for that? Creating a new checkpoint and reseting the LR scheduler config manually?
That said, the first two 16 GPU runs above were restarted from the checkpoints with the same
stepsandwarmup_stepssettings. I just meant that for cases where we do change thestepsparameter because we want to train the model further, the shape of the mismatch curve seems to be influenced by this change.Overall it sounds like something to do with the LR scheduler is the issue here.
tianyu-l commentedon Feb 1, 2025
I believe the current setup is more from a fault tolerant perspective -- we know how many steps to train from the very beginning; in case job failed, we can resume from some checkpoints we have saved.
Yeah this is a valid use case we don't support right now but we should add. In fact this relates to your other ask #811
We should make things like data loader, LR scheduler optional in checkpointing.
@fegin can you help make a PR on this?
tianyu-l commentedon Feb 1, 2025
Meanwhile let me try to reproduce this issue.
If it's due to lr scheduler, #794 could have fixed it.
fegin commentedon Feb 4, 2025
There are several checkpointing use cases:
model,optimizer,lr_scheduler,dataloader, with the same settings, e.g.,--training.steps.modelonly.TorchTitan currently supports 1 and 2 very well, but there may be a bug according to this issue. @mori360 and I are working on this.
TorchTitan doesn't support 3 well. @darkmirage your request and #811 belong to 3.
To have good support of 3, TorchTitan needs to support partially checkpoint loading, which @mori360 is doing. We also need a good document to specify what components need to be excluded from loading when doing 3. For example, loading dataloader checkpointing with changes of the number of GPUs won't work.
Avoid using skip() in hf_datasets (#838)
Avoid using skip() in hf_datasets (pytorch#838)
Avoid using skip() in hf_datasets (pytorch#838)
[CI deps] Pin attn-gym 0.0.20 from PyPI and follow its kernel_options…