-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add options to precompute the epoch #569
Open
knighton
wants to merge
17
commits into
main
Choose a base branch
from
james/precompute
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _push_back_pregen_epoch_todo(self, todo_filename: str, epoch: int, sample: int) -> None: def _pop_front_pregen_epoch_todo(self, todo_filename: str) -> Tuple[int, int, int]: def _request_pregen_epoch(self, epoch: int, sample: int) -> None: def _each_pregen_epoch_todo(self) -> Iterator[Tuple[int, int]]: def _pregen_epoch_loop(self) -> None:
… james/precompute
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add the option to pre-generate the epoch. This should save us a lot of time when there is a lot of work happening between creating the StreamingDataset and iterating it.
Pre-generating can happen concurrently with the last third of init and beyond by providing which epoch and sample offset to generate (
init_pregen_epoch
init_pregen_sample
). Note that this is before anyload_state_dict()
so if there is going to be a resumption happening to not0:0
, we won't know it at that time, although the user might. Also, we can't just yolo all the epochs at once because of RAM/scale concerns. Finally, we need to be provided DataLoadernum_workers
for this to work, as we won't otherwise know it in a rank process without resorting to the garbage collector trampoline.Pre-generating can happen on the fly as well, more easily so, by setting the bool arg
pregen_next_epoch
, which simply pre-generatesepoch + 1:0
in the background when done generating (or loading pre-generated) the current epoch.Details are managed by
pregen_epoch_timeout
(defaults to 12 min) andpregen_epoch_tick
(defaults to0xCAFE / 1337 / 42
, or just under a second).