-
Notifications
You must be signed in to change notification settings - Fork 355
[FT] Support local_sgd / diloco in titan #1122
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -399,7 +399,13 @@ def train(self): | |
job_config, global_step=self.step | ||
) as torch_profiler, maybe_enable_memory_snapshot( | ||
job_config, global_step=self.step | ||
) as memory_profiler: | ||
) as memory_profiler, ft.maybe_semi_sync_training( | ||
job_config, | ||
ft_manager=self.ft_manager, | ||
model=self.model_parts[0], | ||
optimizer=self.optimizers, | ||
sync_every=job_config.fault_tolerance.sync_steps, | ||
): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. uh, I just realized that this context can be initialized in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here it's entering context manager for the entire training, across iterations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah interesting. Yeah the FT context is across iterations since it adds hooks to the optimizers and performs synchronization every N iterations (based on the optimizer There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Maybe it'd be good to organize them into two context manager util functions, one for overall train, the other for per training iteration. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good idea, I will add in a follow up PR! |
||
data_iterator = iter(self.dataloader) | ||
while self.step < job_config.training.steps: | ||
self.step += 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add typing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do