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

Fix RNG key checking #3623

Merged
merged 4 commits into from
Sep 21, 2024
Merged

Fix RNG key checking #3623

merged 4 commits into from
Sep 21, 2024

Conversation

dakinggg
Copy link
Contributor

@dakinggg dakinggg commented Sep 21, 2024

What does this PR do?

Likely with pytorch 2.4, the keys in the state dict include lots of things, and they end up in the planner.

This means that the keys that include the string "rng" in a checkpoint can be like this

['state.integrations.huggingface.tokenizer.tokenizer.json.content.model.vocab.Ġrng',
 'state.integrations.huggingface.tokenizer.tokenizer.json.content.model.vocab._rng',
 'state.integrations.huggingface.tokenizer.tokenizer.json.content.model.vocab.rng',
 'state.integrations.huggingface.tokenizer.tokenizer.json.content.model.vocab.(rng',
 'rng.0.python',
 'rng.0.numpy',
 'rng.0.torch',
 'rng.0.cuda',
 'rng.1.python',
 'rng.1.numpy',
 'rng.1.torch',
 'rng.1.cuda',
 'rng.2.python',
 'rng.2.numpy',
 'rng.2.torch',
 'rng.2.cuda',
 'rng.3.python',
 'rng.3.numpy',
 'rng.3.torch',
 'rng.3.cuda',
 'rng.4.python',
 'rng.4.numpy',
 'rng.4.torch',
 'rng.4.cuda',
 'rng.5.python',
 'rng.5.numpy',
 'rng.5.torch',
 'rng.5.cuda',
 'rng.6.python',
 'rng.6.numpy',
 'rng.6.torch',
 'rng.6.cuda',
 'rng.7.python',
 'rng.7.numpy',
 'rng.7.torch',
 'rng.7.cuda']

The check in our code for processing rng keys is way too lenient, and tries to process the state integrations keys in this example. This PR makes the check stricter.

Manual test:
Run that fails on dev resuming: resumption-metadata-resume-1-EzxHw6
Run that success on this PR resuming: resumption-metadata-resume-fix-1-vhfchJ

@dakinggg dakinggg marked this pull request as ready for review September 21, 2024 02:57
@dakinggg dakinggg requested a review from bigning September 21, 2024 02:57
@dakinggg dakinggg enabled auto-merge (squash) September 21, 2024 03:08
@dakinggg dakinggg merged commit 7597ab6 into mosaicml:main Sep 21, 2024
14 checks passed
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.

2 participants