Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return bool from snapshot restore_from_latest #498

Closed
wants to merge 1 commit into from

Conversation

ananthsub
Copy link
Contributor

Summary:
As title, this indicates to callers if the states were restored or not. This allows callers to do logic like:

restored = TorchSnapshotSaver.restore_from_latest(...)

# no prior checkpoints, so initialize weights for the first attempt
if not restored:
    <initialization logic>

Reviewed By: daniellepintz

Differential Revision: D48207346

Summary:
As title, this indicates to callers if the states were restored or not. This allows callers to do logic like:

```
restored = TorchSnapshotSaver.restore_from_latest(...)

# no prior checkpoints, so initialize weights for the first attempt
if not restored:
    <initialization logic>
```

Reviewed By: daniellepintz

Differential Revision: D48207346

fbshipit-source-id: 6ea20dced7ee433aa9ee27f52998e3855a9f217e
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D48207346

@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #498 (732fbd6) into master (a9ad674) will increase coverage by 0.00%.
The diff coverage is 80.76%.

@@           Coverage Diff           @@
##           master     #498   +/-   ##
=======================================
  Coverage   86.91%   86.91%           
=======================================
  Files         102      102           
  Lines        8337     8340    +3     
=======================================
+ Hits         7246     7249    +3     
  Misses       1091     1091           
Files Changed Coverage Δ
...orchtnt/framework/callbacks/torchsnapshot_saver.py 89.26% <66.66%> (ø)
...ts/framework/callbacks/test_torchsnapshot_saver.py 89.26% <100.00%> (+0.10%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants