jolly-florist-66728
09/12/2024, 8:34 PMtorchrun. Flyte's intratask checkpointing allows tasks to save their state periodically, enabling recovery from failures without restarting the entire task. This is particularly useful for long-running tasks and can be combined with elastic training to handle dynamic resource allocation and worker failures gracefully.
For example, you can configure an elastic training task with intratask checkpoints as follows:
from flytekit import task, workflow
from flytekitplugins.kfpytorch import Elastic
@task(
task_config=Elastic(
nnodes=2,
nproc_per_node=4,
),
retries=3 # Set retries to enable fault tolerance
)
def train_model():
# Training logic with checkpointing
...
@workflow
def training_workflow():
train_model()
This setup allows the training to continue even if some GPUs go down, leveraging spot instances for cost efficiency.
Sources:
- Flyte Intratask Checkpoints
- Flyte PyTorch Elastic Training
Slack Link
https://flyte-org.slack.com/archives/CP2HDHKE1/p1726173253.532799 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.