TraceMachina / TraceMachina/nativelink
[Idea] Checkpoint support
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 244
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 54
Description
Today I heard an interesting use case. Sometimes users may want to have processes that take a very long time, like training a ML model, but want to upload resume-able checkpoints that if the program is resumed it will resume from the last checkpoint.
Specific use case:
- Training program takes 3 days to run on a single GPU instance.
- The intermediate state can be quite like (100GB+), so uploads are slow.
- While the intermediate state is being uploaded, we want to keep the ML model training on the same GPU with same state.
- If the task is terminated turbo-cache should attempt to resume the process from the last saved state.
- A special
ActionResultwill be uploaded to AC for the task with alast_statetag in the hash (maybe environmental variable?). This will allow actions to be run against whatever the most recent state of the action cache is. For example to run some heuristics on the last model being trained (like TensorBoard).
Obviously this would be very difficult to implement right. It would be great if we could just snapshot memory state & files, upload it and allow it to be resumed, but certain things like GPU drivers present issues. We could easily do this by sending special signals to the program like: SIGUSR1, SIGUSR2, SIGVTALRM or exc, then the program would need to do the actions needed to save the resume-state files to disk then inform turbo-cache worker process it is done. TurboCache will then upload the state and the special "latest" ActionCache result.
This would obviously represent non-deterministic behavior, but it would be a configured parameter on the worker, so only use cases that specifically request this functionality would be allowed to use it (ie: opt-in to non-determinism).
Projects that do similar stuff:
https://github.com/checkpoint-restore/criu
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name files or tests. Start by tracing the TurboCache worker, ActionResult upload, and action-cache paths mentioned in the proposal; define the opt-in checkpoint protocol and verify that a terminated long-running task can resume from its latest uploaded state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100