Skip to content

Conversation

dakinggg
Copy link
Contributor

@dakinggg dakinggg commented Oct 12, 2022

What does this PR do?

Add support for autoresume with distributed training.

What issue(s) does this change relate to?

Fixes CO-1238
While fixing this issue, we discovered a race condition that is related to this, that is CO-1270

Manual testing

Manually tested a script that makes a trainer, trains it, makes another trainer with autoresume, and verifies that the params and run name are the same. This was tested on multiples gpus on one node.

Multi node does not currently work, but I also can't really test/debug it because of limited capacity on our cluster.

Before submitting

  • Have you read the contributor guidelines?
  • Is this change a documentation change or typo fix? If so, skip the rest of this checklist.
  • Was this change discussed/approved in a GitHub issue first? It is much more likely to be merged if so.
  • Did you update any related docs and document your change?
  • Did you update any related tests and add any new tests related to your change? (see testing)
  • Did you run the tests locally to make sure they pass?
  • Did you run pre-commit on your change? (see the pre-commit section of prerequisites)

@dakinggg dakinggg marked this pull request as ready for review October 13, 2022 16:47
@dakinggg dakinggg requested a review from hanlint October 13, 2022 16:47
mvpatel2000
mvpatel2000 previously approved these changes Oct 13, 2022
Copy link
Contributor

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!! Approving to unblock, left some really minor nits for conventions we've used in repo. Actually, I'm not sure we're consistent with these... but it'd be nice to do so 🤷

@mvpatel2000 mvpatel2000 dismissed their stale review October 13, 2022 17:30

Discussed offline -- lets actually hold this PR until we can test multinode instead of doing it in two parts

Copy link
Contributor

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let Hanlin approve since it'd be nice to get two pairs of eyes on this. LGTM tho. Amazing job!

Copy link
Contributor

@hanlint hanlint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one suggestion to clean up the code a bit

@dakinggg dakinggg requested a review from eracah as a code owner October 15, 2022 00:16
@dakinggg dakinggg requested a review from hanlint October 15, 2022 00:40
@dakinggg
Copy link
Contributor Author

dakinggg commented Oct 15, 2022

@hanlint I changed the num_concurrent_uploads default to 1. I experimented a bit, and at least on the demo example, if you checkpoint enough to want multiple upload workers, it seems that you end up bottlenecked on network communication with s3 (streaming data in and sending checkpoints out). With 1 worker, you should only end up with an invalid symlink (pointing to one checkpoint before the actual latest) if the job dies between finishing uploading the checkpoint and uploading the symlink (which is tiny). This would be quite unlikely, and even this issue could be resolved by having save_overwrite=True when using autoresume.

@dakinggg dakinggg enabled auto-merge (squash) October 15, 2022 01:04
Copy link
Contributor

@eracah eracah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock!

@dakinggg dakinggg merged commit 07dc317 into mosaicml:dev Oct 15, 2022
@dakinggg dakinggg deleted the auto_resumption branch October 20, 2022 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants