Skip to content

[DataLoader2] Adding support for naive snapshotting#915

Closed
NivekT wants to merge 39 commits intogh/NivekT/102/basefrom
gh/NivekT/102/head
Closed

[DataLoader2] Adding support for naive snapshotting#915
NivekT wants to merge 39 commits intogh/NivekT/102/basefrom
gh/NivekT/102/head

Conversation

@NivekT
Copy link
Contributor

@NivekT NivekT commented Dec 6, 2022

NivekT added a commit that referenced this pull request Dec 6, 2022
ghstack-source-id: c2ca295
Pull Request resolved: #915
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 6, 2022
@NivekT NivekT marked this pull request as draft December 6, 2022 01:51
self.datapipe = self.reading_service.initialize(self.datapipe)
self._adapted = True
self.reading_service._restore_naive_datapipe_snapshot(n_samples_yielded, initial_seed)
# TODO: I might want to skip `initialize_iteration` after this????
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: long term we probably want to have a seed generator in DataLoader2

shared_seed_int: int = shared_seed.item() # type: ignore[assignment]
_seed_generator = torch.Generator()
_seed_generator.manual_seed(shared_seed_int)
self._initial_seed = shared_seed_int
Copy link
Contributor Author

@NivekT NivekT Dec 6, 2022

Choose a reason for hiding this comment

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

The way I should get original state, prior to generate_random_scalar_tensor I should get PyTorch global random state.

When I restore, my restoration function should restore that state prior to calling initialize_iteration (probably by iter(dp2))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Think about what user will call (probably iter(dl2)), and how that will trigger various initialization methods

NivekT added a commit that referenced this pull request Dec 7, 2022
ghstack-source-id: 7d8e524
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Dec 7, 2022
ghstack-source-id: 216780a
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Dec 7, 2022
ghstack-source-id: 5a70ee1
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Dec 14, 2022
ghstack-source-id: f4865bc
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Dec 15, 2022
ghstack-source-id: 6e50986
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Dec 17, 2022
ghstack-source-id: 53ac5e5
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Dec 18, 2022
ghstack-source-id: d5c7c1b
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Jan 3, 2023
ghstack-source-id: 10d4213
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Jan 13, 2023
ghstack-source-id: b4e60ce
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Jan 18, 2023
ghstack-source-id: 713a9b2
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Jan 18, 2023
ghstack-source-id: ad7ba39
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Feb 15, 2023
ghstack-source-id: 3bfe854
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Feb 15, 2023
ghstack-source-id: 0c975a9
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Feb 15, 2023
ghstack-source-id: ad4f5eb
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Feb 16, 2023
ghstack-source-id: 066a960
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Feb 28, 2023
ghstack-source-id: d4aa3f4
Pull Request resolved: #915
@NivekT NivekT changed the title [PrototypeRS] Adding support for naive snapshotting [DataLoader2] Adding support for naive snapshotting Feb 28, 2023
@NivekT
Copy link
Contributor Author

NivekT commented Feb 28, 2023

@NivekT has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

NivekT added a commit that referenced this pull request Mar 17, 2023
ghstack-source-id: 50a7241
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Mar 17, 2023
ghstack-source-id: b4fc8fd
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Mar 24, 2023
ghstack-source-id: 695f62c
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Mar 24, 2023
ghstack-source-id: c9c0fa4
Pull Request resolved: #915
NivekT added a commit that referenced this pull request Mar 27, 2023
ghstack-source-id: e771ff1
Pull Request resolved: #915
@facebook-github-bot
Copy link
Contributor

Hi @NivekT!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@NivekT
Copy link
Contributor Author

NivekT commented Jun 11, 2023

Closing. Feel free to re-open if someone else would like to work on this.

@NivekT NivekT closed this Jun 11, 2023
@facebook-github-bot facebook-github-bot deleted the gh/NivekT/102/head branch July 18, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants